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

Side by Side Diff: src/compiler/code-assembler.h

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 | « no previous file | src/compiler/code-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 2015 the V8 project authors. All rights reserved. 1 // Copyright 2015 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 #ifndef V8_COMPILER_CODE_ASSEMBLER_H_ 5 #ifndef V8_COMPILER_CODE_ASSEMBLER_H_
6 #define V8_COMPILER_CODE_ASSEMBLER_H_ 6 #define V8_COMPILER_CODE_ASSEMBLER_H_
7 7
8 #include <map> 8 #include <map>
9 #include <memory> 9 #include <memory>
10 10
(...skipping 319 matching lines...) Expand 10 before | Expand all | Expand 10 after
330 template <class... TArgs> 330 template <class... TArgs>
331 Node* TailCallStub(Callable const& callable, Node* context, TArgs... args) { 331 Node* TailCallStub(Callable const& callable, Node* context, TArgs... args) {
332 Node* target = HeapConstant(callable.code()); 332 Node* target = HeapConstant(callable.code());
333 return TailCallStub(callable.descriptor(), target, context, args...); 333 return TailCallStub(callable.descriptor(), target, context, args...);
334 } 334 }
335 335
336 template <class... TArgs> 336 template <class... TArgs>
337 Node* TailCallStub(const CallInterfaceDescriptor& descriptor, Node* target, 337 Node* TailCallStub(const CallInterfaceDescriptor& descriptor, Node* target,
338 Node* context, TArgs... args); 338 Node* context, TArgs... args);
339 339
340 template <class... TArgs>
340 Node* TailCallBytecodeDispatch(const CallInterfaceDescriptor& descriptor, 341 Node* TailCallBytecodeDispatch(const CallInterfaceDescriptor& descriptor,
341 Node* code_target_address, Node** args); 342 Node* target, TArgs... args);
342 343
343 template <class... TArgs> 344 template <class... TArgs>
344 Node* CallJS(Callable const& callable, Node* context, Node* function, 345 Node* CallJS(Callable const& callable, Node* context, Node* function,
345 Node* receiver, TArgs... args) { 346 Node* receiver, TArgs... args) {
346 int argc = static_cast<int>(sizeof...(args)); 347 int argc = static_cast<int>(sizeof...(args));
347 Node* arity = Int32Constant(argc); 348 Node* arity = Int32Constant(argc);
348 return CallStub(callable, context, function, arity, receiver, args...); 349 return CallStub(callable, context, function, arity, receiver, args...);
349 } 350 }
350 351
351 // Call to a C function with two arguments. 352 // Call to a C function with two arguments.
(...skipping 13 matching lines...) Expand all
365 CodeAssemblerState* state() { return state_; } 366 CodeAssemblerState* state() { return state_; }
366 367
367 void BreakOnNode(int node_id); 368 void BreakOnNode(int node_id);
368 369
369 protected: 370 protected:
370 // Enables subclasses to perform operations before and after a call. 371 // Enables subclasses to perform operations before and after a call.
371 virtual void CallPrologue(); 372 virtual void CallPrologue();
372 virtual void CallEpilogue(); 373 virtual void CallEpilogue();
373 374
374 private: 375 private:
375 Node* CallN(CallDescriptor* descriptor, Node* code_target, Node** args);
376 Node* TailCallN(CallDescriptor* descriptor, Node* code_target, Node** args);
377
378 RawMachineAssembler* raw_assembler() const; 376 RawMachineAssembler* raw_assembler() const;
379 377
380 CodeAssemblerState* state_; 378 CodeAssemblerState* state_;
381 379
382 DISALLOW_COPY_AND_ASSIGN(CodeAssembler); 380 DISALLOW_COPY_AND_ASSIGN(CodeAssembler);
383 }; 381 };
384 382
385 class CodeAssemblerVariable { 383 class CodeAssemblerVariable {
386 public: 384 public:
387 explicit CodeAssemblerVariable(CodeAssembler* assembler, 385 explicit CodeAssemblerVariable(CodeAssembler* assembler,
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
475 ZoneSet<CodeAssemblerVariable::Impl*> variables_; 473 ZoneSet<CodeAssemblerVariable::Impl*> variables_;
476 474
477 DISALLOW_COPY_AND_ASSIGN(CodeAssemblerState); 475 DISALLOW_COPY_AND_ASSIGN(CodeAssemblerState);
478 }; 476 };
479 477
480 } // namespace compiler 478 } // namespace compiler
481 } // namespace internal 479 } // namespace internal
482 } // namespace v8 480 } // namespace v8
483 481
484 #endif // V8_COMPILER_CODE_ASSEMBLER_H_ 482 #endif // V8_COMPILER_CODE_ASSEMBLER_H_
OLDNEW
« no previous file with comments | « no previous file | src/compiler/code-assembler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698