Revision: 22381
Author: verwa...@chromium.org
Date: Mon Jul 14 14:05:30 2014 UTC
Log: Replace AddProperty by AddNamedProperty to speed up the common
case
BUG=
R=ish...@chromium.org
Review URL: https://codereview.chromium.org/384003003
http://code.google.com/p/v8/source/detail?r=22381
Added:
/branches/bleeding_edge/test/mjsunit/runtime-gen/addnamedproperty.js
Deleted:
/branches/bleeding_edge/test/mjsunit/runtime-gen/addproperty.js
Modified:
/branches/bleeding_edge/src/array-iterator.js
/branches/bleeding_edge/src/array.js
/branches/bleeding_edge/src/arraybuffer.js
/branches/bleeding_edge/src/collection-iterator.js
/branches/bleeding_edge/src/collection.js
/branches/bleeding_edge/src/date.js
/branches/bleeding_edge/src/generator.js
/branches/bleeding_edge/src/i18n.js
/branches/bleeding_edge/src/math.js
/branches/bleeding_edge/src/messages.js
/branches/bleeding_edge/src/object-observe.js
/branches/bleeding_edge/src/promise.js
/branches/bleeding_edge/src/regexp.js
/branches/bleeding_edge/src/runtime.cc
/branches/bleeding_edge/src/runtime.h
/branches/bleeding_edge/src/string-iterator.js
/branches/bleeding_edge/src/string.js
/branches/bleeding_edge/src/symbol.js
/branches/bleeding_edge/src/typedarray.js
/branches/bleeding_edge/src/v8natives.js
/branches/bleeding_edge/src/weak_collection.js
/branches/bleeding_edge/test/cctest/test-api.cc
/branches/bleeding_edge/test/mjsunit/regress/regress-1199637.js
/branches/bleeding_edge/test/mjsunit/regress/regress-334.js
/branches/bleeding_edge/test/mjsunit/regress/regress-cntl-descriptors-enum.js
/branches/bleeding_edge/tools/generate-runtime-tests.py
=======================================
--- /dev/null
+++ /branches/bleeding_edge/test/mjsunit/runtime-gen/addnamedproperty.js
Mon Jul 14 14:05:30 2014 UTC
@@ -0,0 +1,8 @@
+// Copyright 2014 the V8 project authors. All rights reserved.
+// AUTO-GENERATED BY tools/generate-runtime-tests.py, DO NOT MODIFY
+// Flags: --allow-natives-syntax --harmony
+var _object = new Object();
+var arg1 = "bla";
+var _value = new Object();
+var _unchecked_attributes = 1;
+%AddNamedProperty(_object, arg1, _value, _unchecked_attributes);
=======================================
--- /branches/bleeding_edge/test/mjsunit/runtime-gen/addproperty.js Fri Jun
27 13:48:37 2014 UTC
+++ /dev/null
@@ -1,8 +0,0 @@
-// Copyright 2014 the V8 project authors. All rights reserved.
-// AUTO-GENERATED BY tools/generate-runtime-tests.py, DO NOT MODIFY
-// Flags: --allow-natives-syntax --harmony
-var _object = new Object();
-var arg1 = 10;
-var _value = new Object();
-var _unchecked_attributes = 1;
-%AddProperty(_object, arg1, _value, _unchecked_attributes);
=======================================
--- /branches/bleeding_edge/src/array-iterator.js Fri Jun 27 13:48:37 2014
UTC
+++ /branches/bleeding_edge/src/array-iterator.js Mon Jul 14 14:05:30 2014
UTC
@@ -110,8 +110,8 @@
'next', ArrayIteratorNext
));
%FunctionSetName(ArrayIteratorIterator, '[Symbol.iterator]');
- %AddProperty(ArrayIterator.prototype, symbolIterator,
ArrayIteratorIterator,
- DONT_ENUM);
+ %AddNamedProperty(ArrayIterator.prototype, symbolIterator,
+ ArrayIteratorIterator, DONT_ENUM);
}
SetUpArrayIterator();
@@ -125,7 +125,7 @@
'keys', ArrayKeys
));
- %AddProperty($Array.prototype, symbolIterator, ArrayValues, DONT_ENUM);
+ %AddNamedProperty($Array.prototype, symbolIterator, ArrayValues,
DONT_ENUM);
}
ExtendArrayPrototype();
@@ -146,10 +146,10 @@
endmacro
macro EXTEND_TYPED_ARRAY(NAME)
- %AddProperty($NAME.prototype, 'entries', ArrayEntries, DONT_ENUM);
- %AddProperty($NAME.prototype, 'values', ArrayValues, DONT_ENUM);
- %AddProperty($NAME.prototype, 'keys', ArrayKeys, DONT_ENUM);
- %AddProperty($NAME.prototype, symbolIterator, ArrayValues, DONT_ENUM);
+ %AddNamedProperty($NAME.prototype, 'entries', ArrayEntries, DONT_ENUM);
+ %AddNamedProperty($NAME.prototype, 'values', ArrayValues, DONT_ENUM);
+ %AddNamedProperty($NAME.prototype, 'keys', ArrayKeys, DONT_ENUM);
+ %AddNamedProperty($NAME.prototype, symbolIterator, ArrayValues,
DONT_ENUM);
endmacro
TYPED_ARRAYS(EXTEND_TYPED_ARRAY)
=======================================
--- /branches/bleeding_edge/src/array.js Mon Jun 30 08:39:04 2014 UTC
+++ /branches/bleeding_edge/src/array.js Mon Jul 14 14:05:30 2014 UTC
@@ -1460,7 +1460,7 @@
// Set up non-enumerable constructor property on the Array.prototype
// object.
- %AddProperty($Array.prototype, "constructor", $Array, DONT_ENUM);
+ %AddNamedProperty($Array.prototype, "constructor", $Array, DONT_ENUM);
// Set up non-enumerable functions on the Array object.
InstallFunctions($Array, DONT_ENUM, $Array(
=======================================
--- /branches/bleeding_edge/src/arraybuffer.js Fri Jun 27 13:48:37 2014 UTC
+++ /branches/bleeding_edge/src/arraybuffer.js Mon Jul 14 14:05:30 2014 UTC
@@ -74,7 +74,8 @@
%FunctionSetPrototype($ArrayBuffer, new $Object());
// Set up the constructor property on the ArrayBuffer prototype object.
- %AddProperty($ArrayBuffer.prototype, "constructor", $ArrayBuffer,
DONT_ENUM);
+ %AddNamedProperty(
+ $ArrayBuffer.prototype, "constructor", $ArrayBuffer, DONT_ENUM);
InstallGetter($ArrayBuffer.prototype, "byteLength",
ArrayBufferGetByteLen);
=======================================
--- /branches/bleeding_edge/src/collection-iterator.js Mon Jun 30 14:37:07
2014 UTC
+++ /branches/bleeding_edge/src/collection-iterator.js Mon Jul 14 14:05:30
2014 UTC
@@ -75,7 +75,7 @@
));
%FunctionSetName(SetIteratorSymbolIterator, '[Symbol.iterator]');
- %AddProperty(SetIterator.prototype, symbolIterator,
+ %AddNamedProperty(SetIterator.prototype, symbolIterator,
SetIteratorSymbolIterator, DONT_ENUM);
}
@@ -91,7 +91,7 @@
'values', SetValues
));
- %AddProperty($Set.prototype, symbolIterator, SetValues, DONT_ENUM);
+ %AddNamedProperty($Set.prototype, symbolIterator, SetValues, DONT_ENUM);
}
ExtendSetPrototype();
@@ -172,7 +172,7 @@
));
%FunctionSetName(MapIteratorSymbolIterator, '[Symbol.iterator]');
- %AddProperty(MapIterator.prototype, symbolIterator,
+ %AddNamedProperty(MapIterator.prototype, symbolIterator,
MapIteratorSymbolIterator, DONT_ENUM);
}
@@ -188,7 +188,7 @@
'values', MapValues
));
- %AddProperty($Map.prototype, symbolIterator, MapEntries, DONT_ENUM);
+ %AddNamedProperty($Map.prototype, symbolIterator, MapEntries, DONT_ENUM);
}
ExtendMapPrototype();
=======================================
--- /branches/bleeding_edge/src/collection.js Fri Jun 27 13:48:37 2014 UTC
+++ /branches/bleeding_edge/src/collection.js Mon Jul 14 14:05:30 2014 UTC
@@ -147,7 +147,7 @@
%SetCode($Set, SetConstructor);
%FunctionSetPrototype($Set, new $Object());
- %AddProperty($Set.prototype, "constructor", $Set, DONT_ENUM);
+ %AddNamedProperty($Set.prototype, "constructor", $Set, DONT_ENUM);
%FunctionSetLength(SetForEach, 1);
@@ -282,7 +282,7 @@
%SetCode($Map, MapConstructor);
%FunctionSetPrototype($Map, new $Object());
- %AddProperty($Map.prototype, "constructor", $Map, DONT_ENUM);
+ %AddNamedProperty($Map.prototype, "constructor", $Map, DONT_ENUM);
%FunctionSetLength(MapForEach, 1);
=======================================
--- /branches/bleeding_edge/src/date.js Fri Jun 27 13:48:37 2014 UTC
+++ /branches/bleeding_edge/src/date.js Mon Jul 14 14:05:30 2014 UTC
@@ -763,7 +763,7 @@
));
// Set up non-enumerable constructor property of the Date prototype
object.
- %AddProperty($Date.prototype, "constructor", $Date, DONT_ENUM);
+ %AddNamedProperty($Date.prototype, "constructor", $Date, DONT_ENUM);
// Set up non-enumerable functions of the Date prototype object and
// set their names.
=======================================
--- /branches/bleeding_edge/src/generator.js Tue Jul 1 12:12:34 2014 UTC
+++ /branches/bleeding_edge/src/generator.js Mon Jul 14 14:05:30 2014 UTC
@@ -63,13 +63,13 @@
["next", GeneratorObjectNext,
"throw", GeneratorObjectThrow]);
%FunctionSetName(GeneratorObjectIterator, '[Symbol.iterator]');
- %AddProperty(GeneratorObjectPrototype, symbolIterator,
+ %AddNamedProperty(GeneratorObjectPrototype, symbolIterator,
GeneratorObjectIterator, DONT_ENUM | DONT_DELETE | READ_ONLY);
- %AddProperty(GeneratorObjectPrototype, "constructor",
+ %AddNamedProperty(GeneratorObjectPrototype, "constructor",
GeneratorFunctionPrototype, DONT_ENUM | DONT_DELETE | READ_ONLY);
%SetPrototype(GeneratorFunctionPrototype, $Function.prototype);
%SetCode(GeneratorFunctionPrototype,
GeneratorFunctionPrototypeConstructor);
- %AddProperty(GeneratorFunctionPrototype, "constructor",
+ %AddNamedProperty(GeneratorFunctionPrototype, "constructor",
GeneratorFunction, DONT_ENUM | DONT_DELETE | READ_ONLY);
%SetPrototype(GeneratorFunction, $Function);
%SetCode(GeneratorFunction, GeneratorFunctionConstructor);
=======================================
--- /branches/bleeding_edge/src/i18n.js Fri Jun 27 13:48:37 2014 UTC
+++ /branches/bleeding_edge/src/i18n.js Mon Jul 14 14:05:30 2014 UTC
@@ -942,7 +942,7 @@
*
* @constructor
*/
-%AddProperty(Intl, 'Collator', function() {
+%AddNamedProperty(Intl, 'Collator', function() {
var locales = %_Arguments(0);
var options = %_Arguments(1);
@@ -960,7 +960,7 @@
/**
* Collator resolvedOptions method.
*/
-%AddProperty(Intl.Collator.prototype, 'resolvedOptions', function() {
+%AddNamedProperty(Intl.Collator.prototype, 'resolvedOptions', function() {
if (%_IsConstructCall()) {
throw new $TypeError(ORDINARY_FUNCTION_CALLED_AS_CONSTRUCTOR);
}
@@ -997,7 +997,7 @@
* order in the returned list as in the input list.
* Options are optional parameter.
*/
-%AddProperty(Intl.Collator, 'supportedLocalesOf', function(locales) {
+%AddNamedProperty(Intl.Collator, 'supportedLocalesOf', function(locales) {
if (%_IsConstructCall()) {
throw new $TypeError(ORDINARY_FUNCTION_CALLED_AS_CONSTRUCTOR);
}
@@ -1169,7 +1169,7 @@
*
* @constructor
*/
-%AddProperty(Intl, 'NumberFormat', function() {
+%AddNamedProperty(Intl, 'NumberFormat', function() {
var locales = %_Arguments(0);
var options = %_Arguments(1);
@@ -1187,7 +1187,7 @@
/**
* NumberFormat resolvedOptions method.
*/
-%AddProperty(Intl.NumberFormat.prototype, 'resolvedOptions', function() {
+%AddNamedProperty(Intl.NumberFormat.prototype, 'resolvedOptions',
function() {
if (%_IsConstructCall()) {
throw new $TypeError(ORDINARY_FUNCTION_CALLED_AS_CONSTRUCTOR);
}
@@ -1243,7 +1243,7 @@
* order in the returned list as in the input list.
* Options are optional parameter.
*/
-%AddProperty(Intl.NumberFormat, 'supportedLocalesOf', function(locales) {
+%AddNamedProperty(Intl.NumberFormat, 'supportedLocalesOf',
function(locales) {
if (%_IsConstructCall()) {
throw new $TypeError(ORDINARY_FUNCTION_CALLED_AS_CONSTRUCTOR);
}
@@ -1562,7 +1562,7 @@
*
* @constructor
*/
-%AddProperty(Intl, 'DateTimeFormat', function() {
+%AddNamedProperty(Intl, 'DateTimeFormat', function() {
var locales = %_Arguments(0);
var options = %_Arguments(1);
@@ -1580,7 +1580,7 @@
/**
* DateTimeFormat resolvedOptions method.
*/
-%AddProperty(Intl.DateTimeFormat.prototype, 'resolvedOptions', function() {
+%AddNamedProperty(Intl.DateTimeFormat.prototype, 'resolvedOptions',
function() {
if (%_IsConstructCall()) {
throw new $TypeError(ORDINARY_FUNCTION_CALLED_AS_CONSTRUCTOR);
}
@@ -1636,7 +1636,7 @@
* order in the returned list as in the input list.
* Options are optional parameter.
*/
-%AddProperty(Intl.DateTimeFormat, 'supportedLocalesOf', function(locales) {
+%AddNamedProperty(Intl.DateTimeFormat, 'supportedLocalesOf',
function(locales) {
if (%_IsConstructCall()) {
throw new $TypeError(ORDINARY_FUNCTION_CALLED_AS_CONSTRUCTOR);
}
@@ -1768,7 +1768,7 @@
*
* @constructor
*/
-%AddProperty(Intl, 'v8BreakIterator', function() {
+%AddNamedProperty(Intl, 'v8BreakIterator', function() {
var locales = %_Arguments(0);
var options = %_Arguments(1);
@@ -1786,7 +1786,8 @@
/**
* BreakIterator resolvedOptions method.
*/
-%AddProperty(Intl.v8BreakIterator.prototype, 'resolvedOptions', function()
{
+%AddNamedProperty(Intl.v8BreakIterator.prototype, 'resolvedOptions',
+ function() {
if (%_IsConstructCall()) {
throw new $TypeError(ORDINARY_FUNCTION_CALLED_AS_CONSTRUCTOR);
}
@@ -1819,7 +1820,8 @@
* order in the returned list as in the input list.
* Options are optional parameter.
*/
-%AddProperty(Intl.v8BreakIterator, 'supportedLocalesOf', function(locales)
{
+%AddNamedProperty(Intl.v8BreakIterator, 'supportedLocalesOf',
+ function(locales) {
if (%_IsConstructCall()) {
throw new $TypeError(ORDINARY_FUNCTION_CALLED_AS_CONSTRUCTOR);
}
=======================================
--- /branches/bleeding_edge/src/math.js Fri Jun 27 13:48:37 2014 UTC
+++ /branches/bleeding_edge/src/math.js Mon Jul 14 14:05:30 2014 UTC
@@ -260,7 +260,7 @@
%CheckIsBootstrapping();
%SetPrototype($Math, $Object.prototype);
- %AddProperty(global, "Math", $Math, DONT_ENUM);
+ %AddNamedProperty(global, "Math", $Math, DONT_ENUM);
%FunctionSetInstanceClassName(MathConstructor, 'Math');
// Set up math constants.
=======================================
--- /branches/bleeding_edge/src/messages.js Mon Jul 14 13:57:10 2014 UTC
+++ /branches/bleeding_edge/src/messages.js Mon Jul 14 14:05:30 2014 UTC
@@ -286,8 +286,8 @@
* Set up the Script function and constructor.
*/
%FunctionSetInstanceClassName(Script, 'Script');
-%AddProperty(Script.prototype, 'constructor', Script,
- DONT_ENUM | DONT_DELETE | READ_ONLY);
+%AddNamedProperty(Script.prototype, 'constructor', Script,
+ DONT_ENUM | DONT_DELETE | READ_ONLY);
%SetCode(Script, function(x) {
// Script objects can only be created by the VM.
throw new $Error("Not supported");
@@ -1160,9 +1160,9 @@
// effects when overwriting the error functions from
// user code.
var name = f.name;
- %AddProperty(global, name, f, DONT_ENUM);
- %AddProperty(builtins, '$' + name, f,
- DONT_ENUM | DONT_DELETE | READ_ONLY);
+ %AddNamedProperty(global, name, f, DONT_ENUM);
+ %AddNamedProperty(builtins, '$' + name, f,
+ DONT_ENUM | DONT_DELETE | READ_ONLY);
// Configure the error function.
if (name == 'Error') {
// The prototype of the Error object must itself be an error.
@@ -1177,16 +1177,16 @@
%FunctionSetPrototype(f, new $Error());
}
%FunctionSetInstanceClassName(f, 'Error');
- %AddProperty(f.prototype, 'constructor', f, DONT_ENUM);
- %AddProperty(f.prototype, "name", name, DONT_ENUM);
+ %AddNamedProperty(f.prototype, 'constructor', f, DONT_ENUM);
+ %AddNamedProperty(f.prototype, "name", name, DONT_ENUM);
%SetCode(f, function(m) {
if (%_IsConstructCall()) {
// Define all the expected properties directly on the error
// object. This avoids going through getters and setters defined
// on prototype objects.
- %AddProperty(this, 'stack', UNDEFINED, DONT_ENUM);
+ %AddNamedProperty(this, 'stack', UNDEFINED, DONT_ENUM);
if (!IS_UNDEFINED(m)) {
- %AddProperty(this, 'message', ToString(m), DONT_ENUM);
+ %AddNamedProperty(this, 'message', ToString(m), DONT_ENUM);
}
try { captureStackTrace(this, f); } catch (e) { }
} else {
@@ -1209,7 +1209,7 @@
$Error.captureStackTrace = captureStackTrace;
-%AddProperty($Error.prototype, 'message', '', DONT_ENUM);
+%AddNamedProperty($Error.prototype, 'message', '', DONT_ENUM);
// Global list of error objects visited during ErrorToString. This is
// used to detect cycles in error toString formatting.
=======================================
--- /branches/bleeding_edge/src/object-observe.js Thu Jul 3 15:56:01 2014
UTC
+++ /branches/bleeding_edge/src/object-observe.js Mon Jul 14 14:05:30 2014
UTC
@@ -450,7 +450,8 @@
for (var prop in changeRecord) {
if (prop === 'object' || (hasType && prop === 'type')) continue;
- %AddProperty(newRecord, prop, changeRecord[prop], READ_ONLY +
DONT_DELETE);
+ %DefineDataPropertyUnchecked(
+ newRecord, prop, changeRecord[prop], READ_ONLY + DONT_DELETE);
}
ObjectFreezeJS(newRecord);
=======================================
--- /branches/bleeding_edge/src/promise.js Tue Jul 8 14:45:57 2014 UTC
+++ /branches/bleeding_edge/src/promise.js Mon Jul 14 14:05:30 2014 UTC
@@ -325,7 +325,7 @@
// Install exported functions.
%CheckIsBootstrapping();
- %AddProperty(global, 'Promise', $Promise, DONT_ENUM);
+ %AddNamedProperty(global, 'Promise', $Promise, DONT_ENUM);
InstallFunctions($Promise, DONT_ENUM, [
"defer", PromiseDeferred,
"accept", PromiseResolved,
=======================================
--- /branches/bleeding_edge/src/regexp.js Fri Jun 27 13:48:37 2014 UTC
+++ /branches/bleeding_edge/src/regexp.js Mon Jul 14 14:05:30 2014 UTC
@@ -381,7 +381,7 @@
function SetUpRegExp() {
%CheckIsBootstrapping();
%FunctionSetInstanceClassName($RegExp, 'RegExp');
- %AddProperty($RegExp.prototype, 'constructor', $RegExp, DONT_ENUM);
+ %AddNamedProperty($RegExp.prototype, 'constructor', $RegExp, DONT_ENUM);
%SetCode($RegExp, RegExpConstructor);
InstallFunctions($RegExp.prototype, DONT_ENUM, $Array(
=======================================
--- /branches/bleeding_edge/src/runtime.cc Mon Jul 14 14:01:04 2014 UTC
+++ /branches/bleeding_edge/src/runtime.cc Mon Jul 14 14:05:30 2014 UTC
@@ -5195,12 +5195,12 @@
}
-RUNTIME_FUNCTION(Runtime_AddProperty) {
+RUNTIME_FUNCTION(Runtime_AddNamedProperty) {
HandleScope scope(isolate);
RUNTIME_ASSERT(args.length() == 4);
CONVERT_ARG_HANDLE_CHECKED(JSObject, object, 0);
- CONVERT_ARG_HANDLE_CHECKED(Object, key, 1);
+ CONVERT_ARG_HANDLE_CHECKED(Name, key, 1);
CONVERT_ARG_HANDLE_CHECKED(Object, value, 2);
CONVERT_SMI_ARG_CHECKED(unchecked_attributes, 3);
RUNTIME_ASSERT(
@@ -5210,27 +5210,17 @@
static_cast<PropertyAttributes>(unchecked_attributes);
#ifdef DEBUG
- bool duplicate;
uint32_t index = 0;
- if (key->IsName() || !key->ToArrayIndex(&index)) {
- if (key->IsNumber()) {
- ASSIGN_RETURN_FAILURE_ON_EXCEPTION(isolate, key,
- Execution::ToString(isolate,
key));
- }
- LookupIterator it(object, Handle<Name>::cast(key),
- LookupIterator::CHECK_OWN_REAL);
- JSReceiver::GetPropertyAttributes(&it);
- duplicate = it.IsFound();
- } else {
- duplicate = JSReceiver::HasOwnElement(object, index);
- }
- RUNTIME_ASSERT(!duplicate);
+ ASSERT(!key->ToArrayIndex(&index));
+ LookupIterator it(object, key, LookupIterator::CHECK_OWN_REAL);
+ JSReceiver::GetPropertyAttributes(&it);
+ RUNTIME_ASSERT(!it.IsFound());
#endif
Handle<Object> result;
ASSIGN_RETURN_FAILURE_ON_EXCEPTION(
isolate, result,
- Runtime::DefineObjectProperty(object, key, value, attributes));
+ JSObject::SetOwnPropertyIgnoreAttributes(object, key, value,
attributes));
return *result;
}
=======================================
--- /branches/bleeding_edge/src/runtime.h Mon Jul 14 14:01:04 2014 UTC
+++ /branches/bleeding_edge/src/runtime.h Mon Jul 14 14:05:30 2014 UTC
@@ -224,7 +224,7 @@
F(GlobalProxy, 1, 1) \
F(IsAttachedGlobal, 1, 1) \
\
- F(AddProperty, 4, 1) \
+ F(AddNamedProperty, 4, 1) \
F(AddPropertyForTemplate, 4, 1) \
F(SetProperty, 4, 1) \
F(DefineDataPropertyUnchecked, 4, 1) \
=======================================
--- /branches/bleeding_edge/src/string-iterator.js Fri Jun 27 13:48:37 2014
UTC
+++ /branches/bleeding_edge/src/string-iterator.js Mon Jul 14 14:05:30 2014
UTC
@@ -84,8 +84,8 @@
'next', StringIteratorNext
));
%FunctionSetName(StringIteratorIterator, '[Symbol.iterator]');
- %AddProperty(StringIterator.prototype, symbolIterator,
StringIteratorIterator,
- DONT_ENUM);
+ %AddNamedProperty(StringIterator.prototype, symbolIterator,
+ StringIteratorIterator, DONT_ENUM);
}
SetUpStringIterator();
@@ -100,7 +100,7 @@
%CheckIsBootstrapping();
%FunctionSetName(StringPrototypeIterator, '[Symbol.iterator]');
- %AddProperty($String.prototype, symbolIterator, StringPrototypeIterator,
- DONT_ENUM);
+ %AddNamedProperty($String.prototype, symbolIterator,
+ StringPrototypeIterator, DONT_ENUM);
}
ExtendStringPrototypeWithIterator();
=======================================
--- /branches/bleeding_edge/src/string.js Fri Jun 27 13:48:37 2014 UTC
+++ /branches/bleeding_edge/src/string.js Mon Jul 14 14:05:30 2014 UTC
@@ -915,7 +915,7 @@
%FunctionSetPrototype($String, new $String());
// Set up the constructor property on the String prototype object.
- %AddProperty($String.prototype, "constructor", $String, DONT_ENUM);
+ %AddNamedProperty($String.prototype, "constructor", $String, DONT_ENUM);
// Set up the non-enumerable functions on the String object.
InstallFunctions($String, DONT_ENUM, $Array(
=======================================
--- /branches/bleeding_edge/src/symbol.js Fri Jun 27 13:48:37 2014 UTC
+++ /branches/bleeding_edge/src/symbol.js Mon Jul 14 14:05:30 2014 UTC
@@ -113,7 +113,7 @@
"keyFor", SymbolKeyFor
));
- %AddProperty($Symbol.prototype, "constructor", $Symbol, DONT_ENUM);
+ %AddNamedProperty($Symbol.prototype, "constructor", $Symbol, DONT_ENUM);
InstallFunctions($Symbol.prototype, DONT_ENUM, $Array(
"toString", SymbolToString,
"valueOf", SymbolValueOf
=======================================
--- /branches/bleeding_edge/src/typedarray.js Fri Jun 27 13:48:37 2014 UTC
+++ /branches/bleeding_edge/src/typedarray.js Mon Jul 14 14:05:30 2014 UTC
@@ -299,13 +299,13 @@
%SetCode(global.NAME, NAMEConstructor);
%FunctionSetPrototype(global.NAME, new $Object());
- %AddProperty(global.NAME, "BYTES_PER_ELEMENT", ELEMENT_SIZE,
- READ_ONLY | DONT_ENUM | DONT_DELETE);
- %AddProperty(global.NAME.prototype,
- "constructor", global.NAME, DONT_ENUM);
- %AddProperty(global.NAME.prototype,
- "BYTES_PER_ELEMENT", ELEMENT_SIZE,
- READ_ONLY | DONT_ENUM | DONT_DELETE);
+ %AddNamedProperty(global.NAME, "BYTES_PER_ELEMENT", ELEMENT_SIZE,
+ READ_ONLY | DONT_ENUM | DONT_DELETE);
+ %AddNamedProperty(global.NAME.prototype,
+ "constructor", global.NAME, DONT_ENUM);
+ %AddNamedProperty(global.NAME.prototype,
+ "BYTES_PER_ELEMENT", ELEMENT_SIZE,
+ READ_ONLY | DONT_ENUM | DONT_DELETE);
InstallGetter(global.NAME.prototype, "buffer", NAME_GetBuffer);
InstallGetter(global.NAME.prototype, "byteOffset", NAME_GetByteOffset);
InstallGetter(global.NAME.prototype, "byteLength", NAME_GetByteLength);
@@ -436,7 +436,7 @@
%FunctionSetPrototype($DataView, new $Object);
// Set up constructor property on the DataView prototype.
- %AddProperty($DataView.prototype, "constructor", $DataView, DONT_ENUM);
+ %AddNamedProperty($DataView.prototype, "constructor", $DataView,
DONT_ENUM);
InstallGetter($DataView.prototype, "buffer", DataViewGetBufferJS);
InstallGetter($DataView.prototype, "byteOffset", DataViewGetByteOffset);
=======================================
--- /branches/bleeding_edge/src/v8natives.js Mon Jul 14 14:00:33 2014 UTC
+++ /branches/bleeding_edge/src/v8natives.js Mon Jul 14 14:05:30 2014 UTC
@@ -28,7 +28,7 @@
var f = functions[i + 1];
%FunctionSetName(f, key);
%FunctionRemovePrototype(f);
- %AddProperty(object, key, f, attributes);
+ %AddNamedProperty(object, key, f, attributes);
%SetNativeFlag(f);
}
%ToFastProperties(object);
@@ -65,7 +65,7 @@
for (var i = 0; i < constants.length; i += 2) {
var name = constants[i];
var k = constants[i + 1];
- %AddProperty(object, name, k, attributes);
+ %AddNamedProperty(object, name, k, attributes);
}
%ToFastProperties(object);
}
@@ -86,13 +86,14 @@
}
if (fields) {
for (var i = 0; i < fields.length; i++) {
- %AddProperty(prototype, fields[i], UNDEFINED, DONT_ENUM |
DONT_DELETE);
+ %AddNamedProperty(prototype, fields[i],
+ UNDEFINED, DONT_ENUM | DONT_DELETE);
}
}
for (var i = 0; i < methods.length; i += 2) {
var key = methods[i];
var f = methods[i + 1];
- %AddProperty(prototype, key, f, DONT_ENUM | DONT_DELETE | READ_ONLY);
+ %AddNamedProperty(prototype, key, f, DONT_ENUM | DONT_DELETE |
READ_ONLY);
%SetNativeFlag(f);
}
%SetPrototype(prototype, null);
@@ -190,13 +191,13 @@
var attributes = DONT_ENUM | DONT_DELETE | READ_ONLY;
// ECMA 262 - 15.1.1.1.
- %AddProperty(global, "NaN", NAN, attributes);
+ %AddNamedProperty(global, "NaN", NAN, attributes);
// ECMA-262 - 15.1.1.2.
- %AddProperty(global, "Infinity", INFINITY, attributes);
+ %AddNamedProperty(global, "Infinity", INFINITY, attributes);
// ECMA-262 - 15.1.1.3.
- %AddProperty(global, "undefined", UNDEFINED, attributes);
+ %AddNamedProperty(global, "undefined", UNDEFINED, attributes);
// Set up non-enumerable function on the global object.
InstallFunctions(global, DONT_ENUM, $Array(
@@ -386,22 +387,22 @@
var obj = new $Object();
if (desc.hasValue()) {
- %AddProperty(obj, "value", desc.getValue(), NONE);
+ %AddNamedProperty(obj, "value", desc.getValue(), NONE);
}
if (desc.hasWritable()) {
- %AddProperty(obj, "writable", desc.isWritable(), NONE);
+ %AddNamedProperty(obj, "writable", desc.isWritable(), NONE);
}
if (desc.hasGetter()) {
- %AddProperty(obj, "get", desc.getGet(), NONE);
+ %AddNamedProperty(obj, "get", desc.getGet(), NONE);
}
if (desc.hasSetter()) {
- %AddProperty(obj, "set", desc.getSet(), NONE);
+ %AddNamedProperty(obj, "set", desc.getSet(), NONE);
}
if (desc.hasEnumerable()) {
- %AddProperty(obj, "enumerable", desc.isEnumerable(), NONE);
+ %AddNamedProperty(obj, "enumerable", desc.isEnumerable(), NONE);
}
if (desc.hasConfigurable()) {
- %AddProperty(obj, "configurable", desc.isConfigurable(), NONE);
+ %AddNamedProperty(obj, "configurable", desc.isConfigurable(), NONE);
}
return obj;
}
@@ -1407,7 +1408,7 @@
%SetNativeFlag($Object);
%SetCode($Object, ObjectConstructor);
- %AddProperty($Object.prototype, "constructor", $Object, DONT_ENUM);
+ %AddNamedProperty($Object.prototype, "constructor", $Object, DONT_ENUM);
// Set up non-enumerable functions on the Object.prototype object.
InstallFunctions($Object.prototype, DONT_ENUM, $Array(
@@ -1494,7 +1495,7 @@
%SetCode($Boolean, BooleanConstructor);
%FunctionSetPrototype($Boolean, new $Boolean(false));
- %AddProperty($Boolean.prototype, "constructor", $Boolean, DONT_ENUM);
+ %AddNamedProperty($Boolean.prototype, "constructor", $Boolean,
DONT_ENUM);
InstallFunctions($Boolean.prototype, DONT_ENUM, $Array(
"toString", BooleanToString,
@@ -1677,7 +1678,7 @@
%OptimizeObjectForAddingMultipleProperties($Number.prototype, 8);
// Set up the constructor property on the Number prototype object.
- %AddProperty($Number.prototype, "constructor", $Number, DONT_ENUM);
+ %AddNamedProperty($Number.prototype, "constructor", $Number, DONT_ENUM);
InstallConstants($Number, $Array(
// ECMA-262 section 15.7.3.1.
@@ -1860,7 +1861,7 @@
%CheckIsBootstrapping();
%SetCode($Function, FunctionConstructor);
- %AddProperty($Function.prototype, "constructor", $Function, DONT_ENUM);
+ %AddNamedProperty($Function.prototype, "constructor", $Function,
DONT_ENUM);
InstallFunctions($Function.prototype, DONT_ENUM, $Array(
"bind", FunctionBind,
=======================================
--- /branches/bleeding_edge/src/weak_collection.js Fri Jun 27 13:48:37 2014
UTC
+++ /branches/bleeding_edge/src/weak_collection.js Mon Jul 14 14:05:30 2014
UTC
@@ -89,7 +89,7 @@
%SetCode($WeakMap, WeakMapConstructor);
%FunctionSetPrototype($WeakMap, new $Object());
- %AddProperty($WeakMap.prototype, "constructor", $WeakMap, DONT_ENUM);
+ %AddNamedProperty($WeakMap.prototype, "constructor", $WeakMap,
DONT_ENUM);
// Set up the non-enumerable functions on the WeakMap prototype object.
InstallFunctions($WeakMap.prototype, DONT_ENUM, $Array(
@@ -169,7 +169,7 @@
%SetCode($WeakSet, WeakSetConstructor);
%FunctionSetPrototype($WeakSet, new $Object());
- %AddProperty($WeakSet.prototype, "constructor", $WeakSet, DONT_ENUM);
+ %AddNamedProperty($WeakSet.prototype, "constructor", $WeakSet,
DONT_ENUM);
// Set up the non-enumerable functions on the WeakSet prototype object.
InstallFunctions($WeakSet.prototype, DONT_ENUM, $Array(
=======================================
--- /branches/bleeding_edge/test/cctest/test-api.cc Thu Jul 10 10:28:05
2014 UTC
+++ /branches/bleeding_edge/test/cctest/test-api.cc Mon Jul 14 14:05:30
2014 UTC
@@ -21634,7 +21634,7 @@
CheckCorrectThrow("has_own_property(other, 'x')");
CheckCorrectThrow("%GetProperty(other, 'x')");
CheckCorrectThrow("%SetProperty(other, 'x', 'foo', 0)");
- CheckCorrectThrow("%AddProperty(other, 'x', 'foo', 1)");
+ CheckCorrectThrow("%AddNamedProperty(other, 'x', 'foo', 1)");
CheckCorrectThrow("%DeleteProperty(other, 'x', 0)");
CheckCorrectThrow("%DeleteProperty(other, '1', 0)");
CheckCorrectThrow("%HasOwnProperty(other, 'x')");
=======================================
--- /branches/bleeding_edge/test/mjsunit/regress/regress-1199637.js Fri Jun
27 13:48:37 2014 UTC
+++ /branches/bleeding_edge/test/mjsunit/regress/regress-1199637.js Mon Jul
14 14:05:30 2014 UTC
@@ -34,43 +34,43 @@
const READ_ONLY = 1;
// Use DeclareGlobal...
-%AddProperty(this.__proto__, "a", 1234, NONE);
+%AddNamedProperty(this.__proto__, "a", 1234, NONE);
assertEquals(1234, a);
eval("var a = 5678;");
assertEquals(5678, a);
-%AddProperty(this.__proto__, "b", 1234, NONE);
+%AddNamedProperty(this.__proto__, "b", 1234, NONE);
assertEquals(1234, b);
eval("const b = 5678;");
assertEquals(5678, b);
-%AddProperty(this.__proto__, "c", 1234, READ_ONLY);
+%AddNamedProperty(this.__proto__, "c", 1234, READ_ONLY);
assertEquals(1234, c);
eval("var c = 5678;");
assertEquals(5678, c);
-%AddProperty(this.__proto__, "d", 1234, READ_ONLY);
+%AddNamedProperty(this.__proto__, "d", 1234, READ_ONLY);
assertEquals(1234, d);
eval("const d = 5678;");
assertEquals(5678, d);
// Use DeclareContextSlot...
-%AddProperty(this.__proto__, "x", 1234, NONE);
+%AddNamedProperty(this.__proto__, "x", 1234, NONE);
assertEquals(1234, x);
eval("with({}) { var x = 5678; }");
assertEquals(5678, x);
-%AddProperty(this.__proto__, "y", 1234, NONE);
+%AddNamedProperty(this.__proto__, "y", 1234, NONE);
assertEquals(1234, y);
eval("with({}) { const y = 5678; }");
assertEquals(5678, y);
-%AddProperty(this.__proto__, "z", 1234, READ_ONLY);
+%AddNamedProperty(this.__proto__, "z", 1234, READ_ONLY);
assertEquals(1234, z);
eval("with({}) { var z = 5678; }");
assertEquals(5678, z);
-%AddProperty(this.__proto__, "w", 1234, READ_ONLY);
+%AddNamedProperty(this.__proto__, "w", 1234, READ_ONLY);
assertEquals(1234, w);
eval("with({}) { const w = 5678; }");
assertEquals(5678, w);
=======================================
--- /branches/bleeding_edge/test/mjsunit/regress/regress-334.js Fri Jun 27
13:48:37 2014 UTC
+++ /branches/bleeding_edge/test/mjsunit/regress/regress-334.js Mon Jul 14
14:05:30 2014 UTC
@@ -37,10 +37,10 @@
function func2(){}
var object = {__proto__:{}};
-%AddProperty(object, "foo", func1, DONT_ENUM | DONT_DELETE);
-%AddProperty(object, "bar", func1, DONT_ENUM | READ_ONLY);
-%AddProperty(object, "baz", func1, DONT_DELETE | READ_ONLY);
-%AddProperty(object.__proto__, "bif", func1, DONT_ENUM | DONT_DELETE);
+%AddNamedProperty(object, "foo", func1, DONT_ENUM | DONT_DELETE);
+%AddNamedProperty(object, "bar", func1, DONT_ENUM | READ_ONLY);
+%AddNamedProperty(object, "baz", func1, DONT_DELETE | READ_ONLY);
+%AddNamedProperty(object.__proto__, "bif", func1, DONT_ENUM | DONT_DELETE);
object.bif = func2;
function enumerable(obj) {
=======================================
---
/branches/bleeding_edge/test/mjsunit/regress/regress-cntl-descriptors-enum.js
Fri Jun 27 13:48:37 2014 UTC
+++
/branches/bleeding_edge/test/mjsunit/regress/regress-cntl-descriptors-enum.js
Mon Jul 14 14:05:30 2014 UTC
@@ -30,10 +30,10 @@
DontEnum = 2;
var o = {};
-%AddProperty(o, "a", 0, DontEnum);
+%AddNamedProperty(o, "a", 0, DontEnum);
var o2 = {};
-%AddProperty(o2, "a", 0, DontEnum);
+%AddNamedProperty(o2, "a", 0, DontEnum);
assertTrue(%HaveSameMap(o, o2));
=======================================
--- /branches/bleeding_edge/tools/generate-runtime-tests.py Mon Jul 14
14:01:04 2014 UTC
+++ /branches/bleeding_edge/tools/generate-runtime-tests.py Mon Jul 14
14:05:30 2014 UTC
@@ -211,7 +211,7 @@
# Format: "FunctionName": ["arg0", "arg1", ..., argslength].
# None means "fall back to autodetected value".
CUSTOM_KNOWN_GOOD_INPUT = {
- "AddProperty": [None, 10, None, None, None],
+ "AddNamedProperty": [None, "\"bla\"", None, None, None],
"AddPropertyForTemplate": [None, 10, None, None, None],
"Apply": ["function() {}", None, None, None, None, None],
"ArrayBufferSliceImpl": [None, None, 0, None],
--
--
v8-dev mailing list
v8-dev@googlegroups.com
http://groups.google.com/group/v8-dev
---
You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to v8-dev+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.