Chromium Code Reviews| 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 870 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 881 } | 881 } |
| 882 | 882 |
| 883 BytecodeArrayBuilder& BytecodeArrayBuilder::Call(Register callable, | 883 BytecodeArrayBuilder& BytecodeArrayBuilder::Call(Register callable, |
| 884 RegisterList args, | 884 RegisterList args, |
| 885 int feedback_slot, | 885 int feedback_slot, |
| 886 Call::CallType call_type, | 886 Call::CallType call_type, |
| 887 TailCallMode tail_call_mode) { | 887 TailCallMode tail_call_mode) { |
| 888 if (tail_call_mode == TailCallMode::kDisallow) { | 888 if (tail_call_mode == TailCallMode::kDisallow) { |
| 889 if (call_type == Call::NAMED_PROPERTY_CALL || | 889 if (call_type == Call::NAMED_PROPERTY_CALL || |
| 890 call_type == Call::KEYED_PROPERTY_CALL) { | 890 call_type == Call::KEYED_PROPERTY_CALL) { |
| 891 OutputCallProperty(callable, args, args.register_count(), feedback_slot); | 891 OutputCallProperty(callable, args, args.register_count(), feedback_slot); |
|
rmcilroy
2017/02/06 12:20:01
Note - you aren't getting any benifit of these han
| |
| 892 } else { | 892 } else { |
| 893 OutputCall(callable, args, args.register_count(), feedback_slot); | 893 if (args.register_count() == 1) { |
| 894 OutputCall0(callable, args[0], feedback_slot); | |
| 895 } else if (args.register_count() == 2) { | |
| 896 OutputCall1(callable, args[0], args[1], feedback_slot); | |
| 897 } else if (args.register_count() == 3) { | |
| 898 OutputCall2(callable, args[0], args[1], args[2], feedback_slot); | |
| 899 } else { | |
| 900 OutputCall(callable, args, args.register_count(), feedback_slot); | |
| 901 } | |
| 894 } | 902 } |
| 895 } else { | 903 } else { |
| 896 DCHECK(tail_call_mode == TailCallMode::kAllow); | 904 DCHECK(tail_call_mode == TailCallMode::kAllow); |
| 897 OutputTailCall(callable, args, args.register_count(), feedback_slot); | 905 OutputTailCall(callable, args, args.register_count(), feedback_slot); |
| 898 } | 906 } |
| 899 return *this; | 907 return *this; |
| 900 } | 908 } |
| 901 | 909 |
| 902 BytecodeArrayBuilder& BytecodeArrayBuilder::CallWithSpread(Register callable, | 910 BytecodeArrayBuilder& BytecodeArrayBuilder::CallWithSpread(Register callable, |
| 903 RegisterList args) { | 911 RegisterList args) { |
| (...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1058 RegisterList reg_list) { | 1066 RegisterList reg_list) { |
| 1059 DCHECK(RegisterListIsValid(reg_list)); | 1067 DCHECK(RegisterListIsValid(reg_list)); |
| 1060 if (register_optimizer_) | 1068 if (register_optimizer_) |
| 1061 register_optimizer_->PrepareOutputRegisterList(reg_list); | 1069 register_optimizer_->PrepareOutputRegisterList(reg_list); |
| 1062 return static_cast<uint32_t>(reg_list.first_register().ToOperand()); | 1070 return static_cast<uint32_t>(reg_list.first_register().ToOperand()); |
| 1063 } | 1071 } |
| 1064 | 1072 |
| 1065 } // namespace interpreter | 1073 } // namespace interpreter |
| 1066 } // namespace internal | 1074 } // namespace internal |
| 1067 } // namespace v8 | 1075 } // namespace v8 |
| OLD | NEW |