| OLD | NEW |
| 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 987 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 998 } | 998 } |
| 999 | 999 |
| 1000 BytecodeArrayBuilder& BytecodeArrayBuilder::Call(Register callable, | 1000 BytecodeArrayBuilder& BytecodeArrayBuilder::Call(Register callable, |
| 1001 RegisterList args, | 1001 RegisterList args, |
| 1002 int feedback_slot, | 1002 int feedback_slot, |
| 1003 Call::CallType call_type, | 1003 Call::CallType call_type, |
| 1004 TailCallMode tail_call_mode) { | 1004 TailCallMode tail_call_mode) { |
| 1005 if (tail_call_mode == TailCallMode::kDisallow) { | 1005 if (tail_call_mode == TailCallMode::kDisallow) { |
| 1006 if (call_type == Call::NAMED_PROPERTY_CALL || | 1006 if (call_type == Call::NAMED_PROPERTY_CALL || |
| 1007 call_type == Call::KEYED_PROPERTY_CALL) { | 1007 call_type == Call::KEYED_PROPERTY_CALL) { |
| 1008 if (args.register_count() == 1) { | 1008 OutputCallProperty(callable, args, args.register_count(), feedback_slot); |
| 1009 OutputCallProperty0(callable, args[0], feedback_slot); | |
| 1010 } else if (args.register_count() == 2) { | |
| 1011 OutputCallProperty1(callable, args[0], args[1], feedback_slot); | |
| 1012 } else if (args.register_count() == 3) { | |
| 1013 OutputCallProperty2(callable, args[0], args[1], args[2], feedback_slot); | |
| 1014 } else { | |
| 1015 OutputCallProperty(callable, args, args.register_count(), | |
| 1016 feedback_slot); | |
| 1017 } | |
| 1018 } else { | 1009 } else { |
| 1019 if (args.register_count() == 1) { | 1010 OutputCall(callable, args, args.register_count(), feedback_slot); |
| 1020 OutputCall0(callable, args[0], feedback_slot); | |
| 1021 } else if (args.register_count() == 2) { | |
| 1022 OutputCall1(callable, args[0], args[1], feedback_slot); | |
| 1023 } else if (args.register_count() == 3) { | |
| 1024 OutputCall2(callable, args[0], args[1], args[2], feedback_slot); | |
| 1025 } else { | |
| 1026 OutputCall(callable, args, args.register_count(), feedback_slot); | |
| 1027 } | |
| 1028 } | 1011 } |
| 1029 } else { | 1012 } else { |
| 1030 DCHECK(tail_call_mode == TailCallMode::kAllow); | 1013 DCHECK(tail_call_mode == TailCallMode::kAllow); |
| 1031 OutputTailCall(callable, args, args.register_count(), feedback_slot); | 1014 OutputTailCall(callable, args, args.register_count(), feedback_slot); |
| 1032 } | 1015 } |
| 1033 return *this; | 1016 return *this; |
| 1034 } | 1017 } |
| 1035 | 1018 |
| 1036 BytecodeArrayBuilder& BytecodeArrayBuilder::CallWithSpread(Register callable, | 1019 BytecodeArrayBuilder& BytecodeArrayBuilder::CallWithSpread(Register callable, |
| 1037 RegisterList args) { | 1020 RegisterList args) { |
| (...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1209 RegisterList reg_list) { | 1192 RegisterList reg_list) { |
| 1210 DCHECK(RegisterListIsValid(reg_list)); | 1193 DCHECK(RegisterListIsValid(reg_list)); |
| 1211 if (register_optimizer_) | 1194 if (register_optimizer_) |
| 1212 register_optimizer_->PrepareOutputRegisterList(reg_list); | 1195 register_optimizer_->PrepareOutputRegisterList(reg_list); |
| 1213 return static_cast<uint32_t>(reg_list.first_register().ToOperand()); | 1196 return static_cast<uint32_t>(reg_list.first_register().ToOperand()); |
| 1214 } | 1197 } |
| 1215 | 1198 |
| 1216 } // namespace interpreter | 1199 } // namespace interpreter |
| 1217 } // namespace internal | 1200 } // namespace internal |
| 1218 } // namespace v8 | 1201 } // namespace v8 |
| OLD | NEW |