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

Unified Diff: src/compiler/code-assembler.cc

Issue 2576213007: [interpreter] Avoid allocation of temporary array of Nodes when generating dispatch to bytecode han… (Closed)
Patch Set: Created 4 years 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/code-assembler.h ('k') | src/compiler/raw-machine-assembler.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler/code-assembler.cc
diff --git a/src/compiler/code-assembler.cc b/src/compiler/code-assembler.cc
index d9284ffcb3a5486af3b90deb8fa8126875a53f3a..885f4b24df0fa63109ef18082630bd9b8c6e603a 100644
--- a/src/compiler/code-assembler.cc
+++ b/src/compiler/code-assembler.cc
@@ -405,19 +405,6 @@ void CodeAssembler::GotoIfException(Node* node, Label* if_exception,
Bind(&success);
}
-Node* CodeAssembler::CallN(CallDescriptor* descriptor, Node* code_target,
- Node** args) {
- CallPrologue();
- Node* return_value = raw_assembler()->CallN(descriptor, code_target, args);
- CallEpilogue();
- return return_value;
-}
-
-Node* CodeAssembler::TailCallN(CallDescriptor* descriptor, Node* code_target,
- Node** args) {
- return raw_assembler()->TailCallN(descriptor, code_target, args);
-}
-
template <class... TArgs>
Node* CodeAssembler::CallRuntime(Runtime::FunctionId function, Node* context,
TArgs... args) {
@@ -535,15 +522,22 @@ Node* CodeAssembler::TailCallStub(const CallInterfaceDescriptor& descriptor,
REPEAT_1_TO_7(INSTANTIATE, Node*)
#undef INSTANTIATE
+template <class... TArgs>
Node* CodeAssembler::TailCallBytecodeDispatch(
- const CallInterfaceDescriptor& interface_descriptor,
- Node* code_target_address, Node** args) {
- CallDescriptor* descriptor = Linkage::GetBytecodeDispatchCallDescriptor(
- isolate(), zone(), interface_descriptor,
- interface_descriptor.GetStackParameterCount());
- return raw_assembler()->TailCallN(descriptor, code_target_address, args);
+ const CallInterfaceDescriptor& descriptor, Node* target, TArgs... args) {
+ DCHECK_EQ(descriptor.GetParameterCount(), sizeof...(args));
+ CallDescriptor* desc = Linkage::GetBytecodeDispatchCallDescriptor(
+ isolate(), zone(), descriptor, descriptor.GetStackParameterCount());
+
+ Node* nodes[] = {target, args...};
+ return raw_assembler()->TailCallN(desc, arraysize(nodes), nodes);
}
+// Instantiate TailCallBytecodeDispatch() with 4 arguments.
+template V8_EXPORT_PRIVATE Node* CodeAssembler::TailCallBytecodeDispatch(
+ const CallInterfaceDescriptor& descriptor, Node* target, Node*, Node*,
+ Node*, Node*);
+
Node* CodeAssembler::CallCFunction2(MachineType return_type,
MachineType arg0_type,
MachineType arg1_type, Node* function,
« no previous file with comments | « src/compiler/code-assembler.h ('k') | src/compiler/raw-machine-assembler.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698