Commit d5565c1f authored by arv's avatar arv Committed by Commit bot

Revert of [es6] Map/Set size getter should have "get size" name (patchset #4...

Revert of [es6] Map/Set size getter should have "get size" name (patchset #4 id:80001 of https://codereview.chromium.org/1094323005/)

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}
parent 83c89a2e
...@@ -82,7 +82,7 @@ static Handle<String> NameToFunctionName(Handle<Name> name) { ...@@ -82,7 +82,7 @@ static Handle<String> NameToFunctionName(Handle<Name> name) {
stringName = Handle<String>::cast(name); stringName = Handle<String>::cast(name);
} }
return String::Flatten(stringName); return stringName;
} }
......
...@@ -46,8 +46,7 @@ function InstallGetter(object, name, getter, attributes) { ...@@ -46,8 +46,7 @@ function InstallGetter(object, name, getter, attributes) {
if (typeof attributes == "undefined") { if (typeof attributes == "undefined") {
attributes = DONT_ENUM; attributes = DONT_ENUM;
} }
%FunctionSetName(getter, "get " + %FunctionSetName(getter, name);
(IS_SYMBOL(name) ? "[" + %SymbolDescription(name) + "]" : name));
%FunctionRemovePrototype(getter); %FunctionRemovePrototype(getter);
%DefineAccessorPropertyUnchecked(object, name, getter, null, attributes); %DefineAccessorPropertyUnchecked(object, name, getter, null, attributes);
%SetNativeFlag(getter); %SetNativeFlag(getter);
...@@ -56,10 +55,8 @@ function InstallGetter(object, name, getter, attributes) { ...@@ -56,10 +55,8 @@ function InstallGetter(object, name, getter, attributes) {
// Helper function to install a getter/setter accessor property. // Helper function to install a getter/setter accessor property.
function InstallGetterSetter(object, name, getter, setter) { function InstallGetterSetter(object, name, getter, setter) {
var functionName = %FunctionSetName(getter, name);
IS_SYMBOL(name) ? "[" + %SymbolDescription(name) + "]" : name; %FunctionSetName(setter, name);
%FunctionSetName(getter, "get " + functionName);
%FunctionSetName(setter, "set " + functionName);
%FunctionRemovePrototype(getter); %FunctionRemovePrototype(getter);
%FunctionRemovePrototype(setter); %FunctionRemovePrototype(setter);
%DefineAccessorPropertyUnchecked(object, name, getter, setter, DONT_ENUM); %DefineAccessorPropertyUnchecked(object, name, getter, setter, DONT_ENUM);
......
// 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__');
...@@ -443,7 +443,6 @@ assertTrue(setSizeDescriptor.get instanceof Function); ...@@ -443,7 +443,6 @@ assertTrue(setSizeDescriptor.get instanceof Function);
assertEquals(undefined, setSizeDescriptor.get.prototype); assertEquals(undefined, setSizeDescriptor.get.prototype);
assertFalse(setSizeDescriptor.enumerable); assertFalse(setSizeDescriptor.enumerable);
assertTrue(setSizeDescriptor.configurable); assertTrue(setSizeDescriptor.configurable);
assertEquals('get size', setSizeDescriptor.get.name);
var s = new Set(); var s = new Set();
assertFalse(s.hasOwnProperty('size')); assertFalse(s.hasOwnProperty('size'));
...@@ -464,7 +463,6 @@ assertTrue(mapSizeDescriptor.get instanceof Function); ...@@ -464,7 +463,6 @@ assertTrue(mapSizeDescriptor.get instanceof Function);
assertEquals(undefined, mapSizeDescriptor.get.prototype); assertEquals(undefined, mapSizeDescriptor.get.prototype);
assertFalse(mapSizeDescriptor.enumerable); assertFalse(mapSizeDescriptor.enumerable);
assertTrue(mapSizeDescriptor.configurable); assertTrue(mapSizeDescriptor.configurable);
assertEquals('get size', mapSizeDescriptor.get.name);
var m = new Map(); var m = new Map();
assertFalse(m.hasOwnProperty('size')); assertFalse(m.hasOwnProperty('size'));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment