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 887 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
898 } | 898 } |
899 return *this; | 899 return *this; |
900 } | 900 } |
901 | 901 |
902 BytecodeArrayBuilder& BytecodeArrayBuilder::CallWithSpread(Register callable, | 902 BytecodeArrayBuilder& BytecodeArrayBuilder::CallWithSpread(Register callable, |
903 RegisterList args) { | 903 RegisterList args) { |
904 OutputCallWithSpread(callable, args, args.register_count()); | 904 OutputCallWithSpread(callable, args, args.register_count()); |
905 return *this; | 905 return *this; |
906 } | 906 } |
907 | 907 |
908 BytecodeArrayBuilder& BytecodeArrayBuilder::New(Register constructor, | 908 BytecodeArrayBuilder& BytecodeArrayBuilder::Construct(Register constructor, |
909 RegisterList args, | 909 RegisterList args, |
910 int feedback_slot_id) { | 910 int feedback_slot_id) { |
911 OutputNew(constructor, args, args.register_count(), feedback_slot_id); | 911 OutputConstruct(constructor, args, args.register_count(), feedback_slot_id); |
912 return *this; | 912 return *this; |
913 } | 913 } |
914 | 914 |
| 915 BytecodeArrayBuilder& BytecodeArrayBuilder::ConstructWithSpread( |
| 916 Register constructor, RegisterList args) { |
| 917 OutputConstructWithSpread(constructor, args, args.register_count()); |
| 918 return *this; |
| 919 } |
| 920 |
915 BytecodeArrayBuilder& BytecodeArrayBuilder::CallRuntime( | 921 BytecodeArrayBuilder& BytecodeArrayBuilder::CallRuntime( |
916 Runtime::FunctionId function_id, RegisterList args) { | 922 Runtime::FunctionId function_id, RegisterList args) { |
917 DCHECK_EQ(1, Runtime::FunctionForId(function_id)->result_size); | 923 DCHECK_EQ(1, Runtime::FunctionForId(function_id)->result_size); |
918 DCHECK(Bytecodes::SizeForUnsignedOperand(function_id) <= OperandSize::kShort); | 924 DCHECK(Bytecodes::SizeForUnsignedOperand(function_id) <= OperandSize::kShort); |
919 if (IntrinsicsHelper::IsSupported(function_id)) { | 925 if (IntrinsicsHelper::IsSupported(function_id)) { |
920 IntrinsicsHelper::IntrinsicId intrinsic_id = | 926 IntrinsicsHelper::IntrinsicId intrinsic_id = |
921 IntrinsicsHelper::FromRuntimeId(function_id); | 927 IntrinsicsHelper::FromRuntimeId(function_id); |
922 OutputInvokeIntrinsic(static_cast<int>(intrinsic_id), args, | 928 OutputInvokeIntrinsic(static_cast<int>(intrinsic_id), args, |
923 args.register_count()); | 929 args.register_count()); |
924 } else { | 930 } else { |
(...skipping 29 matching lines...) Expand all Loading... |
954 return CallRuntimeForPair(function_id, RegisterList(arg.index(), 1), | 960 return CallRuntimeForPair(function_id, RegisterList(arg.index(), 1), |
955 return_pair); | 961 return_pair); |
956 } | 962 } |
957 | 963 |
958 BytecodeArrayBuilder& BytecodeArrayBuilder::CallJSRuntime(int context_index, | 964 BytecodeArrayBuilder& BytecodeArrayBuilder::CallJSRuntime(int context_index, |
959 RegisterList args) { | 965 RegisterList args) { |
960 OutputCallJSRuntime(context_index, args, args.register_count()); | 966 OutputCallJSRuntime(context_index, args, args.register_count()); |
961 return *this; | 967 return *this; |
962 } | 968 } |
963 | 969 |
964 BytecodeArrayBuilder& BytecodeArrayBuilder::NewWithSpread(Register constructor, | |
965 RegisterList args) { | |
966 OutputNewWithSpread(constructor, args, args.register_count()); | |
967 return *this; | |
968 } | |
969 | |
970 BytecodeArrayBuilder& BytecodeArrayBuilder::Delete(Register object, | 970 BytecodeArrayBuilder& BytecodeArrayBuilder::Delete(Register object, |
971 LanguageMode language_mode) { | 971 LanguageMode language_mode) { |
972 if (language_mode == SLOPPY) { | 972 if (language_mode == SLOPPY) { |
973 OutputDeletePropertySloppy(object); | 973 OutputDeletePropertySloppy(object); |
974 } else { | 974 } else { |
975 DCHECK_EQ(language_mode, STRICT); | 975 DCHECK_EQ(language_mode, STRICT); |
976 OutputDeletePropertyStrict(object); | 976 OutputDeletePropertyStrict(object); |
977 } | 977 } |
978 return *this; | 978 return *this; |
979 } | 979 } |
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1058 RegisterList reg_list) { | 1058 RegisterList reg_list) { |
1059 DCHECK(RegisterListIsValid(reg_list)); | 1059 DCHECK(RegisterListIsValid(reg_list)); |
1060 if (register_optimizer_) | 1060 if (register_optimizer_) |
1061 register_optimizer_->PrepareOutputRegisterList(reg_list); | 1061 register_optimizer_->PrepareOutputRegisterList(reg_list); |
1062 return static_cast<uint32_t>(reg_list.first_register().ToOperand()); | 1062 return static_cast<uint32_t>(reg_list.first_register().ToOperand()); |
1063 } | 1063 } |
1064 | 1064 |
1065 } // namespace interpreter | 1065 } // namespace interpreter |
1066 } // namespace internal | 1066 } // namespace internal |
1067 } // namespace v8 | 1067 } // namespace v8 |
OLD | NEW |