| 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_H_ | 5 #ifndef V8_AST_H_ |
| 6 #define V8_AST_H_ | 6 #define V8_AST_H_ |
| 7 | 7 |
| 8 #include "src/v8.h" | 8 #include "src/v8.h" |
| 9 | 9 |
| 10 #include "src/assembler.h" | 10 #include "src/assembler.h" |
| (...skipping 1687 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1698 virtual SmallMapList* GetReceiverTypes() V8_OVERRIDE { | 1698 virtual SmallMapList* GetReceiverTypes() V8_OVERRIDE { |
| 1699 return &receiver_types_; | 1699 return &receiver_types_; |
| 1700 } | 1700 } |
| 1701 virtual KeyedAccessStoreMode GetStoreMode() V8_OVERRIDE { | 1701 virtual KeyedAccessStoreMode GetStoreMode() V8_OVERRIDE { |
| 1702 return STANDARD_STORE; | 1702 return STANDARD_STORE; |
| 1703 } | 1703 } |
| 1704 bool IsUninitialized() { return !is_for_call_ && is_uninitialized_; } | 1704 bool IsUninitialized() { return !is_for_call_ && is_uninitialized_; } |
| 1705 bool HasNoTypeInformation() { | 1705 bool HasNoTypeInformation() { |
| 1706 return is_uninitialized_; | 1706 return is_uninitialized_; |
| 1707 } | 1707 } |
| 1708 bool IsOwnProperty() const { return is_own_property_; } |
| 1708 void set_is_uninitialized(bool b) { is_uninitialized_ = b; } | 1709 void set_is_uninitialized(bool b) { is_uninitialized_ = b; } |
| 1709 void set_is_string_access(bool b) { is_string_access_ = b; } | 1710 void set_is_string_access(bool b) { is_string_access_ = b; } |
| 1710 void mark_for_call() { is_for_call_ = true; } | 1711 void mark_for_call() { is_for_call_ = true; } |
| 1711 bool IsForCall() { return is_for_call_; } | 1712 bool IsForCall() { return is_for_call_; } |
| 1712 | 1713 |
| 1713 TypeFeedbackId PropertyFeedbackId() { return reuse(id()); } | 1714 TypeFeedbackId PropertyFeedbackId() { return reuse(id()); } |
| 1714 | 1715 |
| 1715 virtual int ComputeFeedbackSlotCount() { return FLAG_vector_ics ? 1 : 0; } | 1716 virtual int ComputeFeedbackSlotCount() { return FLAG_vector_ics ? 1 : 0; } |
| 1716 virtual void SetFirstFeedbackSlot(int slot) { | 1717 virtual void SetFirstFeedbackSlot(int slot) { |
| 1717 property_feedback_slot_ = slot; | 1718 property_feedback_slot_ = slot; |
| 1718 } | 1719 } |
| 1719 | 1720 |
| 1720 int PropertyFeedbackSlot() const { return property_feedback_slot_; } | 1721 int PropertyFeedbackSlot() const { return property_feedback_slot_; } |
| 1721 | 1722 |
| 1722 protected: | 1723 protected: |
| 1723 Property(Zone* zone, Expression* obj, Expression* key, int pos) | 1724 Property(Zone* zone, Expression* obj, Expression* key, int pos) |
| 1724 : Expression(zone, pos), | 1725 : Expression(zone, pos), |
| 1725 obj_(obj), | 1726 obj_(obj), |
| 1726 key_(key), | 1727 key_(key), |
| 1727 load_id_(GetNextId(zone)), | 1728 load_id_(GetNextId(zone)), |
| 1728 property_feedback_slot_(kInvalidFeedbackSlot), | 1729 property_feedback_slot_(kInvalidFeedbackSlot), |
| 1729 is_for_call_(false), | 1730 is_for_call_(false), |
| 1730 is_uninitialized_(false), | 1731 is_uninitialized_(false), |
| 1731 is_string_access_(false) {} | 1732 is_string_access_(false), |
| 1733 is_own_property_(false) {} |
| 1734 |
| 1735 void set_is_own_property(bool b) { is_own_property_ = b; } |
| 1732 | 1736 |
| 1733 private: | 1737 private: |
| 1734 Expression* obj_; | 1738 Expression* obj_; |
| 1735 Expression* key_; | 1739 Expression* key_; |
| 1736 const BailoutId load_id_; | 1740 const BailoutId load_id_; |
| 1737 int property_feedback_slot_; | 1741 int property_feedback_slot_; |
| 1738 | 1742 |
| 1739 SmallMapList receiver_types_; | 1743 SmallMapList receiver_types_; |
| 1740 bool is_for_call_ : 1; | 1744 bool is_for_call_ : 1; |
| 1741 bool is_uninitialized_ : 1; | 1745 bool is_uninitialized_ : 1; |
| 1742 bool is_string_access_ : 1; | 1746 bool is_string_access_ : 1; |
| 1747 bool is_own_property_ : 1; |
| 1743 }; | 1748 }; |
| 1744 | 1749 |
| 1745 | 1750 |
| 1746 class Call V8_FINAL : public Expression, public FeedbackSlotInterface { | 1751 class Call V8_FINAL : public Expression, public FeedbackSlotInterface { |
| 1747 public: | 1752 public: |
| 1748 DECLARE_NODE_TYPE(Call) | 1753 DECLARE_NODE_TYPE(Call) |
| 1749 | 1754 |
| 1750 Expression* expression() const { return expression_; } | 1755 Expression* expression() const { return expression_; } |
| 1751 ZoneList<Expression*>* arguments() const { return arguments_; } | 1756 ZoneList<Expression*>* arguments() const { return arguments_; } |
| 1752 | 1757 |
| (...skipping 1586 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3339 VariableProxy* proxy = | 3344 VariableProxy* proxy = |
| 3340 new(zone_) VariableProxy(zone_, name, is_this, interface, position); | 3345 new(zone_) VariableProxy(zone_, name, is_this, interface, position); |
| 3341 VISIT_AND_RETURN(VariableProxy, proxy) | 3346 VISIT_AND_RETURN(VariableProxy, proxy) |
| 3342 } | 3347 } |
| 3343 | 3348 |
| 3344 Property* NewProperty(Expression* obj, Expression* key, int pos) { | 3349 Property* NewProperty(Expression* obj, Expression* key, int pos) { |
| 3345 Property* prop = new(zone_) Property(zone_, obj, key, pos); | 3350 Property* prop = new(zone_) Property(zone_, obj, key, pos); |
| 3346 VISIT_AND_RETURN(Property, prop) | 3351 VISIT_AND_RETURN(Property, prop) |
| 3347 } | 3352 } |
| 3348 | 3353 |
| 3354 Property* NewOwnProperty(Expression* obj, Expression* key, int pos) { |
| 3355 Property* prop = new(zone_) Property(zone_, obj, key, pos); |
| 3356 prop->set_is_own_property(true); |
| 3357 VISIT_AND_RETURN(Property, prop); |
| 3358 } |
| 3359 |
| 3349 Call* NewCall(Expression* expression, | 3360 Call* NewCall(Expression* expression, |
| 3350 ZoneList<Expression*>* arguments, | 3361 ZoneList<Expression*>* arguments, |
| 3351 int pos) { | 3362 int pos) { |
| 3352 Call* call = new(zone_) Call(zone_, expression, arguments, pos); | 3363 Call* call = new(zone_) Call(zone_, expression, arguments, pos); |
| 3353 VISIT_AND_RETURN(Call, call) | 3364 VISIT_AND_RETURN(Call, call) |
| 3354 } | 3365 } |
| 3355 | 3366 |
| 3356 CallNew* NewCallNew(Expression* expression, | 3367 CallNew* NewCallNew(Expression* expression, |
| 3357 ZoneList<Expression*>* arguments, | 3368 ZoneList<Expression*>* arguments, |
| 3358 int pos) { | 3369 int pos) { |
| (...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3477 private: | 3488 private: |
| 3478 Zone* zone_; | 3489 Zone* zone_; |
| 3479 Visitor visitor_; | 3490 Visitor visitor_; |
| 3480 AstValueFactory* ast_value_factory_; | 3491 AstValueFactory* ast_value_factory_; |
| 3481 }; | 3492 }; |
| 3482 | 3493 |
| 3483 | 3494 |
| 3484 } } // namespace v8::internal | 3495 } } // namespace v8::internal |
| 3485 | 3496 |
| 3486 #endif // V8_AST_H_ | 3497 #endif // V8_AST_H_ |
| OLD | NEW |