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

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

Issue 2673833003: [interpreter] Create custom call opcodes for specific argument counts (Closed)
Patch Set: Rebase Created 3 years, 10 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 unified diff | Download patch
« no previous file with comments | « src/compiler/bytecode-graph-builder.cc ('k') | src/interpreter/bytecode-array-builder.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 #include "src/compiler/code-assembler.h" 5 #include "src/compiler/code-assembler.h"
6 6
7 #include <ostream> 7 #include <ostream>
8 8
9 #include "src/code-factory.h" 9 #include "src/code-factory.h"
10 #include "src/compiler/graph.h" 10 #include "src/compiler/graph.h"
(...skipping 529 matching lines...) Expand 10 before | Expand all | Expand 10 after
540 size_t result_size, Node* target, Node* context, 540 size_t result_size, Node* target, Node* context,
541 TArgs... args) { 541 TArgs... args) {
542 Node* nodes[] = {target, args..., context}; 542 Node* nodes[] = {target, args..., context};
543 return CallStubN(descriptor, result_size, arraysize(nodes), nodes); 543 return CallStubN(descriptor, result_size, arraysize(nodes), nodes);
544 } 544 }
545 545
546 // Instantiate CallStubR() with up to 6 arguments. 546 // Instantiate CallStubR() with up to 6 arguments.
547 #define INSTANTIATE(...) \ 547 #define INSTANTIATE(...) \
548 template V8_EXPORT_PRIVATE Node* CodeAssembler::CallStubR( \ 548 template V8_EXPORT_PRIVATE Node* CodeAssembler::CallStubR( \
549 const CallInterfaceDescriptor& descriptor, size_t, Node*, __VA_ARGS__); 549 const CallInterfaceDescriptor& descriptor, size_t, Node*, __VA_ARGS__);
550 REPEAT_1_TO_7(INSTANTIATE, Node*) 550 REPEAT_1_TO_8(INSTANTIATE, Node*)
551 #undef INSTANTIATE 551 #undef INSTANTIATE
552 552
553 Node* CodeAssembler::CallStubN(const CallInterfaceDescriptor& descriptor, 553 Node* CodeAssembler::CallStubN(const CallInterfaceDescriptor& descriptor,
554 size_t result_size, int input_count, 554 size_t result_size, int input_count,
555 Node* const* inputs) { 555 Node* const* inputs) {
556 // 2 is for target and context. 556 // 2 is for target and context.
557 DCHECK_LE(2, input_count); 557 DCHECK_LE(2, input_count);
558 int argc = input_count - 2; 558 int argc = input_count - 2;
559 DCHECK_LE(descriptor.GetParameterCount(), argc); 559 DCHECK_LE(descriptor.GetParameterCount(), argc);
560 // Extra arguments not mentioned in the descriptor are passed on the stack. 560 // Extra arguments not mentioned in the descriptor are passed on the stack.
(...skipping 28 matching lines...) Expand all
589 // Instantiate TailCallStub() with up to 6 arguments. 589 // Instantiate TailCallStub() with up to 6 arguments.
590 #define INSTANTIATE(...) \ 590 #define INSTANTIATE(...) \
591 template V8_EXPORT_PRIVATE Node* CodeAssembler::TailCallStub( \ 591 template V8_EXPORT_PRIVATE Node* CodeAssembler::TailCallStub( \
592 const CallInterfaceDescriptor& descriptor, Node*, __VA_ARGS__); 592 const CallInterfaceDescriptor& descriptor, Node*, __VA_ARGS__);
593 REPEAT_1_TO_7(INSTANTIATE, Node*) 593 REPEAT_1_TO_7(INSTANTIATE, Node*)
594 #undef INSTANTIATE 594 #undef INSTANTIATE
595 595
596 template <class... TArgs> 596 template <class... TArgs>
597 Node* CodeAssembler::TailCallBytecodeDispatch( 597 Node* CodeAssembler::TailCallBytecodeDispatch(
598 const CallInterfaceDescriptor& descriptor, Node* target, TArgs... args) { 598 const CallInterfaceDescriptor& descriptor, Node* target, TArgs... args) {
599 Comment("TailCallBytecodeDispatch");
599 DCHECK_EQ(descriptor.GetParameterCount(), sizeof...(args)); 600 DCHECK_EQ(descriptor.GetParameterCount(), sizeof...(args));
600 CallDescriptor* desc = Linkage::GetBytecodeDispatchCallDescriptor( 601 CallDescriptor* desc = Linkage::GetBytecodeDispatchCallDescriptor(
601 isolate(), zone(), descriptor, descriptor.GetStackParameterCount()); 602 isolate(), zone(), descriptor, descriptor.GetStackParameterCount());
602 603
603 Node* nodes[] = {target, args...}; 604 Node* nodes[] = {target, args...};
605 Comment("TAIL");
604 return raw_assembler()->TailCallN(desc, arraysize(nodes), nodes); 606 return raw_assembler()->TailCallN(desc, arraysize(nodes), nodes);
605 } 607 }
606 608
607 // Instantiate TailCallBytecodeDispatch() with 4 arguments. 609 // Instantiate TailCallBytecodeDispatch() with 4 arguments.
608 template V8_EXPORT_PRIVATE Node* CodeAssembler::TailCallBytecodeDispatch( 610 template V8_EXPORT_PRIVATE Node* CodeAssembler::TailCallBytecodeDispatch(
609 const CallInterfaceDescriptor& descriptor, Node* target, Node*, Node*, 611 const CallInterfaceDescriptor& descriptor, Node* target, Node*, Node*,
610 Node*, Node*); 612 Node*, Node*);
611 613
612 Node* CodeAssembler::CallCFunctionN(Signature<MachineType>* signature, 614 Node* CodeAssembler::CallCFunctionN(Signature<MachineType>* signature,
613 int input_count, Node* const* inputs) { 615 int input_count, Node* const* inputs) {
(...skipping 226 matching lines...) Expand 10 before | Expand all | Expand 10 after
840 } 842 }
841 } 843 }
842 } 844 }
843 845
844 bound_ = true; 846 bound_ = true;
845 } 847 }
846 848
847 } // namespace compiler 849 } // namespace compiler
848 } // namespace internal 850 } // namespace internal
849 } // namespace v8 851 } // namespace v8
OLDNEW
« no previous file with comments | « src/compiler/bytecode-graph-builder.cc ('k') | src/interpreter/bytecode-array-builder.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698