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

Side by Side Diff: src/interpreter/bytecode-array-builder.cc

Issue 2684993002: [interpreter] Create custom call opcodes for specific argument counts (Closed)
Patch Set: Latest 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
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 972 matching lines...) Expand 10 before | Expand all | Expand 10 after
983 } 983 }
984 984
985 BytecodeArrayBuilder& BytecodeArrayBuilder::Call(Register callable, 985 BytecodeArrayBuilder& BytecodeArrayBuilder::Call(Register callable,
986 RegisterList args, 986 RegisterList args,
987 int feedback_slot, 987 int feedback_slot,
988 Call::CallType call_type, 988 Call::CallType call_type,
989 TailCallMode tail_call_mode) { 989 TailCallMode tail_call_mode) {
990 if (tail_call_mode == TailCallMode::kDisallow) { 990 if (tail_call_mode == TailCallMode::kDisallow) {
991 if (call_type == Call::NAMED_PROPERTY_CALL || 991 if (call_type == Call::NAMED_PROPERTY_CALL ||
992 call_type == Call::KEYED_PROPERTY_CALL) { 992 call_type == Call::KEYED_PROPERTY_CALL) {
993 OutputCallProperty(callable, args, args.register_count(), feedback_slot); 993 if (args.register_count() == 1) {
994 OutputCallProperty0(callable, args[0], feedback_slot);
995 } else if (args.register_count() == 2) {
996 OutputCallProperty1(callable, args[0], args[1], feedback_slot);
997 } else if (args.register_count() == 3) {
998 OutputCallProperty2(callable, args[0], args[1], args[2], feedback_slot);
999 } else {
1000 OutputCallProperty(callable, args, args.register_count(),
1001 feedback_slot);
1002 }
994 } else { 1003 } else {
995 OutputCall(callable, args, args.register_count(), feedback_slot); 1004 if (args.register_count() == 1) {
1005 OutputCall0(callable, args[0], feedback_slot);
1006 } else if (args.register_count() == 2) {
1007 OutputCall1(callable, args[0], args[1], feedback_slot);
1008 } else if (args.register_count() == 3) {
1009 OutputCall2(callable, args[0], args[1], args[2], feedback_slot);
1010 } else {
1011 OutputCall(callable, args, args.register_count(), feedback_slot);
1012 }
996 } 1013 }
997 } else { 1014 } else {
998 DCHECK(tail_call_mode == TailCallMode::kAllow); 1015 DCHECK(tail_call_mode == TailCallMode::kAllow);
999 OutputTailCall(callable, args, args.register_count(), feedback_slot); 1016 OutputTailCall(callable, args, args.register_count(), feedback_slot);
1000 } 1017 }
1001 return *this; 1018 return *this;
1002 } 1019 }
1003 1020
1004 BytecodeArrayBuilder& BytecodeArrayBuilder::CallWithSpread(Register callable, 1021 BytecodeArrayBuilder& BytecodeArrayBuilder::CallWithSpread(Register callable,
1005 RegisterList args) { 1022 RegisterList args) {
(...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after
1177 RegisterList reg_list) { 1194 RegisterList reg_list) {
1178 DCHECK(RegisterListIsValid(reg_list)); 1195 DCHECK(RegisterListIsValid(reg_list));
1179 if (register_optimizer_) 1196 if (register_optimizer_)
1180 register_optimizer_->PrepareOutputRegisterList(reg_list); 1197 register_optimizer_->PrepareOutputRegisterList(reg_list);
1181 return static_cast<uint32_t>(reg_list.first_register().ToOperand()); 1198 return static_cast<uint32_t>(reg_list.first_register().ToOperand());
1182 } 1199 }
1183 1200
1184 } // namespace interpreter 1201 } // namespace interpreter
1185 } // namespace internal 1202 } // namespace internal
1186 } // namespace v8 1203 } // namespace v8
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698