Commit 4909edeb authored by Toon Verwaest's avatar Toon Verwaest Committed by Commit Bot

[ic] grow dictionary through special AddDictionaryProperty runtime helper

BUG=

Change-Id: I3d85ad84f5069f7fe349dcd82092696d0360cc94
Reviewed-on: https://chromium-review.googlesource.com/448225Reviewed-by: 's avatarJakob Kummerow <jkummerow@chromium.org>
Commit-Queue: Toon Verwaest <verwaest@chromium.org>
Cr-Commit-Position: refs/heads/master@{#43559}
parent fb165831
......@@ -731,8 +731,8 @@ void AccessorAssembler::HandleStoreICProtoHandler(const StoreICParameters* p,
Return(p->value);
Bind(&slow);
TailCallRuntime(Runtime::kKeyedStoreIC_Slow, p->context, p->value,
p->slot, p->vector, p->receiver, p->name);
TailCallRuntime(Runtime::kAddDictionaryProperty, p->context,
p->receiver, p->name, p->value);
}
}
}
......
......@@ -209,6 +209,23 @@ RUNTIME_FUNCTION(Runtime_ObjectHasOwnProperty) {
return isolate->heap()->false_value();
}
RUNTIME_FUNCTION(Runtime_AddDictionaryProperty) {
HandleScope scope(isolate);
Handle<JSObject> receiver = args.at<JSObject>(0);
Handle<Name> name = args.at<Name>(1);
Handle<Object> value = args.at(2);
DCHECK(name->IsUniqueName());
Handle<NameDictionary> dictionary(receiver->property_dictionary(), isolate);
int entry;
PropertyDetails property_details(kData, NONE, 0, PropertyCellType::kNoCell);
dictionary =
NameDictionary::Add(dictionary, name, value, property_details, &entry);
receiver->set_properties(*dictionary);
return *value;
}
// ES6 section 19.1.2.2 Object.create ( O [ , Properties ] )
// TODO(verwaest): Support the common cases with precached map directly in
// an Object.create stub.
......
......@@ -375,6 +375,7 @@ namespace internal {
F(GetHoleNaNLower, 0, 1)
#define FOR_EACH_INTRINSIC_OBJECT(F) \
F(AddDictionaryProperty, 3, 1) \
F(GetPrototype, 1, 1) \
F(ObjectHasOwnProperty, 2, 1) \
F(ObjectCreate, 2, 1) \
......
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