OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 1651 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1662 // Type feedback information. | 1662 // Type feedback information. |
1663 void RecordTypeFeedback(TypeFeedbackOracle* oracle, Zone* zone); | 1663 void RecordTypeFeedback(TypeFeedbackOracle* oracle, Zone* zone); |
1664 virtual bool IsMonomorphic() V8_OVERRIDE { return is_monomorphic_; } | 1664 virtual bool IsMonomorphic() V8_OVERRIDE { return is_monomorphic_; } |
1665 virtual SmallMapList* GetReceiverTypes() V8_OVERRIDE { | 1665 virtual SmallMapList* GetReceiverTypes() V8_OVERRIDE { |
1666 return &receiver_types_; | 1666 return &receiver_types_; |
1667 } | 1667 } |
1668 virtual KeyedAccessStoreMode GetStoreMode() V8_OVERRIDE { | 1668 virtual KeyedAccessStoreMode GetStoreMode() V8_OVERRIDE { |
1669 return STANDARD_STORE; | 1669 return STANDARD_STORE; |
1670 } | 1670 } |
1671 bool IsUninitialized() { return is_uninitialized_; } | 1671 bool IsUninitialized() { return is_uninitialized_; } |
1672 bool IsPreMonomorphic() { return is_pre_monomorphic_; } | |
1673 bool HasNoTypeInformation() { | |
1674 return is_uninitialized_ || is_pre_monomorphic_; | |
1675 } | |
1676 TypeFeedbackId PropertyFeedbackId() { return reuse(id()); } | 1672 TypeFeedbackId PropertyFeedbackId() { return reuse(id()); } |
1677 | 1673 |
1678 protected: | 1674 protected: |
1679 Property(Isolate* isolate, | 1675 Property(Isolate* isolate, |
1680 Expression* obj, | 1676 Expression* obj, |
1681 Expression* key, | 1677 Expression* key, |
1682 int pos) | 1678 int pos) |
1683 : Expression(isolate, pos), | 1679 : Expression(isolate, pos), |
1684 obj_(obj), | 1680 obj_(obj), |
1685 key_(key), | 1681 key_(key), |
1686 load_id_(GetNextId(isolate)), | 1682 load_id_(GetNextId(isolate)), |
1687 is_monomorphic_(false), | 1683 is_monomorphic_(false), |
1688 is_pre_monomorphic_(false), | |
1689 is_uninitialized_(false), | 1684 is_uninitialized_(false), |
1690 is_string_access_(false), | 1685 is_string_access_(false), |
1691 is_function_prototype_(false) { } | 1686 is_function_prototype_(false) { } |
1692 | 1687 |
1693 private: | 1688 private: |
1694 Expression* obj_; | 1689 Expression* obj_; |
1695 Expression* key_; | 1690 Expression* key_; |
1696 const BailoutId load_id_; | 1691 const BailoutId load_id_; |
1697 | 1692 |
1698 SmallMapList receiver_types_; | 1693 SmallMapList receiver_types_; |
1699 bool is_monomorphic_ : 1; | 1694 bool is_monomorphic_ : 1; |
1700 bool is_pre_monomorphic_ : 1; | |
1701 bool is_uninitialized_ : 1; | 1695 bool is_uninitialized_ : 1; |
1702 bool is_string_access_ : 1; | 1696 bool is_string_access_ : 1; |
1703 bool is_function_prototype_ : 1; | 1697 bool is_function_prototype_ : 1; |
1704 }; | 1698 }; |
1705 | 1699 |
1706 | 1700 |
1707 class Call V8_FINAL : public Expression { | 1701 class Call V8_FINAL : public Expression { |
1708 public: | 1702 public: |
1709 DECLARE_NODE_TYPE(Call) | 1703 DECLARE_NODE_TYPE(Call) |
1710 | 1704 |
(...skipping 386 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2097 // This check relies on the definition order of token in token.h. | 2091 // This check relies on the definition order of token in token.h. |
2098 bool is_compound() const { return op() > Token::ASSIGN; } | 2092 bool is_compound() const { return op() > Token::ASSIGN; } |
2099 | 2093 |
2100 BailoutId AssignmentId() const { return assignment_id_; } | 2094 BailoutId AssignmentId() const { return assignment_id_; } |
2101 | 2095 |
2102 // Type feedback information. | 2096 // Type feedback information. |
2103 TypeFeedbackId AssignmentFeedbackId() { return reuse(id()); } | 2097 TypeFeedbackId AssignmentFeedbackId() { return reuse(id()); } |
2104 void RecordTypeFeedback(TypeFeedbackOracle* oracle, Zone* zone); | 2098 void RecordTypeFeedback(TypeFeedbackOracle* oracle, Zone* zone); |
2105 virtual bool IsMonomorphic() V8_OVERRIDE { return is_monomorphic_; } | 2099 virtual bool IsMonomorphic() V8_OVERRIDE { return is_monomorphic_; } |
2106 bool IsUninitialized() { return is_uninitialized_; } | 2100 bool IsUninitialized() { return is_uninitialized_; } |
2107 bool IsPreMonomorphic() { return is_pre_monomorphic_; } | |
2108 bool HasNoTypeInformation() { | |
2109 return is_uninitialized_ || is_pre_monomorphic_; | |
2110 } | |
2111 virtual SmallMapList* GetReceiverTypes() V8_OVERRIDE { | 2101 virtual SmallMapList* GetReceiverTypes() V8_OVERRIDE { |
2112 return &receiver_types_; | 2102 return &receiver_types_; |
2113 } | 2103 } |
2114 virtual KeyedAccessStoreMode GetStoreMode() V8_OVERRIDE { | 2104 virtual KeyedAccessStoreMode GetStoreMode() V8_OVERRIDE { |
2115 return store_mode_; | 2105 return store_mode_; |
2116 } | 2106 } |
2117 | 2107 |
2118 protected: | 2108 protected: |
2119 Assignment(Isolate* isolate, | 2109 Assignment(Isolate* isolate, |
2120 Token::Value op, | 2110 Token::Value op, |
(...skipping 12 matching lines...) Expand all Loading... |
2133 | 2123 |
2134 private: | 2124 private: |
2135 Token::Value op_; | 2125 Token::Value op_; |
2136 Expression* target_; | 2126 Expression* target_; |
2137 Expression* value_; | 2127 Expression* value_; |
2138 BinaryOperation* binary_operation_; | 2128 BinaryOperation* binary_operation_; |
2139 const BailoutId assignment_id_; | 2129 const BailoutId assignment_id_; |
2140 | 2130 |
2141 bool is_monomorphic_ : 1; | 2131 bool is_monomorphic_ : 1; |
2142 bool is_uninitialized_ : 1; | 2132 bool is_uninitialized_ : 1; |
2143 bool is_pre_monomorphic_ : 1; | |
2144 KeyedAccessStoreMode store_mode_ : 5; // Windows treats as signed, | 2133 KeyedAccessStoreMode store_mode_ : 5; // Windows treats as signed, |
2145 // must have extra bit. | 2134 // must have extra bit. |
2146 SmallMapList receiver_types_; | 2135 SmallMapList receiver_types_; |
2147 }; | 2136 }; |
2148 | 2137 |
2149 | 2138 |
2150 class Yield V8_FINAL : public Expression { | 2139 class Yield V8_FINAL : public Expression { |
2151 public: | 2140 public: |
2152 DECLARE_NODE_TYPE(Yield) | 2141 DECLARE_NODE_TYPE(Yield) |
2153 | 2142 |
(...skipping 1111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3265 private: | 3254 private: |
3266 Isolate* isolate_; | 3255 Isolate* isolate_; |
3267 Zone* zone_; | 3256 Zone* zone_; |
3268 Visitor visitor_; | 3257 Visitor visitor_; |
3269 }; | 3258 }; |
3270 | 3259 |
3271 | 3260 |
3272 } } // namespace v8::internal | 3261 } } // namespace v8::internal |
3273 | 3262 |
3274 #endif // V8_AST_H_ | 3263 #endif // V8_AST_H_ |
OLD | NEW |