Revert of [es6] Map/Set size getter should have "get size" name (patchset #4 id:80001...
authorarv <arv@chromium.org>
Thu, 23 Apr 2015 22:06:45 +0000 (15:06 -0700)
committerCommit bot <commit-bot@chromium.org>
Thu, 23 Apr 2015 22:06:27 +0000 (22:06 +0000)
Reason for revert:
Breaks GCMole ia32

http://build.chromium.org/p/client.v8/builders/V8%20Linux%20-%20gcmole/builds/1685/steps/GCMole%20ia32/logs/stdio

src/runtime/runtime-function.cc:96:3: warning: Possible problem with evaluation order.
  f->shared()->set_name(*NameToFunctionName(name));
  ^
src/runtime/runtime-function.cc:96:3: warning: Possible problem with evaluation order.
2 warnings generated.

Original issue's description:
> [es6] Map/Set size getter should have "get size" name
>
> Getter and setter function names in ES6 are defined as "get foo" and
> "set foo".
>
> BUG=None
> LOG=N
> R=adamk@chromium.org
>
> Committed: https://crrev.com/83c89a2e71a363afb35595f903423e650d788e42
> Cr-Commit-Position: refs/heads/master@{#28034}

TBR=adamk@chromium.org,caitpotter88@gmail.com
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=None

Review URL: https://codereview.chromium.org/1106713002

Cr-Commit-Position: refs/heads/master@{#28035}

src/runtime/runtime-function.cc
src/v8natives.js
test/mjsunit/es6/built-in-accessor-names.js [deleted file]
test/mjsunit/es6/collections.js

index 98d42080d0a43c1a0e7d7a9200daeb22707b187c..c211e1895f742408281a18f4de7db6b77bcdd202 100644 (file)
@@ -82,7 +82,7 @@ static Handle<String> NameToFunctionName(Handle<Name> name) {
     stringName = Handle<String>::cast(name);
   }
 
-  return String::Flatten(stringName);
+  return stringName;
 }
 
 
index 33f0c8bd03590032930b4dc8e28bc4e9a302a74f..41453d0b5364660c24f8cd9a51c93a9e71de6ffd 100644 (file)
@@ -46,8 +46,7 @@ function InstallGetter(object, name, getter, attributes) {
   if (typeof attributes == "undefined") {
     attributes = DONT_ENUM;
   }
-  %FunctionSetName(getter, "get " +
-      (IS_SYMBOL(name) ? "[" + %SymbolDescription(name) + "]" : name));
+  %FunctionSetName(getter, name);
   %FunctionRemovePrototype(getter);
   %DefineAccessorPropertyUnchecked(object, name, getter, null, attributes);
   %SetNativeFlag(getter);
@@ -56,10 +55,8 @@ function InstallGetter(object, name, getter, attributes) {
 
 // Helper function to install a getter/setter accessor property.
 function InstallGetterSetter(object, name, getter, setter) {
-  var functionName =
-      IS_SYMBOL(name) ? "[" + %SymbolDescription(name) + "]" : name;
-  %FunctionSetName(getter, "get " + functionName);
-  %FunctionSetName(setter, "set " + functionName);
+  %FunctionSetName(getter, name);
+  %FunctionSetName(setter, name);
   %FunctionRemovePrototype(getter);
   %FunctionRemovePrototype(setter);
   %DefineAccessorPropertyUnchecked(object, name, getter, setter, DONT_ENUM);
diff --git a/test/mjsunit/es6/built-in-accessor-names.js b/test/mjsunit/es6/built-in-accessor-names.js
deleted file mode 100644 (file)
index 79de239..0000000
+++ /dev/null
@@ -1,51 +0,0 @@
-// Copyright 2015 the V8 project authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-'use strict';
-
-function assertGetterName(expected, object, name) {
-  var descr = Object.getOwnPropertyDescriptor(object, name);
-  assertSame(expected, descr.get.name);
-}
-
-
-function assertSetterName(expected, object, name) {
-  var descr = Object.getOwnPropertyDescriptor(object, name);
-  assertSame(expected, descr.set.name);
-}
-
-
-assertGetterName('get byteLength', ArrayBuffer.prototype, 'byteLength');
-assertGetterName('get size', Set.prototype, 'size');
-assertGetterName('get size', Map.prototype, 'size');
-
-
-let typedArrays = [
-  Uint8Array,
-  Int8Array,
-  Uint16Array,
-  Int16Array,
-  Uint32Array,
-  Int32Array,
-  Float32Array,
-  Float64Array,
-  Uint8ClampedArray
-];
-
-for (let f of typedArrays) {
-  assertGetterName('get buffer', f.prototype, 'buffer');
-  assertGetterName('get byteOffset', f.prototype, 'byteOffset');
-  assertGetterName('get byteLength', f.prototype, 'byteLength');
-  assertGetterName('get length', f.prototype, 'length');
-  assertGetterName('get [Symbol.toStringTag]', f.prototype, Symbol.toStringTag);
-}
-
-
-assertGetterName('get buffer', DataView.prototype, 'buffer');
-assertGetterName('get byteOffset', DataView.prototype, 'byteOffset');
-assertGetterName('get byteLength', DataView.prototype, 'byteLength');
-
-
-assertGetterName('get __proto__', Object.prototype, '__proto__');
-assertSetterName('set __proto__', Object.prototype, '__proto__');
index e410e2259c8624b460a9f9874ea692def675b45c..e1e7758b1a89e616e47c89483f1a56cd0979b677 100644 (file)
@@ -443,7 +443,6 @@ assertTrue(setSizeDescriptor.get instanceof Function);
 assertEquals(undefined, setSizeDescriptor.get.prototype);
 assertFalse(setSizeDescriptor.enumerable);
 assertTrue(setSizeDescriptor.configurable);
-assertEquals('get size', setSizeDescriptor.get.name);
 
 var s = new Set();
 assertFalse(s.hasOwnProperty('size'));
@@ -464,7 +463,6 @@ assertTrue(mapSizeDescriptor.get instanceof Function);
 assertEquals(undefined, mapSizeDescriptor.get.prototype);
 assertFalse(mapSizeDescriptor.enumerable);
 assertTrue(mapSizeDescriptor.configurable);
-assertEquals('get size', mapSizeDescriptor.get.name);
 
 var m = new Map();
 assertFalse(m.hasOwnProperty('size'));