| 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 553 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 564 STATIC_ASSERT(AllocationSite::kTransitionInfoOffset == | 564 STATIC_ASSERT(AllocationSite::kTransitionInfoOffset == |
| 565 WeakCell::kValueOffset && | 565 WeakCell::kValueOffset && |
| 566 WeakCell::kValueOffset == Symbol::kHashFieldSlot); | 566 WeakCell::kValueOffset == Symbol::kHashFieldSlot); |
| 567 | 567 |
| 568 Variable return_value(this, MachineRepresentation::kTagged); | 568 Variable return_value(this, MachineRepresentation::kTagged); |
| 569 Label handle_monomorphic(this), extra_checks(this), end(this), call(this), | 569 Label handle_monomorphic(this), extra_checks(this), end(this), call(this), |
| 570 call_function(this); | 570 call_function(this); |
| 571 | 571 |
| 572 // The checks. First, does function match the recorded monomorphic target? | 572 // The checks. First, does function match the recorded monomorphic target? |
| 573 Node* feedback_element = LoadFixedArrayElement(type_feedback_vector, slot_id); | 573 Node* feedback_element = LoadFixedArrayElement(type_feedback_vector, slot_id); |
| 574 Node* feedback_value = LoadWeakCellValue(feedback_element); | 574 Node* feedback_value = LoadWeakCellValueUnchecked(feedback_element); |
| 575 Node* is_monomorphic = WordEqual(function, feedback_value); | 575 Node* is_monomorphic = WordEqual(function, feedback_value); |
| 576 Branch(is_monomorphic, &handle_monomorphic, &extra_checks); | 576 Branch(is_monomorphic, &handle_monomorphic, &extra_checks); |
| 577 | 577 |
| 578 Bind(&handle_monomorphic); | 578 Bind(&handle_monomorphic); |
| 579 { | 579 { |
| 580 // The compare above could have been a SMI/SMI comparison. Guard against | 580 // The compare above could have been a SMI/SMI comparison. Guard against |
| 581 // this convincing us that we have a monomorphic JSFunction. | 581 // this convincing us that we have a monomorphic JSFunction. |
| 582 Node* is_smi = TaggedIsSmi(function); | 582 Node* is_smi = TaggedIsSmi(function); |
| 583 GotoIf(is_smi, &extra_checks); | 583 GotoIf(is_smi, &extra_checks); |
| 584 | 584 |
| (...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 769 { | 769 { |
| 770 // Cache the called function in a feedback vector slot. Cache states | 770 // Cache the called function in a feedback vector slot. Cache states |
| 771 // are uninitialized, monomorphic (indicated by a JSFunction), and | 771 // are uninitialized, monomorphic (indicated by a JSFunction), and |
| 772 // megamorphic. | 772 // megamorphic. |
| 773 // TODO(mythria/v8:5210): Check if it is better to mark extra_checks as a | 773 // TODO(mythria/v8:5210): Check if it is better to mark extra_checks as a |
| 774 // deferred block so that call_construct_function will be scheduled. | 774 // deferred block so that call_construct_function will be scheduled. |
| 775 Label extra_checks(this), call_construct_function(this); | 775 Label extra_checks(this), call_construct_function(this); |
| 776 | 776 |
| 777 Node* feedback_element = | 777 Node* feedback_element = |
| 778 LoadFixedArrayElement(type_feedback_vector, slot_id); | 778 LoadFixedArrayElement(type_feedback_vector, slot_id); |
| 779 Node* feedback_value = LoadWeakCellValue(feedback_element); | 779 Node* feedback_value = LoadWeakCellValueUnchecked(feedback_element); |
| 780 Node* is_monomorphic = WordEqual(constructor, feedback_value); | 780 Node* is_monomorphic = WordEqual(constructor, feedback_value); |
| 781 Branch(is_monomorphic, &call_construct_function, &extra_checks); | 781 Branch(is_monomorphic, &call_construct_function, &extra_checks); |
| 782 | 782 |
| 783 Bind(&extra_checks); | 783 Bind(&extra_checks); |
| 784 { | 784 { |
| 785 Label mark_megamorphic(this), initialize(this), | 785 Label mark_megamorphic(this), initialize(this), |
| 786 check_allocation_site(this), check_initialized(this), | 786 check_allocation_site(this), check_initialized(this), |
| 787 set_alloc_feedback_and_call(this); | 787 set_alloc_feedback_and_call(this); |
| 788 { | 788 { |
| 789 // Check if it is a megamorphic target | 789 // Check if it is a megamorphic target |
| (...skipping 588 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1378 Goto(&loop); | 1378 Goto(&loop); |
| 1379 } | 1379 } |
| 1380 Bind(&done_loop); | 1380 Bind(&done_loop); |
| 1381 | 1381 |
| 1382 return array; | 1382 return array; |
| 1383 } | 1383 } |
| 1384 | 1384 |
| 1385 } // namespace interpreter | 1385 } // namespace interpreter |
| 1386 } // namespace internal | 1386 } // namespace internal |
| 1387 } // namespace v8 | 1387 } // namespace v8 |
| OLD | NEW |