OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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_AST_AST_H_ | 5 #ifndef V8_AST_AST_H_ |
6 #define V8_AST_AST_H_ | 6 #define V8_AST_AST_H_ |
7 | 7 |
8 #include "src/assembler.h" | 8 #include "src/assembler.h" |
9 #include "src/ast/ast-types.h" | 9 #include "src/ast/ast-types.h" |
10 #include "src/ast/ast-value-factory.h" | 10 #include "src/ast/ast-value-factory.h" |
(...skipping 2777 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2788 // Object literals need one feedback slot for each non-trivial value, as well | 2788 // Object literals need one feedback slot for each non-trivial value, as well |
2789 // as some slots for home objects. | 2789 // as some slots for home objects. |
2790 void AssignFeedbackVectorSlots(Isolate* isolate, FeedbackVectorSpec* spec, | 2790 void AssignFeedbackVectorSlots(Isolate* isolate, FeedbackVectorSpec* spec, |
2791 FeedbackVectorSlotCache* cache); | 2791 FeedbackVectorSlotCache* cache); |
2792 | 2792 |
2793 bool NeedsProxySlot() const { | 2793 bool NeedsProxySlot() const { |
2794 return class_variable_proxy() != nullptr && | 2794 return class_variable_proxy() != nullptr && |
2795 class_variable_proxy()->var()->IsUnallocated(); | 2795 class_variable_proxy()->var()->IsUnallocated(); |
2796 } | 2796 } |
2797 | 2797 |
2798 FeedbackVectorSlot PrototypeSlot() const { return prototype_slot_; } | 2798 FeedbackVectorSlot HomeObjectSlot() const { return home_object_slot_; } |
2799 FeedbackVectorSlot ProxySlot() const { return proxy_slot_; } | 2799 FeedbackVectorSlot ProxySlot() const { return proxy_slot_; } |
2800 | 2800 |
2801 private: | 2801 private: |
2802 friend class AstNodeFactory; | 2802 friend class AstNodeFactory; |
2803 | 2803 |
2804 ClassLiteral(VariableProxy* class_variable_proxy, Expression* extends, | 2804 ClassLiteral(VariableProxy* class_variable_proxy, Expression* extends, |
2805 FunctionLiteral* constructor, ZoneList<Property*>* properties, | 2805 FunctionLiteral* constructor, ZoneList<Property*>* properties, |
2806 int start_position, int end_position, | 2806 int start_position, int end_position, |
2807 bool has_name_static_property, bool has_static_computed_names) | 2807 bool has_name_static_property, bool has_static_computed_names) |
2808 : Expression(start_position, kClassLiteral), | 2808 : Expression(start_position, kClassLiteral), |
2809 end_position_(end_position), | 2809 end_position_(end_position), |
2810 class_variable_proxy_(class_variable_proxy), | 2810 class_variable_proxy_(class_variable_proxy), |
2811 extends_(extends), | 2811 extends_(extends), |
2812 constructor_(constructor), | 2812 constructor_(constructor), |
2813 properties_(properties) { | 2813 properties_(properties) { |
2814 bit_field_ |= HasNameStaticProperty::encode(has_name_static_property) | | 2814 bit_field_ |= HasNameStaticProperty::encode(has_name_static_property) | |
2815 HasStaticComputedNames::encode(has_static_computed_names); | 2815 HasStaticComputedNames::encode(has_static_computed_names); |
2816 } | 2816 } |
2817 | 2817 |
2818 int end_position_; | 2818 int end_position_; |
2819 FeedbackVectorSlot prototype_slot_; | 2819 FeedbackVectorSlot home_object_slot_; |
2820 FeedbackVectorSlot proxy_slot_; | 2820 FeedbackVectorSlot proxy_slot_; |
2821 VariableProxy* class_variable_proxy_; | 2821 VariableProxy* class_variable_proxy_; |
2822 Expression* extends_; | 2822 Expression* extends_; |
2823 FunctionLiteral* constructor_; | 2823 FunctionLiteral* constructor_; |
2824 ZoneList<Property*>* properties_; | 2824 ZoneList<Property*>* properties_; |
2825 | 2825 |
2826 class HasNameStaticProperty | 2826 class HasNameStaticProperty |
2827 : public BitField<bool, Expression::kNextBitFieldIndex, 1> {}; | 2827 : public BitField<bool, Expression::kNextBitFieldIndex, 1> {}; |
2828 class HasStaticComputedNames | 2828 class HasStaticComputedNames |
2829 : public BitField<bool, HasNameStaticProperty::kNext, 1> {}; | 2829 : public BitField<bool, HasNameStaticProperty::kNext, 1> {}; |
(...skipping 774 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3604 : NULL; \ | 3604 : NULL; \ |
3605 } | 3605 } |
3606 AST_NODE_LIST(DECLARE_NODE_FUNCTIONS) | 3606 AST_NODE_LIST(DECLARE_NODE_FUNCTIONS) |
3607 #undef DECLARE_NODE_FUNCTIONS | 3607 #undef DECLARE_NODE_FUNCTIONS |
3608 | 3608 |
3609 | 3609 |
3610 } // namespace internal | 3610 } // namespace internal |
3611 } // namespace v8 | 3611 } // namespace v8 |
3612 | 3612 |
3613 #endif // V8_AST_AST_H_ | 3613 #endif // V8_AST_AST_H_ |
OLD | NEW |