OLD | NEW |
1 // Copyright 2010 the V8 project authors. All rights reserved. | 1 // Copyright 2010 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 1214 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1225 bool IsStringLength() const { return is_string_length_; } | 1225 bool IsStringLength() const { return is_string_length_; } |
1226 bool IsFunctionPrototype() const { return is_function_prototype_; } | 1226 bool IsFunctionPrototype() const { return is_function_prototype_; } |
1227 | 1227 |
1228 // Marks that this is actually an argument rewritten to a keyed property | 1228 // Marks that this is actually an argument rewritten to a keyed property |
1229 // accessing the argument through the arguments shadow object. | 1229 // accessing the argument through the arguments shadow object. |
1230 void set_is_arguments_access(bool is_arguments_access) { | 1230 void set_is_arguments_access(bool is_arguments_access) { |
1231 is_arguments_access_ = is_arguments_access; | 1231 is_arguments_access_ = is_arguments_access; |
1232 } | 1232 } |
1233 bool is_arguments_access() const { return is_arguments_access_; } | 1233 bool is_arguments_access() const { return is_arguments_access_; } |
1234 | 1234 |
| 1235 ExternalArrayType GetExternalArrayType() const { return array_type_; } |
| 1236 void SetExternalArrayType(ExternalArrayType array_type) { |
| 1237 array_type_ = array_type; |
| 1238 } |
| 1239 |
1235 // Type feedback information. | 1240 // Type feedback information. |
1236 void RecordTypeFeedback(TypeFeedbackOracle* oracle); | 1241 void RecordTypeFeedback(TypeFeedbackOracle* oracle); |
1237 virtual bool IsMonomorphic() { return is_monomorphic_; } | 1242 virtual bool IsMonomorphic() { return is_monomorphic_; } |
1238 virtual ZoneMapList* GetReceiverTypes() { return receiver_types_; } | 1243 virtual ZoneMapList* GetReceiverTypes() { return receiver_types_; } |
1239 virtual bool IsArrayLength() { return is_array_length_; } | 1244 virtual bool IsArrayLength() { return is_array_length_; } |
1240 virtual Handle<Map> GetMonomorphicReceiverType() { | 1245 virtual Handle<Map> GetMonomorphicReceiverType() { |
1241 return monomorphic_receiver_type_; | 1246 return monomorphic_receiver_type_; |
1242 } | 1247 } |
1243 | 1248 |
1244 // Returns a property singleton property access on 'this'. Used | 1249 // Returns a property singleton property access on 'this'. Used |
1245 // during preparsing. | 1250 // during preparsing. |
1246 static Property* this_property() { return &this_property_; } | 1251 static Property* this_property() { return &this_property_; } |
1247 | 1252 |
1248 private: | 1253 private: |
1249 Expression* obj_; | 1254 Expression* obj_; |
1250 Expression* key_; | 1255 Expression* key_; |
1251 int pos_; | 1256 int pos_; |
1252 Type type_; | 1257 Type type_; |
1253 | 1258 |
1254 ZoneMapList* receiver_types_; | 1259 ZoneMapList* receiver_types_; |
1255 bool is_monomorphic_ : 1; | 1260 bool is_monomorphic_ : 1; |
1256 bool is_array_length_ : 1; | 1261 bool is_array_length_ : 1; |
1257 bool is_string_length_ : 1; | 1262 bool is_string_length_ : 1; |
1258 bool is_function_prototype_ : 1; | 1263 bool is_function_prototype_ : 1; |
1259 bool is_arguments_access_ : 1; | 1264 bool is_arguments_access_ : 1; |
1260 Handle<Map> monomorphic_receiver_type_; | 1265 Handle<Map> monomorphic_receiver_type_; |
| 1266 ExternalArrayType array_type_; |
1261 | 1267 |
1262 // Dummy property used during preparsing. | 1268 // Dummy property used during preparsing. |
1263 static Property this_property_; | 1269 static Property this_property_; |
1264 }; | 1270 }; |
1265 | 1271 |
1266 | 1272 |
1267 class Call: public Expression { | 1273 class Call: public Expression { |
1268 public: | 1274 public: |
1269 Call(Expression* expression, ZoneList<Expression*>* arguments, int pos) | 1275 Call(Expression* expression, ZoneList<Expression*>* arguments, int pos) |
1270 : expression_(expression), | 1276 : expression_(expression), |
(...skipping 343 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1614 void mark_block_start() { block_start_ = true; } | 1620 void mark_block_start() { block_start_ = true; } |
1615 void mark_block_end() { block_end_ = true; } | 1621 void mark_block_end() { block_end_ = true; } |
1616 | 1622 |
1617 // Type feedback information. | 1623 // Type feedback information. |
1618 void RecordTypeFeedback(TypeFeedbackOracle* oracle); | 1624 void RecordTypeFeedback(TypeFeedbackOracle* oracle); |
1619 virtual bool IsMonomorphic() { return is_monomorphic_; } | 1625 virtual bool IsMonomorphic() { return is_monomorphic_; } |
1620 virtual ZoneMapList* GetReceiverTypes() { return receiver_types_; } | 1626 virtual ZoneMapList* GetReceiverTypes() { return receiver_types_; } |
1621 virtual Handle<Map> GetMonomorphicReceiverType() { | 1627 virtual Handle<Map> GetMonomorphicReceiverType() { |
1622 return monomorphic_receiver_type_; | 1628 return monomorphic_receiver_type_; |
1623 } | 1629 } |
| 1630 ExternalArrayType GetExternalArrayType() const { return array_type_; } |
| 1631 void SetExternalArrayType(ExternalArrayType array_type) { |
| 1632 array_type_ = array_type; |
| 1633 } |
1624 | 1634 |
1625 // Bailout support. | 1635 // Bailout support. |
1626 int CompoundLoadId() const { return compound_load_id_; } | 1636 int CompoundLoadId() const { return compound_load_id_; } |
1627 int AssignmentId() const { return assignment_id_; } | 1637 int AssignmentId() const { return assignment_id_; } |
1628 | 1638 |
1629 private: | 1639 private: |
1630 Token::Value op_; | 1640 Token::Value op_; |
1631 Expression* target_; | 1641 Expression* target_; |
1632 Expression* value_; | 1642 Expression* value_; |
1633 int pos_; | 1643 int pos_; |
1634 BinaryOperation* binary_operation_; | 1644 BinaryOperation* binary_operation_; |
1635 int compound_load_id_; | 1645 int compound_load_id_; |
1636 int assignment_id_; | 1646 int assignment_id_; |
1637 | 1647 |
1638 bool block_start_; | 1648 bool block_start_; |
1639 bool block_end_; | 1649 bool block_end_; |
1640 | 1650 |
1641 bool is_monomorphic_; | 1651 bool is_monomorphic_; |
1642 ZoneMapList* receiver_types_; | 1652 ZoneMapList* receiver_types_; |
1643 Handle<Map> monomorphic_receiver_type_; | 1653 Handle<Map> monomorphic_receiver_type_; |
| 1654 ExternalArrayType array_type_; |
1644 }; | 1655 }; |
1645 | 1656 |
1646 | 1657 |
1647 class Throw: public Expression { | 1658 class Throw: public Expression { |
1648 public: | 1659 public: |
1649 Throw(Expression* exception, int pos) | 1660 Throw(Expression* exception, int pos) |
1650 : exception_(exception), pos_(pos) {} | 1661 : exception_(exception), pos_(pos) {} |
1651 | 1662 |
1652 DECLARE_NODE_TYPE(Throw) | 1663 DECLARE_NODE_TYPE(Throw) |
1653 | 1664 |
(...skipping 514 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2168 AST_NODE_LIST(DEF_VISIT) | 2179 AST_NODE_LIST(DEF_VISIT) |
2169 #undef DEF_VISIT | 2180 #undef DEF_VISIT |
2170 | 2181 |
2171 private: | 2182 private: |
2172 bool stack_overflow_; | 2183 bool stack_overflow_; |
2173 }; | 2184 }; |
2174 | 2185 |
2175 } } // namespace v8::internal | 2186 } } // namespace v8::internal |
2176 | 2187 |
2177 #endif // V8_AST_H_ | 2188 #endif // V8_AST_H_ |
OLD | NEW |