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

Side by Side Diff: src/interpreter/bytecode-array-builder.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/code-assembler.cc ('k') | src/interpreter/bytecode-pipeline.h » ('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/interpreter/bytecode-array-builder.h" 5 #include "src/interpreter/bytecode-array-builder.h"
6 6
7 #include "src/globals.h" 7 #include "src/globals.h"
8 #include "src/interpreter/bytecode-array-writer.h" 8 #include "src/interpreter/bytecode-array-writer.h"
9 #include "src/interpreter/bytecode-dead-code-optimizer.h" 9 #include "src/interpreter/bytecode-dead-code-optimizer.h"
10 #include "src/interpreter/bytecode-label.h" 10 #include "src/interpreter/bytecode-label.h"
(...skipping 895 matching lines...) Expand 10 before | Expand all | Expand 10 after
906 } 906 }
907 907
908 BytecodeArrayBuilder& BytecodeArrayBuilder::Call(Register callable, 908 BytecodeArrayBuilder& BytecodeArrayBuilder::Call(Register callable,
909 RegisterList args, 909 RegisterList args,
910 int feedback_slot, 910 int feedback_slot,
911 Call::CallType call_type, 911 Call::CallType call_type,
912 TailCallMode tail_call_mode) { 912 TailCallMode tail_call_mode) {
913 if (tail_call_mode == TailCallMode::kDisallow) { 913 if (tail_call_mode == TailCallMode::kDisallow) {
914 if (call_type == Call::NAMED_PROPERTY_CALL || 914 if (call_type == Call::NAMED_PROPERTY_CALL ||
915 call_type == Call::KEYED_PROPERTY_CALL) { 915 call_type == Call::KEYED_PROPERTY_CALL) {
916 OutputCallProperty(callable, args, args.register_count(), feedback_slot); 916 if (args.register_count() == 1) {
917 OutputCallProperty0(callable, args[0], feedback_slot);
918 } else if (args.register_count() == 2) {
919 OutputCallProperty1(callable, args[0], args[1], feedback_slot);
920 } else if (args.register_count() == 3) {
921 OutputCallProperty2(callable, args[0], args[1], args[2], feedback_slot);
922 } else {
923 OutputCallProperty(callable, args, args.register_count(),
924 feedback_slot);
925 }
917 } else { 926 } else {
918 OutputCall(callable, args, args.register_count(), feedback_slot); 927 if (args.register_count() == 1) {
928 OutputCall0(callable, args[0], feedback_slot);
929 } else if (args.register_count() == 2) {
930 OutputCall1(callable, args[0], args[1], feedback_slot);
931 } else if (args.register_count() == 3) {
932 OutputCall2(callable, args[0], args[1], args[2], feedback_slot);
933 } else {
934 OutputCall(callable, args, args.register_count(), feedback_slot);
935 }
919 } 936 }
920 } else { 937 } else {
921 DCHECK(tail_call_mode == TailCallMode::kAllow); 938 DCHECK(tail_call_mode == TailCallMode::kAllow);
922 OutputTailCall(callable, args, args.register_count(), feedback_slot); 939 OutputTailCall(callable, args, args.register_count(), feedback_slot);
923 } 940 }
924 return *this; 941 return *this;
925 } 942 }
926 943
927 BytecodeArrayBuilder& BytecodeArrayBuilder::CallWithSpread(Register callable, 944 BytecodeArrayBuilder& BytecodeArrayBuilder::CallWithSpread(Register callable,
928 RegisterList args) { 945 RegisterList args) {
(...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after
1083 RegisterList reg_list) { 1100 RegisterList reg_list) {
1084 DCHECK(RegisterListIsValid(reg_list)); 1101 DCHECK(RegisterListIsValid(reg_list));
1085 if (register_optimizer_) 1102 if (register_optimizer_)
1086 register_optimizer_->PrepareOutputRegisterList(reg_list); 1103 register_optimizer_->PrepareOutputRegisterList(reg_list);
1087 return static_cast<uint32_t>(reg_list.first_register().ToOperand()); 1104 return static_cast<uint32_t>(reg_list.first_register().ToOperand());
1088 } 1105 }
1089 1106
1090 } // namespace interpreter 1107 } // namespace interpreter
1091 } // namespace internal 1108 } // namespace internal
1092 } // namespace v8 1109 } // namespace v8
OLDNEW
« no previous file with comments | « src/compiler/code-assembler.cc ('k') | src/interpreter/bytecode-pipeline.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698