Index: src/code-stubs-hydrogen.cc |
diff --git a/src/code-stubs-hydrogen.cc b/src/code-stubs-hydrogen.cc |
index 02d88e4c3f49b7152f0ea34a02964718c28da7b5..76f1cbf5d1892808e8ba23f69e13c7cf6b3566f6 100644 |
--- a/src/code-stubs-hydrogen.cc |
+++ b/src/code-stubs-hydrogen.cc |
@@ -248,12 +248,56 @@ Handle<Code> HydrogenCodeStub::GenerateLightweightMissCode( |
return new_object; |
} |
+Handle<Code> HydrogenCodeStub::GenerateRuntimeTailCall( |
+ CodeStubDescriptor* descriptor) { |
+ const char* name = CodeStub::MajorName(MajorKey()); |
+ Zone zone(isolate()->allocator()); |
+ CallInterfaceDescriptor interface_descriptor(GetCallInterfaceDescriptor()); |
+ CodeStubAssembler assembler(isolate(), &zone, interface_descriptor, |
+ GetCodeFlags(), name); |
+ int total_params = interface_descriptor.GetStackParameterCount() + |
+ interface_descriptor.GetRegisterParameterCount(); |
+ switch (total_params) { |
+ case 0: |
+ assembler.TailCallRuntime(descriptor->miss_handler_id(), |
+ assembler.Parameter(0)); |
+ break; |
+ case 1: |
+ assembler.TailCallRuntime(descriptor->miss_handler_id(), |
+ assembler.Parameter(1), assembler.Parameter(0)); |
+ break; |
+ case 2: |
+ assembler.TailCallRuntime(descriptor->miss_handler_id(), |
+ assembler.Parameter(2), assembler.Parameter(0), |
+ assembler.Parameter(1)); |
+ break; |
+ case 3: |
+ assembler.TailCallRuntime(descriptor->miss_handler_id(), |
+ assembler.Parameter(3), assembler.Parameter(0), |
+ assembler.Parameter(1), assembler.Parameter(2)); |
+ break; |
+ case 4: |
+ assembler.TailCallRuntime(descriptor->miss_handler_id(), |
+ assembler.Parameter(4), assembler.Parameter(0), |
+ assembler.Parameter(1), assembler.Parameter(2), |
+ assembler.Parameter(3)); |
+ break; |
+ default: |
+ UNIMPLEMENTED(); |
+ break; |
+ } |
+ return assembler.GenerateCode(); |
+} |
template <class Stub> |
static Handle<Code> DoGenerateCode(Stub* stub) { |
Isolate* isolate = stub->isolate(); |
CodeStubDescriptor descriptor(stub); |
+ if (FLAG_minimal && descriptor.has_miss_handler()) { |
+ return stub->GenerateRuntimeTailCall(&descriptor); |
+ } |
+ |
// If we are uninitialized we can use a light-weight stub to enter |
// the runtime that is significantly faster than using the standard |
// stub-failure deopt mechanism. |