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

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

Issue 2684993002: [interpreter] Create custom call opcodes for specific argument counts (Closed)
Patch Set: Fix golden files again Created 3 years, 9 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-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 985 matching lines...) Expand 10 before | Expand all | Expand 10 after
996 } 996 }
997 997
998 BytecodeArrayBuilder& BytecodeArrayBuilder::Call(Register callable, 998 BytecodeArrayBuilder& BytecodeArrayBuilder::Call(Register callable,
999 RegisterList args, 999 RegisterList args,
1000 int feedback_slot, 1000 int feedback_slot,
1001 Call::CallType call_type, 1001 Call::CallType call_type,
1002 TailCallMode tail_call_mode) { 1002 TailCallMode tail_call_mode) {
1003 if (tail_call_mode == TailCallMode::kDisallow) { 1003 if (tail_call_mode == TailCallMode::kDisallow) {
1004 if (call_type == Call::NAMED_PROPERTY_CALL || 1004 if (call_type == Call::NAMED_PROPERTY_CALL ||
1005 call_type == Call::KEYED_PROPERTY_CALL) { 1005 call_type == Call::KEYED_PROPERTY_CALL) {
1006 OutputCallProperty(callable, args, args.register_count(), feedback_slot); 1006 if (args.register_count() == 1) {
1007 OutputCallProperty0(callable, args[0], feedback_slot);
1008 } else if (args.register_count() == 2) {
1009 OutputCallProperty1(callable, args[0], args[1], feedback_slot);
1010 } else if (args.register_count() == 3) {
1011 OutputCallProperty2(callable, args[0], args[1], args[2], feedback_slot);
1012 } else {
1013 OutputCallProperty(callable, args, args.register_count(),
1014 feedback_slot);
1015 }
1007 } else { 1016 } else {
1008 OutputCall(callable, args, args.register_count(), feedback_slot); 1017 if (args.register_count() == 1) {
1018 OutputCall0(callable, args[0], feedback_slot);
1019 } else if (args.register_count() == 2) {
1020 OutputCall1(callable, args[0], args[1], feedback_slot);
1021 } else if (args.register_count() == 3) {
1022 OutputCall2(callable, args[0], args[1], args[2], feedback_slot);
1023 } else {
1024 OutputCall(callable, args, args.register_count(), feedback_slot);
1025 }
1009 } 1026 }
1010 } else { 1027 } else {
1011 DCHECK(tail_call_mode == TailCallMode::kAllow); 1028 DCHECK(tail_call_mode == TailCallMode::kAllow);
1012 OutputTailCall(callable, args, args.register_count(), feedback_slot); 1029 OutputTailCall(callable, args, args.register_count(), feedback_slot);
1013 } 1030 }
1014 return *this; 1031 return *this;
1015 } 1032 }
1016 1033
1017 BytecodeArrayBuilder& BytecodeArrayBuilder::CallWithSpread(Register callable, 1034 BytecodeArrayBuilder& BytecodeArrayBuilder::CallWithSpread(Register callable,
1018 RegisterList args) { 1035 RegisterList args) {
(...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after
1190 RegisterList reg_list) { 1207 RegisterList reg_list) {
1191 DCHECK(RegisterListIsValid(reg_list)); 1208 DCHECK(RegisterListIsValid(reg_list));
1192 if (register_optimizer_) 1209 if (register_optimizer_)
1193 register_optimizer_->PrepareOutputRegisterList(reg_list); 1210 register_optimizer_->PrepareOutputRegisterList(reg_list);
1194 return static_cast<uint32_t>(reg_list.first_register().ToOperand()); 1211 return static_cast<uint32_t>(reg_list.first_register().ToOperand());
1195 } 1212 }
1196 1213
1197 } // namespace interpreter 1214 } // namespace interpreter
1198 } // namespace internal 1215 } // namespace internal
1199 } // namespace v8 1216 } // namespace v8
OLDNEW
« no previous file with comments | « src/compiler/bytecode-graph-builder.cc ('k') | src/interpreter/bytecode-pipeline.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698