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/interpreter-assembler.h" | 5 #include "src/interpreter/interpreter-assembler.h" |
6 | 6 |
7 #include <limits> | 7 #include <limits> |
8 #include <ostream> | 8 #include <ostream> |
9 | 9 |
10 #include "src/code-factory.h" | 10 #include "src/code-factory.h" |
(...skipping 700 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
711 Node* feedback_value = LoadWeakCellValueUnchecked(feedback_element); | 711 Node* feedback_value = LoadWeakCellValueUnchecked(feedback_element); |
712 Node* is_monomorphic = WordEqual(constructor, feedback_value); | 712 Node* is_monomorphic = WordEqual(constructor, feedback_value); |
713 allocation_feedback.Bind(UndefinedConstant()); | 713 allocation_feedback.Bind(UndefinedConstant()); |
714 Branch(is_monomorphic, &call_construct_function, &extra_checks); | 714 Branch(is_monomorphic, &call_construct_function, &extra_checks); |
715 | 715 |
716 Bind(&call_construct_function); | 716 Bind(&call_construct_function); |
717 { | 717 { |
718 Comment("call using callConstructFunction"); | 718 Comment("call using callConstructFunction"); |
719 IncrementCallCount(type_feedback_vector, slot_id); | 719 IncrementCallCount(type_feedback_vector, slot_id); |
720 Callable callable_function = CodeFactory::InterpreterPushArgsAndConstruct( | 720 Callable callable_function = CodeFactory::InterpreterPushArgsAndConstruct( |
721 isolate(), CallableType::kJSFunction); | 721 isolate(), PushArgsConstructMode::kJSFunction); |
722 return_value.Bind(CallStub(callable_function.descriptor(), | 722 return_value.Bind(CallStub(callable_function.descriptor(), |
723 HeapConstant(callable_function.code()), context, | 723 HeapConstant(callable_function.code()), context, |
724 arg_count, new_target, constructor, | 724 arg_count, new_target, constructor, |
725 allocation_feedback.value(), first_arg)); | 725 allocation_feedback.value(), first_arg)); |
726 Goto(&end); | 726 Goto(&end); |
727 } | 727 } |
728 | 728 |
729 Bind(&extra_checks); | 729 Bind(&extra_checks); |
730 { | 730 { |
731 Label check_allocation_site(this), check_initialized(this), | 731 Label check_allocation_site(this), check_initialized(this), |
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
814 HeapConstant(TypeFeedbackVector::MegamorphicSentinel(isolate())), | 814 HeapConstant(TypeFeedbackVector::MegamorphicSentinel(isolate())), |
815 SKIP_WRITE_BARRIER); | 815 SKIP_WRITE_BARRIER); |
816 Goto(&call_construct_function); | 816 Goto(&call_construct_function); |
817 } | 817 } |
818 } | 818 } |
819 | 819 |
820 Bind(&call_construct); | 820 Bind(&call_construct); |
821 { | 821 { |
822 Comment("call using callConstruct builtin"); | 822 Comment("call using callConstruct builtin"); |
823 Callable callable = CodeFactory::InterpreterPushArgsAndConstruct( | 823 Callable callable = CodeFactory::InterpreterPushArgsAndConstruct( |
824 isolate(), CallableType::kAny); | 824 isolate(), PushArgsConstructMode::kOther); |
825 Node* code_target = HeapConstant(callable.code()); | 825 Node* code_target = HeapConstant(callable.code()); |
826 return_value.Bind(CallStub(callable.descriptor(), code_target, context, | 826 return_value.Bind(CallStub(callable.descriptor(), code_target, context, |
827 arg_count, new_target, constructor, | 827 arg_count, new_target, constructor, |
828 UndefinedConstant(), first_arg)); | 828 UndefinedConstant(), first_arg)); |
829 Goto(&end); | 829 Goto(&end); |
830 } | 830 } |
831 | 831 |
832 Bind(&end); | 832 Bind(&end); |
833 return return_value.value(); | 833 return return_value.value(); |
834 } | 834 } |
835 | 835 |
| 836 Node* InterpreterAssembler::CallConstructWithSpread(Node* constructor, |
| 837 Node* context, |
| 838 Node* new_target, |
| 839 Node* first_arg, |
| 840 Node* arg_count) { |
| 841 Variable return_value(this, MachineRepresentation::kTagged); |
| 842 Comment("call using ConstructWithSpread"); |
| 843 Callable callable = CodeFactory::InterpreterPushArgsAndConstruct( |
| 844 isolate(), PushArgsConstructMode::kWithFinalSpread); |
| 845 Node* code_target = HeapConstant(callable.code()); |
| 846 return_value.Bind(CallStub(callable.descriptor(), code_target, context, |
| 847 arg_count, new_target, constructor, |
| 848 UndefinedConstant(), first_arg)); |
| 849 |
| 850 return return_value.value(); |
| 851 } |
| 852 |
836 Node* InterpreterAssembler::CallRuntimeN(Node* function_id, Node* context, | 853 Node* InterpreterAssembler::CallRuntimeN(Node* function_id, Node* context, |
837 Node* first_arg, Node* arg_count, | 854 Node* first_arg, Node* arg_count, |
838 int result_size) { | 855 int result_size) { |
839 Callable callable = CodeFactory::InterpreterCEntry(isolate(), result_size); | 856 Callable callable = CodeFactory::InterpreterCEntry(isolate(), result_size); |
840 Node* code_target = HeapConstant(callable.code()); | 857 Node* code_target = HeapConstant(callable.code()); |
841 | 858 |
842 // Get the function entry from the function id. | 859 // Get the function entry from the function id. |
843 Node* function_table = ExternalConstant( | 860 Node* function_table = ExternalConstant( |
844 ExternalReference::runtime_function_table_address(isolate())); | 861 ExternalReference::runtime_function_table_address(isolate())); |
845 Node* function_offset = | 862 Node* function_offset = |
(...skipping 457 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1303 Goto(&loop); | 1320 Goto(&loop); |
1304 } | 1321 } |
1305 Bind(&done_loop); | 1322 Bind(&done_loop); |
1306 | 1323 |
1307 return array; | 1324 return array; |
1308 } | 1325 } |
1309 | 1326 |
1310 } // namespace interpreter | 1327 } // namespace interpreter |
1311 } // namespace internal | 1328 } // namespace internal |
1312 } // namespace v8 | 1329 } // namespace v8 |
OLD | NEW |