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

Unified Diff: src/compiler/linkage.cc

Issue 1882073002: [Interpreter] Make dispatch table point to code entry instead of code objects. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fix visiting dispatch table. Created 4 years, 8 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/compiler/linkage.h ('k') | src/compiler/mips/code-generator-mips.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler/linkage.cc
diff --git a/src/compiler/linkage.cc b/src/compiler/linkage.cc
index 89fff6f3d9c8b5442c8f8f30b27f2a39c2d35da8..ba5d902d5217b948766c0e7dc955cc21ec14e39c 100644
--- a/src/compiler/linkage.cc
+++ b/src/compiler/linkage.cc
@@ -404,6 +404,55 @@ CallDescriptor* Linkage::GetStubCallDescriptor(
descriptor.DebugName(isolate));
}
+CallDescriptor* Linkage::GetBytecodeDispatchCallDescriptor(
+ Isolate* isolate, Zone* zone, const CallInterfaceDescriptor& descriptor,
+ int stack_parameter_count) {
+ const int register_parameter_count = descriptor.GetRegisterParameterCount();
+ const int parameter_count = register_parameter_count + stack_parameter_count;
+ const int context_count = 1;
+ const size_t parameter_and_context_count =
+ static_cast<size_t>(parameter_count + context_count);
+
+ LocationSignature::Builder locations(zone, 0, parameter_and_context_count);
+ MachineSignature::Builder types(zone, 0, parameter_and_context_count);
+
+ // Add parameters in registers and on the stack.
+ for (int i = 0; i < parameter_count; i++) {
+ if (i < register_parameter_count) {
+ // The first parameters go in registers.
+ Register reg = descriptor.GetRegisterParameter(i);
+ Representation rep =
+ RepresentationFromType(descriptor.GetParameterType(i));
+ locations.AddParam(regloc(reg));
+ types.AddParam(reptyp(rep));
+ } else {
+ // The rest of the parameters go on the stack.
+ int stack_slot = i - register_parameter_count - stack_parameter_count;
+ locations.AddParam(LinkageLocation::ForCallerFrameSlot(stack_slot));
+ types.AddParam(MachineType::AnyTagged());
+ }
+ }
+ // Add context.
+ locations.AddParam(regloc(kContextRegister));
+ types.AddParam(MachineType::AnyTagged());
+
+ // The target for interpreter dispatches is a code entry address.
+ MachineType target_type = MachineType::Pointer();
+ LinkageLocation target_loc = LinkageLocation::ForAnyRegister();
+ return new (zone) CallDescriptor( // --
+ CallDescriptor::kCallAddress, // kind
+ target_type, // target MachineType
+ target_loc, // target location
+ types.Build(), // machine_sig
+ locations.Build(), // location_sig
+ stack_parameter_count, // stack_parameter_count
+ Operator::kNoProperties, // properties
+ kNoCalleeSaved, // callee-saved registers
+ kNoCalleeSaved, // callee-saved fp
+ CallDescriptor::kCanUseRoots | // flags
+ CallDescriptor::kSupportsTailCalls, // flags
+ descriptor.DebugName(isolate));
+}
LinkageLocation Linkage::GetOsrValueLocation(int index) const {
CHECK(incoming_->IsJSFunctionCall());
« no previous file with comments | « src/compiler/linkage.h ('k') | src/compiler/mips/code-generator-mips.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698