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

Unified Diff: src/compiler/raw-machine-assembler.cc

Issue 2586903002: [turbofan] Avoid allocation of temporary array of Nodes when generating calls. (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/raw-machine-assembler.h ('k') | test/cctest/compiler/test-run-native-calls.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler/raw-machine-assembler.cc
diff --git a/src/compiler/raw-machine-assembler.cc b/src/compiler/raw-machine-assembler.cc
index 5d051ea0c3e93f20510fb20f9b02c2a94156e23f..311856bf21091494b3f604baf87dea693a868472 100644
--- a/src/compiler/raw-machine-assembler.cc
+++ b/src/compiler/raw-machine-assembler.cc
@@ -170,40 +170,21 @@ void RawMachineAssembler::Comment(const char* msg) {
AddNode(machine()->Comment(msg));
}
-Node* RawMachineAssembler::CallN(CallDescriptor* desc, Node* function,
- Node** args) {
- int param_count = static_cast<int>(desc->ParameterCount());
- int input_count = param_count + 1;
- Node** buffer = zone()->NewArray<Node*>(input_count);
- int index = 0;
- buffer[index++] = function;
- for (int i = 0; i < param_count; i++) {
- buffer[index++] = args[i];
- }
- return AddNode(common()->Call(desc), input_count, buffer);
-}
-
Node* RawMachineAssembler::CallN(CallDescriptor* desc, int input_count,
- Node* const* nodes) {
+ Node* const* inputs) {
+ DCHECK(!desc->NeedsFrameState());
// +1 is for target.
DCHECK_EQ(input_count, desc->ParameterCount() + 1);
- return AddNode(common()->Call(desc), input_count, nodes);
+ return AddNode(common()->Call(desc), input_count, inputs);
}
Node* RawMachineAssembler::CallNWithFrameState(CallDescriptor* desc,
- Node* function, Node** args,
- Node* frame_state) {
+ int input_count,
+ Node* const* inputs) {
DCHECK(desc->NeedsFrameState());
- int param_count = static_cast<int>(desc->ParameterCount());
- int input_count = param_count + 2;
- Node** buffer = zone()->NewArray<Node*>(input_count);
- int index = 0;
- buffer[index++] = function;
- for (int i = 0; i < param_count; i++) {
- buffer[index++] = args[i];
- }
- buffer[index++] = frame_state;
- return AddNode(common()->Call(desc), input_count, buffer);
+ // +2 is for target and frame state.
+ DCHECK_EQ(input_count, desc->ParameterCount() + 2);
+ return AddNode(common()->Call(desc), input_count, inputs);
}
Node* RawMachineAssembler::TailCallN(CallDescriptor* desc, int input_count,
« no previous file with comments | « src/compiler/raw-machine-assembler.h ('k') | test/cctest/compiler/test-run-native-calls.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698