| Index: src/ic/handler-compiler.cc
|
| diff --git a/src/ic/handler-compiler.cc b/src/ic/handler-compiler.cc
|
| index ecd3e3b544cd4850f3a697d61db29c4deb3d4384..24f4f02c3b6707092a261b48c3e5feb82c0b85a2 100644
|
| --- a/src/ic/handler-compiler.cc
|
| +++ b/src/ic/handler-compiler.cc
|
| @@ -309,7 +309,7 @@ Handle<Code> NamedLoadHandlerCompiler::CompileLoadViaGetter(
|
| // TODO(verwaest): Cleanup. holder() is actually the receiver.
|
| Handle<Code> NamedStoreHandlerCompiler::CompileStoreTransition(
|
| Handle<Map> transition, Handle<Name> name) {
|
| - Label miss, slow;
|
| + Label miss;
|
|
|
| // Ensure no transitions to deprecated maps are followed.
|
| __ CheckMapDeprecated(transition, scratch1(), &miss);
|
| @@ -331,21 +331,55 @@ Handle<Code> NamedStoreHandlerCompiler::CompileStoreTransition(
|
| DCHECK(holder()->HasFastProperties());
|
| }
|
|
|
| - GenerateStoreTransition(transition, name, receiver(), this->name(), value(),
|
| - scratch1(), scratch2(), scratch3(), &miss, &slow);
|
| + int descriptor = transition->LastAdded();
|
| + DescriptorArray* descriptors = transition->instance_descriptors();
|
| + PropertyDetails details = descriptors->GetDetails(descriptor);
|
| + Representation representation = details.representation();
|
| + DCHECK(!representation.IsNone());
|
| +
|
| + // Stub is never generated for objects that require access checks.
|
| + DCHECK(!transition->is_access_check_needed());
|
| +
|
| + // Call to respective StoreTransitionStub.
|
| + if (details.type() == CONSTANT) {
|
| + GenerateConstantCheck(descriptors->GetValue(descriptor), value(), &miss);
|
| +
|
| + GenerateRestoreNameAndMap(name, transition);
|
| + StoreTransitionStub stub(isolate());
|
| + GenerateTailCall(masm(), stub.GetCode());
|
| +
|
| + } else {
|
| + if (representation.IsHeapObject()) {
|
| + GenerateFieldTypeChecks(descriptors->GetFieldType(descriptor), value(),
|
| + &miss);
|
| + }
|
| + StoreTransitionStub::StoreMode store_mode =
|
| + Map::cast(transition->GetBackPointer())->unused_property_fields() == 0
|
| + ? StoreTransitionStub::ExtendStorageAndStoreMapAndValue
|
| + : StoreTransitionStub::StoreMapAndValue;
|
| +
|
| + GenerateRestoreNameAndMap(name, transition);
|
| + StoreTransitionStub stub(isolate(),
|
| + FieldIndex::ForDescriptor(*transition, descriptor),
|
| + representation, store_mode);
|
| + GenerateTailCall(masm(), stub.GetCode());
|
| + }
|
|
|
| GenerateRestoreName(&miss, name);
|
| TailCallBuiltin(masm(), MissBuiltin(kind()));
|
|
|
| - GenerateRestoreName(&slow, name);
|
| - TailCallBuiltin(masm(), SlowBuiltin(kind()));
|
| return GetCode(kind(), Code::FAST, name);
|
| }
|
|
|
|
|
| Handle<Code> NamedStoreHandlerCompiler::CompileStoreField(LookupIterator* it) {
|
| Label miss;
|
| - GenerateStoreField(it, value(), &miss);
|
| + DCHECK(it->representation().IsHeapObject());
|
| +
|
| + GenerateFieldTypeChecks(*it->GetFieldType(), value(), &miss);
|
| + StoreFieldStub stub(isolate(), it->GetFieldIndex(), it->representation());
|
| + GenerateTailCall(masm(), stub.GetCode());
|
| +
|
| __ bind(&miss);
|
| TailCallBuiltin(masm(), MissBuiltin(kind()));
|
| return GetCode(kind(), Code::FAST, it->name());
|
|
|