Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(6)

Unified Diff: src/ic/handler-compiler.cc

Issue 609463003: Hydrogenize (and share) part of StoreTransition handler as a StoreTransitionStub. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Rebasing Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/ic/handler-compiler.h ('k') | src/ic/ia32/handler-compiler-ia32.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/ic/handler-compiler.cc
diff --git a/src/ic/handler-compiler.cc b/src/ic/handler-compiler.cc
index 4ed92ec6bfeeecfbe0f252edf4aff9f383566e8c..6180b5f6f18becb3d525dd781b76c4ee152673a8 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());
« no previous file with comments | « src/ic/handler-compiler.h ('k') | src/ic/ia32/handler-compiler-ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698