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

Side by Side Diff: src/compiler/raw-machine-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 unified diff | Download patch
« no previous file with comments | « src/compiler/raw-machine-assembler.h ('k') | src/interpreter/interpreter-assembler.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 the V8 project authors. All rights reserved. 1 // Copyright 2014 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "src/compiler/raw-machine-assembler.h" 5 #include "src/compiler/raw-machine-assembler.h"
6 6
7 #include "src/compiler/node-properties.h" 7 #include "src/compiler/node-properties.h"
8 #include "src/compiler/pipeline.h" 8 #include "src/compiler/pipeline.h"
9 #include "src/compiler/scheduler.h" 9 #include "src/compiler/scheduler.h"
10 #include "src/objects-inl.h" 10 #include "src/objects-inl.h"
(...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after
199 Node** buffer = zone()->NewArray<Node*>(input_count); 199 Node** buffer = zone()->NewArray<Node*>(input_count);
200 int index = 0; 200 int index = 0;
201 buffer[index++] = function; 201 buffer[index++] = function;
202 for (int i = 0; i < param_count; i++) { 202 for (int i = 0; i < param_count; i++) {
203 buffer[index++] = args[i]; 203 buffer[index++] = args[i];
204 } 204 }
205 buffer[index++] = frame_state; 205 buffer[index++] = frame_state;
206 return AddNode(common()->Call(desc), input_count, buffer); 206 return AddNode(common()->Call(desc), input_count, buffer);
207 } 207 }
208 208
209 Node* RawMachineAssembler::TailCallN(CallDescriptor* desc, Node* function,
210 Node** args) {
211 int param_count = static_cast<int>(desc->ParameterCount());
212 int input_count = param_count + 1;
213 Node** buffer = zone()->NewArray<Node*>(input_count);
214 int index = 0;
215 buffer[index++] = function;
216 for (int i = 0; i < param_count; i++) {
217 buffer[index++] = args[i];
218 }
219 return TailCallN(desc, input_count, buffer);
220 }
221
222 Node* RawMachineAssembler::TailCallN(CallDescriptor* desc, int input_count, 209 Node* RawMachineAssembler::TailCallN(CallDescriptor* desc, int input_count,
223 Node* const* inputs) { 210 Node* const* inputs) {
224 // +1 is for target. 211 // +1 is for target.
225 DCHECK_EQ(input_count, desc->ParameterCount() + 1); 212 DCHECK_EQ(input_count, desc->ParameterCount() + 1);
226 Node* tail_call = MakeNode(common()->TailCall(desc), input_count, inputs); 213 Node* tail_call = MakeNode(common()->TailCall(desc), input_count, inputs);
227 schedule()->AddTailCall(CurrentBlock(), tail_call); 214 schedule()->AddTailCall(CurrentBlock(), tail_call);
228 current_block_ = nullptr; 215 current_block_ = nullptr;
229 return tail_call; 216 return tail_call;
230 } 217 }
231 218
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after
347 // The raw machine assembler nodes do not have effect and control inputs, 334 // The raw machine assembler nodes do not have effect and control inputs,
348 // so we disable checking input counts here. 335 // so we disable checking input counts here.
349 return graph()->NewNodeUnchecked(op, input_count, inputs); 336 return graph()->NewNodeUnchecked(op, input_count, inputs);
350 } 337 }
351 338
352 RawMachineLabel::~RawMachineLabel() { DCHECK(bound_ || !used_); } 339 RawMachineLabel::~RawMachineLabel() { DCHECK(bound_ || !used_); }
353 340
354 } // namespace compiler 341 } // namespace compiler
355 } // namespace internal 342 } // namespace internal
356 } // namespace v8 343 } // namespace v8
OLDNEW
« no previous file with comments | « src/compiler/raw-machine-assembler.h ('k') | src/interpreter/interpreter-assembler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698