OLD | NEW |
1 // Copyright 2016 the V8 project authors. All rights reserved. | 1 // Copyright 2016 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 #ifndef V8_CODE_STUB_ASSEMBLER_H_ | 5 #ifndef V8_CODE_STUB_ASSEMBLER_H_ |
6 #define V8_CODE_STUB_ASSEMBLER_H_ | 6 #define V8_CODE_STUB_ASSEMBLER_H_ |
7 | 7 |
8 #include <functional> | 8 #include <functional> |
9 | 9 |
10 #include "src/compiler/code-assembler.h" | 10 #include "src/compiler/code-assembler.h" |
(...skipping 613 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
624 LookupInHolder& lookup_property_in_holder, | 624 LookupInHolder& lookup_property_in_holder, |
625 LookupInHolder& lookup_element_in_holder, | 625 LookupInHolder& lookup_element_in_holder, |
626 Label* if_end, Label* if_bailout); | 626 Label* if_end, Label* if_bailout); |
627 | 627 |
628 // Instanceof helpers. | 628 // Instanceof helpers. |
629 // ES6 section 7.3.19 OrdinaryHasInstance (C, O) | 629 // ES6 section 7.3.19 OrdinaryHasInstance (C, O) |
630 compiler::Node* OrdinaryHasInstance(compiler::Node* context, | 630 compiler::Node* OrdinaryHasInstance(compiler::Node* context, |
631 compiler::Node* callable, | 631 compiler::Node* callable, |
632 compiler::Node* object); | 632 compiler::Node* object); |
633 | 633 |
634 // LoadIC helpers. | 634 // Load/StoreIC helpers. |
635 struct LoadICParameters { | 635 struct LoadICParameters { |
636 LoadICParameters(compiler::Node* context, compiler::Node* receiver, | 636 LoadICParameters(compiler::Node* context, compiler::Node* receiver, |
637 compiler::Node* name, compiler::Node* slot, | 637 compiler::Node* name, compiler::Node* slot, |
638 compiler::Node* vector) | 638 compiler::Node* vector) |
639 : context(context), | 639 : context(context), |
640 receiver(receiver), | 640 receiver(receiver), |
641 name(name), | 641 name(name), |
642 slot(slot), | 642 slot(slot), |
643 vector(vector) {} | 643 vector(vector) {} |
644 | 644 |
645 compiler::Node* context; | 645 compiler::Node* context; |
646 compiler::Node* receiver; | 646 compiler::Node* receiver; |
647 compiler::Node* name; | 647 compiler::Node* name; |
648 compiler::Node* slot; | 648 compiler::Node* slot; |
649 compiler::Node* vector; | 649 compiler::Node* vector; |
650 }; | 650 }; |
651 | 651 |
| 652 struct StoreICParameters : public LoadICParameters { |
| 653 StoreICParameters(compiler::Node* context, compiler::Node* receiver, |
| 654 compiler::Node* name, compiler::Node* value, |
| 655 compiler::Node* slot, compiler::Node* vector) |
| 656 : LoadICParameters(context, receiver, name, slot, vector), |
| 657 value(value) {} |
| 658 compiler::Node* value; |
| 659 }; |
| 660 |
652 // Load type feedback vector from the stub caller's frame. | 661 // Load type feedback vector from the stub caller's frame. |
653 compiler::Node* LoadTypeFeedbackVectorForStub(); | 662 compiler::Node* LoadTypeFeedbackVectorForStub(); |
654 | 663 |
655 // Update the type feedback vector. | 664 // Update the type feedback vector. |
656 void UpdateFeedback(compiler::Node* feedback, | 665 void UpdateFeedback(compiler::Node* feedback, |
657 compiler::Node* type_feedback_vector, | 666 compiler::Node* type_feedback_vector, |
658 compiler::Node* slot_id); | 667 compiler::Node* slot_id); |
659 | 668 |
660 compiler::Node* LoadReceiverMap(compiler::Node* receiver); | 669 compiler::Node* LoadReceiverMap(compiler::Node* receiver); |
661 | 670 |
662 // Checks monomorphic case. Returns {feedback} entry of the vector. | 671 // Checks monomorphic case. Returns {feedback} entry of the vector. |
663 compiler::Node* TryMonomorphicCase(const LoadICParameters* p, | 672 compiler::Node* TryMonomorphicCase(compiler::Node* slot, |
| 673 compiler::Node* vector, |
664 compiler::Node* receiver_map, | 674 compiler::Node* receiver_map, |
665 Label* if_handler, Variable* var_handler, | 675 Label* if_handler, Variable* var_handler, |
666 Label* if_miss); | 676 Label* if_miss); |
667 void HandlePolymorphicCase(const LoadICParameters* p, | 677 void HandlePolymorphicCase(compiler::Node* receiver_map, |
668 compiler::Node* receiver_map, | |
669 compiler::Node* feedback, Label* if_handler, | 678 compiler::Node* feedback, Label* if_handler, |
670 Variable* var_handler, Label* if_miss, | 679 Variable* var_handler, Label* if_miss, |
671 int unroll_count); | 680 int unroll_count); |
672 | 681 |
673 compiler::Node* StubCachePrimaryOffset(compiler::Node* name, | 682 compiler::Node* StubCachePrimaryOffset(compiler::Node* name, |
674 compiler::Node* map); | 683 compiler::Node* map); |
675 | 684 |
676 compiler::Node* StubCacheSecondaryOffset(compiler::Node* name, | 685 compiler::Node* StubCacheSecondaryOffset(compiler::Node* name, |
677 compiler::Node* seed); | 686 compiler::Node* seed); |
678 | 687 |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
739 | 748 |
740 compiler::Node* CopyElementsOnWrite(compiler::Node* object, | 749 compiler::Node* CopyElementsOnWrite(compiler::Node* object, |
741 compiler::Node* elements, | 750 compiler::Node* elements, |
742 ElementsKind kind, compiler::Node* length, | 751 ElementsKind kind, compiler::Node* length, |
743 ParameterMode mode, Label* bailout); | 752 ParameterMode mode, Label* bailout); |
744 | 753 |
745 void LoadIC(const LoadICParameters* p); | 754 void LoadIC(const LoadICParameters* p); |
746 void LoadGlobalIC(const LoadICParameters* p); | 755 void LoadGlobalIC(const LoadICParameters* p); |
747 void KeyedLoadIC(const LoadICParameters* p); | 756 void KeyedLoadIC(const LoadICParameters* p); |
748 void KeyedLoadICGeneric(const LoadICParameters* p); | 757 void KeyedLoadICGeneric(const LoadICParameters* p); |
| 758 void StoreIC(const StoreICParameters* p); |
749 | 759 |
750 void TransitionElementsKind(compiler::Node* object, compiler::Node* map, | 760 void TransitionElementsKind(compiler::Node* object, compiler::Node* map, |
751 ElementsKind from_kind, ElementsKind to_kind, | 761 ElementsKind from_kind, ElementsKind to_kind, |
752 bool is_jsarray, Label* bailout); | 762 bool is_jsarray, Label* bailout); |
753 | 763 |
754 void TrapAllocationMemento(compiler::Node* object, Label* memento_found); | 764 void TrapAllocationMemento(compiler::Node* object, Label* memento_found); |
755 | 765 |
756 compiler::Node* PageFromAddress(compiler::Node* address); | 766 compiler::Node* PageFromAddress(compiler::Node* address); |
757 | 767 |
758 // Get the enumerable length from |map| and return the result as a Smi. | 768 // Get the enumerable length from |map| and return the result as a Smi. |
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
843 Label* bailout); | 853 Label* bailout); |
844 | 854 |
845 static const int kElementLoopUnrollThreshold = 8; | 855 static const int kElementLoopUnrollThreshold = 8; |
846 }; | 856 }; |
847 | 857 |
848 DEFINE_OPERATORS_FOR_FLAGS(CodeStubAssembler::AllocationFlags); | 858 DEFINE_OPERATORS_FOR_FLAGS(CodeStubAssembler::AllocationFlags); |
849 | 859 |
850 } // namespace internal | 860 } // namespace internal |
851 } // namespace v8 | 861 } // namespace v8 |
852 #endif // V8_CODE_STUB_ASSEMBLER_H_ | 862 #endif // V8_CODE_STUB_ASSEMBLER_H_ |
OLD | NEW |