Index: src/objects.cc |
diff --git a/src/objects.cc b/src/objects.cc |
index 3d5987c3df73788b90f4939cd5d8faced1f04e6c..ab34acf880adfea123f13f1d60ef673e6aaa2153 100644 |
--- a/src/objects.cc |
+++ b/src/objects.cc |
@@ -1834,6 +1834,7 @@ void JSObject::AddFastProperty(Handle<JSObject> object, |
Handle<Object> value, |
PropertyAttributes attributes, |
StoreFromKeyed store_mode, |
+ ValueType value_type, |
TransitionFlag flag) { |
ASSERT(!object->IsJSGlobalProxy()); |
@@ -1843,7 +1844,7 @@ void JSObject::AddFastProperty(Handle<JSObject> object, |
handle(object->map()), name, value, attributes, flag); |
} else if (!object->TooManyFastProperties(store_mode)) { |
Isolate* isolate = object->GetIsolate(); |
- Representation representation = value->OptimalRepresentation(); |
+ Representation representation = value->OptimalRepresentation(value_type); |
maybe_map = Map::CopyWithField( |
handle(object->map(), isolate), name, |
value->OptimalType(isolate, representation), |
@@ -1900,6 +1901,7 @@ MaybeHandle<Object> JSObject::AddPropertyInternal( |
StrictMode strict_mode, |
JSReceiver::StoreFromKeyed store_mode, |
ExtensibilityCheck extensibility_check, |
+ ValueType value_type, |
StoreMode mode, |
TransitionFlag transition_flag) { |
ASSERT(!object->IsJSGlobalProxy()); |
@@ -1924,7 +1926,7 @@ MaybeHandle<Object> JSObject::AddPropertyInternal( |
if (object->HasFastProperties()) { |
AddFastProperty(object, name, value, attributes, store_mode, |
- transition_flag); |
+ value_type, transition_flag); |
} |
if (!object->HasFastProperties()) { |
@@ -3974,7 +3976,8 @@ MaybeHandle<Object> JSObject::SetPropertyUsingTransition( |
return JSObject::AddPropertyInternal( |
object, name, value, attributes, SLOPPY, |
JSReceiver::CERTAINLY_NOT_STORE_FROM_KEYED, |
- JSReceiver::OMIT_EXTENSIBILITY_CHECK, FORCE_FIELD, OMIT_TRANSITION); |
+ JSReceiver::OMIT_EXTENSIBILITY_CHECK, |
+ JSObject::FORCE_TAGGED, FORCE_FIELD, OMIT_TRANSITION); |
} |
// Keep the target CONSTANT if the same value is stored. |
@@ -4220,6 +4223,7 @@ void JSObject::AddProperty( |
Handle<Name> name, |
Handle<Object> value, |
PropertyAttributes attributes, |
+ ValueType value_type, |
StoreMode store_mode) { |
#ifdef DEBUG |
uint32_t index; |
@@ -4230,8 +4234,9 @@ void JSObject::AddProperty( |
ASSERT(!it.IsFound()); |
ASSERT(object->map()->is_extensible()); |
#endif |
- SetOwnPropertyIgnoreAttributes(object, name, value, attributes, store_mode, |
- OMIT_EXTENSIBILITY_CHECK).Check(); |
+ SetOwnPropertyIgnoreAttributes( |
+ object, name, value, attributes, value_type, store_mode, |
+ OMIT_EXTENSIBILITY_CHECK).Check(); |
} |
@@ -4246,6 +4251,7 @@ MaybeHandle<Object> JSObject::SetOwnPropertyIgnoreAttributes( |
Handle<Name> name, |
Handle<Object> value, |
PropertyAttributes attributes, |
+ ValueType value_type, |
StoreMode mode, |
ExtensibilityCheck extensibility_check, |
StoreFromKeyed store_from_keyed, |
@@ -4274,9 +4280,8 @@ MaybeHandle<Object> JSObject::SetOwnPropertyIgnoreAttributes( |
Handle<Object> proto(object->GetPrototype(), isolate); |
if (proto->IsNull()) return value; |
ASSERT(proto->IsJSGlobalObject()); |
- return SetOwnPropertyIgnoreAttributes(Handle<JSObject>::cast(proto), name, |
- value, attributes, mode, |
- extensibility_check); |
+ return SetOwnPropertyIgnoreAttributes(Handle<JSObject>::cast(proto), |
+ name, value, attributes, value_type, mode, extensibility_check); |
} |
if (lookup.IsInterceptor() || |
@@ -4291,8 +4296,7 @@ MaybeHandle<Object> JSObject::SetOwnPropertyIgnoreAttributes( |
? OMIT_TRANSITION : INSERT_TRANSITION; |
// Neither properties nor transitions found. |
return AddPropertyInternal(object, name, value, attributes, SLOPPY, |
- store_from_keyed, extensibility_check, mode, |
- flag); |
+ store_from_keyed, extensibility_check, value_type, mode, flag); |
} |
Handle<Object> old_value = isolate->factory()->the_hole_value(); |
@@ -5256,8 +5260,12 @@ Handle<Object> JSObject::SetHiddenPropertiesHashTable(Handle<JSObject> object, |
} |
} |
- SetOwnPropertyIgnoreAttributes(object, isolate->factory()->hidden_string(), |
- value, DONT_ENUM, ALLOW_AS_CONSTANT, |
+ SetOwnPropertyIgnoreAttributes(object, |
+ isolate->factory()->hidden_string(), |
+ value, |
+ DONT_ENUM, |
+ OPTIMAL_REPRESENTATION, |
+ ALLOW_AS_CONSTANT, |
OMIT_EXTENSIBILITY_CHECK).Assert(); |
return object; |
} |
@@ -5602,10 +5610,11 @@ bool JSObject::ReferencesObject(Object* obj) { |
// For functions check the context. |
if (IsJSFunction()) { |
// Get the constructor function for arguments array. |
- Map* arguments_map = |
- heap->isolate()->context()->native_context()->sloppy_arguments_map(); |
+ JSObject* arguments_boilerplate = |
+ heap->isolate()->context()->native_context()-> |
+ sloppy_arguments_boilerplate(); |
JSFunction* arguments_function = |
- JSFunction::cast(arguments_map->constructor()); |
+ JSFunction::cast(arguments_boilerplate->map()->constructor()); |
// Get the context and don't check if it is the native context. |
JSFunction* f = JSFunction::cast(this); |
@@ -5897,7 +5906,7 @@ MaybeHandle<JSObject> JSObjectWalkVisitor<ContextObject>::StructureWalk( |
Handle<JSObject> object) { |
Isolate* isolate = this->isolate(); |
bool copying = this->copying(); |
- bool shallow = hints_ == JSObject::kObjectIsShallow; |
+ bool shallow = hints_ == JSObject::kObjectIsShallowArray; |
if (!shallow) { |
StackLimitCheck check(isolate); |
@@ -6384,8 +6393,12 @@ MaybeHandle<FixedArray> JSReceiver::GetKeys(Handle<JSReceiver> object, |
USE(ContainsOnlyValidKeys); |
Isolate* isolate = object->GetIsolate(); |
Handle<FixedArray> content = isolate->factory()->empty_fixed_array(); |
- Handle<JSFunction> arguments_function( |
- JSFunction::cast(isolate->sloppy_arguments_map()->constructor())); |
+ Handle<JSObject> arguments_boilerplate = Handle<JSObject>( |
+ isolate->context()->native_context()->sloppy_arguments_boilerplate(), |
+ isolate); |
+ Handle<JSFunction> arguments_function = Handle<JSFunction>( |
+ JSFunction::cast(arguments_boilerplate->map()->constructor()), |
+ isolate); |
// Only collect keys if access is permitted. |
for (Handle<Object> p = object; |