Commit d849396e authored by Igor Sheludko's avatar Igor Sheludko Committed by Commit Bot

[ic] StoreOwnICs must unconditionally store even to kConst fields.

BUG=v8:5495

Change-Id: I731ddaa34169f6f57d3719e6170bfe00e6d66241
Reviewed-on: https://chromium-review.googlesource.com/451638
Commit-Queue: Igor Sheludko <ishell@chromium.org>
Reviewed-by: 's avatarToon Verwaest <verwaest@chromium.org>
Cr-Commit-Position: refs/heads/master@{#43693}
parent 43095c8c
......@@ -1999,8 +1999,13 @@ Handle<Object> StoreIC::GetMapIndependentHandler(LookupIterator* lookup) {
TRACE_HANDLER_STATS(isolate(), StoreIC_StoreFieldDH);
int descriptor = lookup->GetFieldDescriptorIndex();
FieldIndex index = lookup->GetFieldIndex();
return StoreHandler::StoreField(isolate(), descriptor, index,
lookup->constness(),
PropertyConstness constness = lookup->constness();
if (constness == kConst && IsStoreOwnICKind(nexus()->kind())) {
// StoreOwnICs are used for initializing object literals therefore
// we must store the value unconditionally even to kConst fields.
constness = kMutable;
}
return StoreHandler::StoreField(isolate(), descriptor, index, constness,
lookup->representation());
}
......
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