| 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 628 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 639 | 639 |
| 640 CreateWeakCellInFeedbackVector(type_feedback_vector, SmiTag(slot_id), | 640 CreateWeakCellInFeedbackVector(type_feedback_vector, SmiTag(slot_id), |
| 641 function); | 641 function); |
| 642 | 642 |
| 643 // Call using call function builtin. | 643 // Call using call function builtin. |
| 644 Goto(&call_function); | 644 Goto(&call_function); |
| 645 } | 645 } |
| 646 | 646 |
| 647 Bind(&create_allocation_site); | 647 Bind(&create_allocation_site); |
| 648 { | 648 { |
| 649 // TODO(mythria): Inline the creation of the allocation site. | 649 CreateAllocationSiteInFeedbackVector(type_feedback_vector, |
| 650 CreateAllocationSiteStub create_stub(isolate()); | 650 SmiTag(slot_id)); |
| 651 CallStub(create_stub.GetCallInterfaceDescriptor(), | |
| 652 HeapConstant(create_stub.GetCode()), context, | |
| 653 type_feedback_vector, SmiTag(slot_id)); | |
| 654 | 651 |
| 655 // Call using CallFunction builtin. CallICs have a PREMONOMORPHIC state. | 652 // Call using CallFunction builtin. CallICs have a PREMONOMORPHIC state. |
| 656 // They start collecting feedback only when a call is executed the second | 653 // They start collecting feedback only when a call is executed the second |
| 657 // time. So, do not pass any feedback here. | 654 // time. So, do not pass any feedback here. |
| 658 Goto(&call_function); | 655 Goto(&call_function); |
| 659 } | 656 } |
| 660 | 657 |
| 661 Bind(&mark_megamorphic); | 658 Bind(&mark_megamorphic); |
| 662 { | 659 { |
| 663 // Mark it as a megamorphic. | 660 // Mark it as a megamorphic. |
| (...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 828 Comment("initialize the feedback element"); | 825 Comment("initialize the feedback element"); |
| 829 // Check that it is the Array() function. | 826 // Check that it is the Array() function. |
| 830 Node* context_slot = | 827 Node* context_slot = |
| 831 LoadFixedArrayElement(LoadNativeContext(context), | 828 LoadFixedArrayElement(LoadNativeContext(context), |
| 832 Int32Constant(Context::ARRAY_FUNCTION_INDEX)); | 829 Int32Constant(Context::ARRAY_FUNCTION_INDEX)); |
| 833 Node* is_array_function = WordEqual(context_slot, constructor); | 830 Node* is_array_function = WordEqual(context_slot, constructor); |
| 834 BranchIf(is_array_function, &create_allocation_site, &create_weak_cell); | 831 BranchIf(is_array_function, &create_allocation_site, &create_weak_cell); |
| 835 | 832 |
| 836 Bind(&create_allocation_site); | 833 Bind(&create_allocation_site); |
| 837 { | 834 { |
| 838 // TODO(mythria): Inline the creation of allocation site. | 835 Node* site = CreateAllocationSiteInFeedbackVector( |
| 839 CreateAllocationSiteStub create_stub(isolate()); | 836 type_feedback_vector, SmiTag(slot_id)); |
| 840 CallStub(create_stub.GetCallInterfaceDescriptor(), | 837 allocation_feedback.Bind(site); |
| 841 HeapConstant(create_stub.GetCode()), context, | |
| 842 type_feedback_vector, SmiTag(slot_id)); | |
| 843 Node* feedback_element = | |
| 844 LoadFixedArrayElement(type_feedback_vector, slot_id); | |
| 845 allocation_feedback.Bind(feedback_element); | |
| 846 Goto(&call_construct_function); | 838 Goto(&call_construct_function); |
| 847 } | 839 } |
| 848 | 840 |
| 849 Bind(&create_weak_cell); | 841 Bind(&create_weak_cell); |
| 850 { | 842 { |
| 851 CreateWeakCellInFeedbackVector(type_feedback_vector, SmiTag(slot_id), | 843 CreateWeakCellInFeedbackVector(type_feedback_vector, SmiTag(slot_id), |
| 852 constructor); | 844 constructor); |
| 853 Goto(&call_construct_function); | 845 Goto(&call_construct_function); |
| 854 } | 846 } |
| 855 } | 847 } |
| (...skipping 488 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1344 Goto(&loop); | 1336 Goto(&loop); |
| 1345 } | 1337 } |
| 1346 Bind(&done_loop); | 1338 Bind(&done_loop); |
| 1347 | 1339 |
| 1348 return array; | 1340 return array; |
| 1349 } | 1341 } |
| 1350 | 1342 |
| 1351 } // namespace interpreter | 1343 } // namespace interpreter |
| 1352 } // namespace internal | 1344 } // namespace internal |
| 1353 } // namespace v8 | 1345 } // namespace v8 |
| OLD | NEW |