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 895 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 Loading... |
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 |
OLD | NEW |