Commit 0ff89ea7 authored by neis's avatar neis Committed by Commit bot

Migrate Object.definePropert{ies,y} from v8natives to builtins.

R=bmeurer@chromium.org
BUG=

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

Cr-Commit-Position: refs/heads/master@{#35761}
parent cb855fe7
...@@ -1074,6 +1074,16 @@ void Genesis::InitializeGlobal(Handle<JSGlobalObject> global_object, ...@@ -1074,6 +1074,16 @@ void Genesis::InitializeGlobal(Handle<JSGlobalObject> global_object,
SimpleInstallFunction(object_function, "seal", SimpleInstallFunction(object_function, "seal",
Builtins::kObjectSeal, 1, false); Builtins::kObjectSeal, 1, false);
Handle<JSFunction> object_define_properties = SimpleInstallFunction(
object_function, "defineProperties",
Builtins::kObjectDefineProperties, 2, true);
native_context()->set_object_define_properties(*object_define_properties);
Handle<JSFunction> object_define_property = SimpleInstallFunction(
object_function, factory->defineProperty_string(),
Builtins::kObjectDefineProperty, 3, true);
native_context()->set_object_define_property(*object_define_property);
Handle<JSFunction> object_freeze = SimpleInstallFunction( Handle<JSFunction> object_freeze = SimpleInstallFunction(
object_function, "freeze", Builtins::kObjectFreeze, 1, false); object_function, "freeze", Builtins::kObjectFreeze, 1, false);
native_context()->set_object_freeze(*object_freeze); native_context()->set_object_freeze(*object_freeze);
......
...@@ -1782,6 +1782,30 @@ BUILTIN(ObjectCreate) { ...@@ -1782,6 +1782,30 @@ BUILTIN(ObjectCreate) {
return *object; return *object;
} }
// ES6 section 19.1.2.3 Object.defineProperties
BUILTIN(ObjectDefineProperties) {
HandleScope scope(isolate);
DCHECK_EQ(3, args.length());
Handle<Object> target = args.at<Object>(1);
Handle<Object> properties = args.at<Object>(2);
Handle<Object> result;
ASSIGN_RETURN_FAILURE_ON_EXCEPTION(
isolate, result,
JSReceiver::DefineProperties(isolate, target, properties));
return *result;
}
// ES6 section 19.1.2.4 Object.defineProperty
BUILTIN(ObjectDefineProperty) {
HandleScope scope(isolate);
DCHECK_EQ(4, args.length());
Handle<Object> target = args.at<Object>(1);
Handle<Object> key = args.at<Object>(2);
Handle<Object> attributes = args.at<Object>(3);
return JSReceiver::DefineProperty(isolate, target, key, attributes);
}
// ES6 section 19.1.2.5 Object.freeze ( O ) // ES6 section 19.1.2.5 Object.freeze ( O )
BUILTIN(ObjectFreeze) { BUILTIN(ObjectFreeze) {
......
...@@ -126,6 +126,8 @@ inline bool operator&(BuiltinExtraArguments lhs, BuiltinExtraArguments rhs) { ...@@ -126,6 +126,8 @@ inline bool operator&(BuiltinExtraArguments lhs, BuiltinExtraArguments rhs) {
\ \
V(ObjectAssign, kNone) \ V(ObjectAssign, kNone) \
V(ObjectCreate, kNone) \ V(ObjectCreate, kNone) \
V(ObjectDefineProperties, kNone) \
V(ObjectDefineProperty, kNone) \
V(ObjectFreeze, kNone) \ V(ObjectFreeze, kNone) \
V(ObjectGetOwnPropertyDescriptor, kNone) \ V(ObjectGetOwnPropertyDescriptor, kNone) \
V(ObjectGetOwnPropertyNames, kNone) \ V(ObjectGetOwnPropertyNames, kNone) \
......
...@@ -67,25 +67,27 @@ enum BindingFlags { ...@@ -67,25 +67,27 @@ enum BindingFlags {
// must always be allocated via Heap::AllocateContext() or // must always be allocated via Heap::AllocateContext() or
// Factory::NewContext. // Factory::NewContext.
#define NATIVE_CONTEXT_INTRINSIC_FUNCTIONS(V) \ #define NATIVE_CONTEXT_INTRINSIC_FUNCTIONS(V) \
V(IS_ARRAYLIKE, JSFunction, is_arraylike) \ V(IS_ARRAYLIKE, JSFunction, is_arraylike) \
V(GET_TEMPLATE_CALL_SITE_INDEX, JSFunction, get_template_call_site) \ V(GET_TEMPLATE_CALL_SITE_INDEX, JSFunction, get_template_call_site) \
V(MAKE_RANGE_ERROR_INDEX, JSFunction, make_range_error) \ V(MAKE_RANGE_ERROR_INDEX, JSFunction, make_range_error) \
V(MAKE_TYPE_ERROR_INDEX, JSFunction, make_type_error) \ V(MAKE_TYPE_ERROR_INDEX, JSFunction, make_type_error) \
V(OBJECT_FREEZE, JSFunction, object_freeze) \ V(OBJECT_DEFINE_PROPERTIES, JSFunction, object_define_properties) \
V(OBJECT_GET_PROTOTYPE_OF, JSFunction, object_get_prototype_of) \ V(OBJECT_DEFINE_PROPERTY, JSFunction, object_define_property) \
V(OBJECT_IS_EXTENSIBLE, JSFunction, object_is_extensible) \ V(OBJECT_FREEZE, JSFunction, object_freeze) \
V(OBJECT_IS_FROZEN, JSFunction, object_is_frozen) \ V(OBJECT_GET_PROTOTYPE_OF, JSFunction, object_get_prototype_of) \
V(OBJECT_IS_SEALED, JSFunction, object_is_sealed) \ V(OBJECT_IS_EXTENSIBLE, JSFunction, object_is_extensible) \
V(OBJECT_KEYS, JSFunction, object_keys) \ V(OBJECT_IS_FROZEN, JSFunction, object_is_frozen) \
V(REFLECT_APPLY_INDEX, JSFunction, reflect_apply) \ V(OBJECT_IS_SEALED, JSFunction, object_is_sealed) \
V(REFLECT_CONSTRUCT_INDEX, JSFunction, reflect_construct) \ V(OBJECT_KEYS, JSFunction, object_keys) \
V(REFLECT_DEFINE_PROPERTY_INDEX, JSFunction, reflect_define_property) \ V(REFLECT_APPLY_INDEX, JSFunction, reflect_apply) \
V(REFLECT_DELETE_PROPERTY_INDEX, JSFunction, reflect_delete_property) \ V(REFLECT_CONSTRUCT_INDEX, JSFunction, reflect_construct) \
V(SPREAD_ARGUMENTS_INDEX, JSFunction, spread_arguments) \ V(REFLECT_DEFINE_PROPERTY_INDEX, JSFunction, reflect_define_property) \
V(SPREAD_ITERABLE_INDEX, JSFunction, spread_iterable) \ V(REFLECT_DELETE_PROPERTY_INDEX, JSFunction, reflect_delete_property) \
V(ORDINARY_HAS_INSTANCE_INDEX, JSFunction, ordinary_has_instance) \ V(SPREAD_ARGUMENTS_INDEX, JSFunction, spread_arguments) \
V(MATH_FLOOR, JSFunction, math_floor) \ V(SPREAD_ITERABLE_INDEX, JSFunction, spread_iterable) \
V(ORDINARY_HAS_INSTANCE_INDEX, JSFunction, ordinary_has_instance) \
V(MATH_FLOOR, JSFunction, math_floor) \
V(MATH_SQRT, JSFunction, math_sqrt) V(MATH_SQRT, JSFunction, math_sqrt)
#define NATIVE_CONTEXT_IMPORTED_FIELDS(V) \ #define NATIVE_CONTEXT_IMPORTED_FIELDS(V) \
......
...@@ -20,7 +20,6 @@ var InternalPackedArray = utils.InternalPackedArray; ...@@ -20,7 +20,6 @@ var InternalPackedArray = utils.InternalPackedArray;
var MakeTypeError; var MakeTypeError;
var MaxSimple; var MaxSimple;
var MinSimple; var MinSimple;
var ObjectDefineProperty;
var ObjectHasOwnProperty; var ObjectHasOwnProperty;
var ObjectToString = utils.ImportNow("object_to_string"); var ObjectToString = utils.ImportNow("object_to_string");
var iteratorSymbol = utils.ImportNow("iterator_symbol"); var iteratorSymbol = utils.ImportNow("iterator_symbol");
...@@ -32,7 +31,6 @@ utils.Import(function(from) { ...@@ -32,7 +31,6 @@ utils.Import(function(from) {
MakeTypeError = from.MakeTypeError; MakeTypeError = from.MakeTypeError;
MaxSimple = from.MaxSimple; MaxSimple = from.MaxSimple;
MinSimple = from.MinSimple; MinSimple = from.MinSimple;
ObjectDefineProperty = from.ObjectDefineProperty;
ObjectHasOwnProperty = from.ObjectHasOwnProperty; ObjectHasOwnProperty = from.ObjectHasOwnProperty;
}); });
......
...@@ -35,8 +35,6 @@ var IsNaN; ...@@ -35,8 +35,6 @@ var IsNaN;
var MakeError; var MakeError;
var MakeRangeError; var MakeRangeError;
var MakeTypeError; var MakeTypeError;
var ObjectDefineProperties = utils.ImportNow("ObjectDefineProperties");
var ObjectDefineProperty = utils.ImportNow("ObjectDefineProperty");
var ObjectHasOwnProperty = utils.ImportNow("ObjectHasOwnProperty"); var ObjectHasOwnProperty = utils.ImportNow("ObjectHasOwnProperty");
var OverrideFunction = utils.OverrideFunction; var OverrideFunction = utils.OverrideFunction;
var patternSymbol = utils.ImportNow("intl_pattern_symbol"); var patternSymbol = utils.ImportNow("intl_pattern_symbol");
...@@ -574,14 +572,14 @@ function freezeArray(array) { ...@@ -574,14 +572,14 @@ function freezeArray(array) {
var l = array.length; var l = array.length;
for (var i = 0; i < l; i++) { for (var i = 0; i < l; i++) {
if (i in array) { if (i in array) {
ObjectDefineProperty(array, i, {value: array[i], %object_define_property(array, i, {value: array[i],
configurable: false, configurable: false,
writable: false, writable: false,
enumerable: true}); enumerable: true});
} }
} }
ObjectDefineProperty(array, 'length', {value: l, writable: false}); %object_define_property(array, 'length', {value: l, writable: false});
return array; return array;
} }
...@@ -643,8 +641,8 @@ function getAvailableLocalesOf(service) { ...@@ -643,8 +641,8 @@ function getAvailableLocalesOf(service) {
* Configurable is false by default. * Configurable is false by default.
*/ */
function defineWEProperty(object, property, value) { function defineWEProperty(object, property, value) {
ObjectDefineProperty(object, property, %object_define_property(object, property,
{value: value, writable: true, enumerable: true}); {value: value, writable: true, enumerable: true});
} }
...@@ -663,10 +661,10 @@ function addWEPropertyIfDefined(object, property, value) { ...@@ -663,10 +661,10 @@ function addWEPropertyIfDefined(object, property, value) {
* Defines a property and sets writable, enumerable and configurable to true. * Defines a property and sets writable, enumerable and configurable to true.
*/ */
function defineWECProperty(object, property, value) { function defineWECProperty(object, property, value) {
ObjectDefineProperty(object, property, {value: value, %object_define_property(object, property, {value: value,
writable: true, writable: true,
enumerable: true, enumerable: true,
configurable: true}); configurable: true});
} }
...@@ -965,8 +963,8 @@ function initializeCollator(collator, locales, options) { ...@@ -965,8 +963,8 @@ function initializeCollator(collator, locales, options) {
// We define all properties C++ code may produce, to prevent security // We define all properties C++ code may produce, to prevent security
// problems. If malicious user decides to redefine Object.prototype.locale // problems. If malicious user decides to redefine Object.prototype.locale
// we can't just use plain x.locale = 'us' or in C++ Set("locale", "us"). // we can't just use plain x.locale = 'us' or in C++ Set("locale", "us").
// ObjectDefineProperties will either succeed defining or throw an error. // %object_define_properties will either succeed defining or throw an error.
var resolved = ObjectDefineProperties({}, { var resolved = %object_define_properties({}, {
caseFirst: {writable: true}, caseFirst: {writable: true},
collation: {value: internalOptions.collation, writable: true}, collation: {value: internalOptions.collation, writable: true},
ignorePunctuation: {writable: true}, ignorePunctuation: {writable: true},
...@@ -985,7 +983,7 @@ function initializeCollator(collator, locales, options) { ...@@ -985,7 +983,7 @@ function initializeCollator(collator, locales, options) {
// Writable, configurable and enumerable are set to false by default. // Writable, configurable and enumerable are set to false by default.
%MarkAsInitializedIntlObjectOfType(collator, 'collator', internalCollator); %MarkAsInitializedIntlObjectOfType(collator, 'collator', internalCollator);
collator[resolvedSymbol] = resolved; collator[resolvedSymbol] = resolved;
ObjectDefineProperty(collator, 'resolved', resolvedAccessor); %object_define_property(collator, 'resolved', resolvedAccessor);
return collator; return collator;
} }
...@@ -1198,7 +1196,7 @@ function initializeNumberFormat(numberFormat, locales, options) { ...@@ -1198,7 +1196,7 @@ function initializeNumberFormat(numberFormat, locales, options) {
getOption, internalOptions); getOption, internalOptions);
var requestedLocale = locale.locale + extension; var requestedLocale = locale.locale + extension;
var resolved = ObjectDefineProperties({}, { var resolved = %object_define_properties({}, {
currency: {writable: true}, currency: {writable: true},
currencyDisplay: {writable: true}, currencyDisplay: {writable: true},
locale: {writable: true}, locale: {writable: true},
...@@ -1222,13 +1220,13 @@ function initializeNumberFormat(numberFormat, locales, options) { ...@@ -1222,13 +1220,13 @@ function initializeNumberFormat(numberFormat, locales, options) {
resolved); resolved);
if (internalOptions.style === 'currency') { if (internalOptions.style === 'currency') {
ObjectDefineProperty(resolved, 'currencyDisplay', {value: currencyDisplay, %object_define_property(resolved, 'currencyDisplay',
writable: true}); {value: currencyDisplay, writable: true});
} }
%MarkAsInitializedIntlObjectOfType(numberFormat, 'numberformat', formatter); %MarkAsInitializedIntlObjectOfType(numberFormat, 'numberformat', formatter);
numberFormat[resolvedSymbol] = resolved; numberFormat[resolvedSymbol] = resolved;
ObjectDefineProperty(numberFormat, 'resolved', resolvedAccessor); %object_define_property(numberFormat, 'resolved', resolvedAccessor);
return numberFormat; return numberFormat;
} }
...@@ -1508,35 +1506,35 @@ function toDateTimeOptions(options, required, defaults) { ...@@ -1508,35 +1506,35 @@ function toDateTimeOptions(options, required, defaults) {
} }
if (needsDefault && (defaults === 'date' || defaults === 'all')) { if (needsDefault && (defaults === 'date' || defaults === 'all')) {
ObjectDefineProperty(options, 'year', {value: 'numeric', %object_define_property(options, 'year', {value: 'numeric',
writable: true, writable: true,
enumerable: true, enumerable: true,
configurable: true}); configurable: true});
ObjectDefineProperty(options, 'month', {value: 'numeric', %object_define_property(options, 'month', {value: 'numeric',
writable: true, writable: true,
enumerable: true, enumerable: true,
configurable: true}); configurable: true});
ObjectDefineProperty(options, 'day', {value: 'numeric', %object_define_property(options, 'day', {value: 'numeric',
writable: true,
enumerable: true,
configurable: true});
}
if (needsDefault && (defaults === 'time' || defaults === 'all')) {
ObjectDefineProperty(options, 'hour', {value: 'numeric',
writable: true,
enumerable: true,
configurable: true});
ObjectDefineProperty(options, 'minute', {value: 'numeric',
writable: true,
enumerable: true,
configurable: true});
ObjectDefineProperty(options, 'second', {value: 'numeric',
writable: true, writable: true,
enumerable: true, enumerable: true,
configurable: true}); configurable: true});
} }
if (needsDefault && (defaults === 'time' || defaults === 'all')) {
%object_define_property(options, 'hour', {value: 'numeric',
writable: true,
enumerable: true,
configurable: true});
%object_define_property(options, 'minute', {value: 'numeric',
writable: true,
enumerable: true,
configurable: true});
%object_define_property(options, 'second', {value: 'numeric',
writable: true,
enumerable: true,
configurable: true});
}
return options; return options;
} }
...@@ -1592,7 +1590,7 @@ function initializeDateTimeFormat(dateFormat, locales, options) { ...@@ -1592,7 +1590,7 @@ function initializeDateTimeFormat(dateFormat, locales, options) {
getOption, internalOptions); getOption, internalOptions);
var requestedLocale = locale.locale + extension; var requestedLocale = locale.locale + extension;
var resolved = ObjectDefineProperties({}, { var resolved = %object_define_properties({}, {
calendar: {writable: true}, calendar: {writable: true},
day: {writable: true}, day: {writable: true},
era: {writable: true}, era: {writable: true},
...@@ -1622,7 +1620,7 @@ function initializeDateTimeFormat(dateFormat, locales, options) { ...@@ -1622,7 +1620,7 @@ function initializeDateTimeFormat(dateFormat, locales, options) {
%MarkAsInitializedIntlObjectOfType(dateFormat, 'dateformat', formatter); %MarkAsInitializedIntlObjectOfType(dateFormat, 'dateformat', formatter);
dateFormat[resolvedSymbol] = resolved; dateFormat[resolvedSymbol] = resolved;
ObjectDefineProperty(dateFormat, 'resolved', resolvedAccessor); %object_define_property(dateFormat, 'resolved', resolvedAccessor);
return dateFormat; return dateFormat;
} }
...@@ -1826,7 +1824,7 @@ function initializeBreakIterator(iterator, locales, options) { ...@@ -1826,7 +1824,7 @@ function initializeBreakIterator(iterator, locales, options) {
'type', 'string', ['character', 'word', 'sentence', 'line'], 'word')); 'type', 'string', ['character', 'word', 'sentence', 'line'], 'word'));
var locale = resolveLocale('breakiterator', locales, options); var locale = resolveLocale('breakiterator', locales, options);
var resolved = ObjectDefineProperties({}, { var resolved = %object_define_properties({}, {
requestedLocale: {value: locale.locale, writable: true}, requestedLocale: {value: locale.locale, writable: true},
type: {value: internalOptions.type, writable: true}, type: {value: internalOptions.type, writable: true},
locale: {writable: true} locale: {writable: true}
...@@ -1839,7 +1837,7 @@ function initializeBreakIterator(iterator, locales, options) { ...@@ -1839,7 +1837,7 @@ function initializeBreakIterator(iterator, locales, options) {
%MarkAsInitializedIntlObjectOfType(iterator, 'breakiterator', %MarkAsInitializedIntlObjectOfType(iterator, 'breakiterator',
internalIterator); internalIterator);
iterator[resolvedSymbol] = resolved; iterator[resolvedSymbol] = resolved;
ObjectDefineProperty(iterator, 'resolved', resolvedAccessor); %object_define_property(iterator, 'resolved', resolvedAccessor);
return iterator; return iterator;
} }
......
...@@ -32,7 +32,6 @@ var Int32x4ToString; ...@@ -32,7 +32,6 @@ var Int32x4ToString;
var Int8x16ToString; var Int8x16ToString;
var InternalArray = utils.InternalArray; var InternalArray = utils.InternalArray;
var internalErrorSymbol = utils.ImportNow("internal_error_symbol"); var internalErrorSymbol = utils.ImportNow("internal_error_symbol");
var ObjectDefineProperty;
var ObjectHasOwnProperty; var ObjectHasOwnProperty;
var ObjectToString = utils.ImportNow("object_to_string"); var ObjectToString = utils.ImportNow("object_to_string");
var Script = utils.ImportNow("Script"); var Script = utils.ImportNow("Script");
...@@ -54,7 +53,6 @@ utils.Import(function(from) { ...@@ -54,7 +53,6 @@ utils.Import(function(from) {
Int16x8ToString = from.Int16x8ToString; Int16x8ToString = from.Int16x8ToString;
Int32x4ToString = from.Int32x4ToString; Int32x4ToString = from.Int32x4ToString;
Int8x16ToString = from.Int8x16ToString; Int8x16ToString = from.Int8x16ToString;
ObjectDefineProperty = from.ObjectDefineProperty;
ObjectHasOwnProperty = from.ObjectHasOwnProperty; ObjectHasOwnProperty = from.ObjectHasOwnProperty;
StringIndexOf = from.StringIndexOf; StringIndexOf = from.StringIndexOf;
StringSubstring = from.StringSubstring; StringSubstring = from.StringSubstring;
...@@ -994,9 +992,9 @@ utils.InstallGetterSetter(StackOverflowBoilerplate, 'stack', ...@@ -994,9 +992,9 @@ utils.InstallGetterSetter(StackOverflowBoilerplate, 'stack',
// Define actual captureStackTrace function after everything has been set up. // Define actual captureStackTrace function after everything has been set up.
captureStackTrace = function captureStackTrace(obj, cons_opt) { captureStackTrace = function captureStackTrace(obj, cons_opt) {
// Define accessors first, as this may fail and throw. // Define accessors first, as this may fail and throw.
ObjectDefineProperty(obj, 'stack', { get: StackTraceGetter, %object_define_property(obj, 'stack', { get: StackTraceGetter,
set: StackTraceSetter, set: StackTraceSetter,
configurable: true }); configurable: true });
%CollectStackTrace(obj, cons_opt ? cons_opt : captureStackTrace); %CollectStackTrace(obj, cons_opt ? cons_opt : captureStackTrace);
}; };
......
...@@ -128,10 +128,10 @@ function InstallGetterSetter(object, name, getter, setter, attributes) { ...@@ -128,10 +128,10 @@ function InstallGetterSetter(object, name, getter, setter, attributes) {
function OverrideFunction(object, name, f, afterInitialBootstrap) { function OverrideFunction(object, name, f, afterInitialBootstrap) {
%CheckIsBootstrapping(); %CheckIsBootstrapping();
%ObjectDefineProperty(object, name, { value: f, %object_define_property(object, name, { value: f,
writeable: true, writeable: true,
configurable: true, configurable: true,
enumerable: false }); enumerable: false });
SetFunctionName(f, name); SetFunctionName(f, name);
if (!afterInitialBootstrap) %FunctionRemovePrototype(f); if (!afterInitialBootstrap) %FunctionRemovePrototype(f);
%SetNativeFlag(f); %SetNativeFlag(f);
...@@ -195,7 +195,6 @@ function PostNatives(utils) { ...@@ -195,7 +195,6 @@ function PostNatives(utils) {
"MaxSimple", "MaxSimple",
"MinSimple", "MinSimple",
"NumberIsInteger", "NumberIsInteger",
"ObjectDefineProperty",
"ObserveArrayMethods", "ObserveArrayMethods",
"ObserveObjectMethods", "ObserveObjectMethods",
"PromiseChain", "PromiseChain",
......
...@@ -737,22 +737,6 @@ function ObjectSetPrototypeOf(obj, proto) { ...@@ -737,22 +737,6 @@ function ObjectSetPrototypeOf(obj, proto) {
} }
// ES5 section 15.2.3.6.
function ObjectDefineProperty(obj, p, attributes) {
// The new pure-C++ implementation doesn't support O.o.
// TODO(jkummerow): Implement missing features and remove fallback path.
return %ObjectDefineProperty(obj, p, attributes);
}
// ES5 section 15.2.3.7.
function ObjectDefineProperties(obj, properties) {
// The new pure-C++ implementation doesn't support O.o.
// TODO(jkummerow): Implement missing features and remove fallback path.
return %ObjectDefineProperties(obj, properties);
}
// ES6 B.2.2.1.1 // ES6 B.2.2.1.1
function ObjectGetProto() { function ObjectGetProto() {
return %object_get_prototype_of(this); return %object_get_prototype_of(this);
...@@ -805,8 +789,6 @@ utils.InstallGetterSetter(GlobalObject.prototype, "__proto__", ObjectGetProto, ...@@ -805,8 +789,6 @@ utils.InstallGetterSetter(GlobalObject.prototype, "__proto__", ObjectGetProto,
// Set up non-enumerable functions in the Object object. // Set up non-enumerable functions in the Object object.
utils.InstallFunctions(GlobalObject, DONT_ENUM, [ utils.InstallFunctions(GlobalObject, DONT_ENUM, [
"defineProperty", ObjectDefineProperty,
"defineProperties", ObjectDefineProperties,
"setPrototypeOf", ObjectSetPrototypeOf, "setPrototypeOf", ObjectSetPrototypeOf,
// getOwnPropertySymbols is added in symbol.js. // getOwnPropertySymbols is added in symbol.js.
// Others are added in bootstrapper.cc. // Others are added in bootstrapper.cc.
...@@ -1044,8 +1026,6 @@ utils.Export(function(to) { ...@@ -1044,8 +1026,6 @@ utils.Export(function(to) {
to.IsNaN = GlobalIsNaN; to.IsNaN = GlobalIsNaN;
to.NumberIsNaN = NumberIsNaN; to.NumberIsNaN = NumberIsNaN;
to.NumberIsInteger = NumberIsInteger; to.NumberIsInteger = NumberIsInteger;
to.ObjectDefineProperties = ObjectDefineProperties;
to.ObjectDefineProperty = ObjectDefineProperty;
to.ObjectHasOwnProperty = GlobalObject.prototype.hasOwnProperty; to.ObjectHasOwnProperty = GlobalObject.prototype.hasOwnProperty;
}); });
......
...@@ -1239,15 +1239,6 @@ RUNTIME_FUNCTION(Runtime_IsAccessCheckNeeded) { ...@@ -1239,15 +1239,6 @@ RUNTIME_FUNCTION(Runtime_IsAccessCheckNeeded) {
} }
RUNTIME_FUNCTION(Runtime_ObjectDefineProperty) {
HandleScope scope(isolate);
DCHECK(args.length() == 3);
CONVERT_ARG_HANDLE_CHECKED(Object, o, 0);
CONVERT_ARG_HANDLE_CHECKED(Object, name, 1);
CONVERT_ARG_HANDLE_CHECKED(Object, attributes, 2);
return JSReceiver::DefineProperty(isolate, o, name, attributes);
}
RUNTIME_FUNCTION(Runtime_CreateDataProperty) { RUNTIME_FUNCTION(Runtime_CreateDataProperty) {
HandleScope scope(isolate); HandleScope scope(isolate);
DCHECK(args.length() == 3); DCHECK(args.length() == 3);
...@@ -1264,15 +1255,5 @@ RUNTIME_FUNCTION(Runtime_CreateDataProperty) { ...@@ -1264,15 +1255,5 @@ RUNTIME_FUNCTION(Runtime_CreateDataProperty) {
return *value; return *value;
} }
RUNTIME_FUNCTION(Runtime_ObjectDefineProperties) {
HandleScope scope(isolate);
DCHECK(args.length() == 2);
CONVERT_ARG_HANDLE_CHECKED(Object, o, 0);
CONVERT_ARG_HANDLE_CHECKED(Object, properties, 1);
ASSIGN_RETURN_FAILURE_ON_EXCEPTION(
isolate, o, JSReceiver::DefineProperties(isolate, o, properties));
return *o;
}
} // namespace internal } // namespace internal
} // namespace v8 } // namespace v8
...@@ -439,8 +439,6 @@ namespace internal { ...@@ -439,8 +439,6 @@ namespace internal {
F(HasInPrototypeChain, 2, 1) \ F(HasInPrototypeChain, 2, 1) \
F(CreateIterResultObject, 2, 1) \ F(CreateIterResultObject, 2, 1) \
F(IsAccessCheckNeeded, 1, 1) \ F(IsAccessCheckNeeded, 1, 1) \
F(ObjectDefineProperties, 2, 1) \
F(ObjectDefineProperty, 3, 1) \
F(CreateDataProperty, 3, 1) F(CreateDataProperty, 3, 1)
#define FOR_EACH_INTRINSIC_OPERATORS(F) \ #define FOR_EACH_INTRINSIC_OPERATORS(F) \
......
...@@ -83,7 +83,7 @@ bytecodes: [ ...@@ -83,7 +83,7 @@ bytecodes: [
B(Star), R(0), B(Star), R(0),
B(CreateArrayLiteral), U8(0), U8(0), U8(3), B(CreateArrayLiteral), U8(0), U8(0), U8(3),
B(Star), R(1), B(Star), R(1),
B(CallJSRuntime), U8(116), R(0), U8(2), B(CallJSRuntime), U8(118), R(0), U8(2),
B(Return), B(Return),
] ]
constant pool: [ constant pool: [
......
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