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

Unified Diff: src/code-stubs-hydrogen.cc

Issue 2189663002: Add a flag to help platform ports bootstrap V8 (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Rename flag Created 4 years, 5 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/code-stubs.cc ('k') | src/crankshaft/hydrogen.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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.
« no previous file with comments | « src/code-stubs.cc ('k') | src/crankshaft/hydrogen.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698