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 1307 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1318 }; | 1318 }; |
1319 | 1319 |
1320 Property(Literal* key, Expression* value, Isolate* isolate); | 1320 Property(Literal* key, Expression* value, Isolate* isolate); |
1321 | 1321 |
1322 Literal* key() { return key_; } | 1322 Literal* key() { return key_; } |
1323 Expression* value() { return value_; } | 1323 Expression* value() { return value_; } |
1324 Kind kind() { return kind_; } | 1324 Kind kind() { return kind_; } |
1325 | 1325 |
1326 // Type feedback information. | 1326 // Type feedback information. |
1327 void RecordTypeFeedback(TypeFeedbackOracle* oracle); | 1327 void RecordTypeFeedback(TypeFeedbackOracle* oracle); |
| 1328 bool IsMonomorphic() { return !receiver_type_.is_null(); } |
1328 Handle<Map> GetReceiverType() { return receiver_type_; } | 1329 Handle<Map> GetReceiverType() { return receiver_type_; } |
1329 | 1330 |
1330 bool IsCompileTimeValue(); | 1331 bool IsCompileTimeValue(); |
1331 | 1332 |
1332 void set_emit_store(bool emit_store); | 1333 void set_emit_store(bool emit_store); |
1333 bool emit_store(); | 1334 bool emit_store(); |
1334 | 1335 |
1335 protected: | 1336 protected: |
1336 template<class> friend class AstNodeFactory; | 1337 template<class> friend class AstNodeFactory; |
1337 | 1338 |
(...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1521 virtual int position() const { return pos_; } | 1522 virtual int position() const { return pos_; } |
1522 | 1523 |
1523 bool IsStringLength() const { return is_string_length_; } | 1524 bool IsStringLength() const { return is_string_length_; } |
1524 bool IsStringAccess() const { return is_string_access_; } | 1525 bool IsStringAccess() const { return is_string_access_; } |
1525 bool IsFunctionPrototype() const { return is_function_prototype_; } | 1526 bool IsFunctionPrototype() const { return is_function_prototype_; } |
1526 | 1527 |
1527 // Type feedback information. | 1528 // Type feedback information. |
1528 void RecordTypeFeedback(TypeFeedbackOracle* oracle, Zone* zone); | 1529 void RecordTypeFeedback(TypeFeedbackOracle* oracle, Zone* zone); |
1529 virtual bool IsMonomorphic() { return is_monomorphic_; } | 1530 virtual bool IsMonomorphic() { return is_monomorphic_; } |
1530 virtual SmallMapList* GetReceiverTypes() { return &receiver_types_; } | 1531 virtual SmallMapList* GetReceiverTypes() { return &receiver_types_; } |
1531 | |
1532 Handle<Map> GetReceiverType() { | |
1533 return IsMonomorphic() ? GetReceiverTypes()->first() : Handle<Map>(); | |
1534 } | |
1535 | |
1536 bool IsArrayLength() { return is_array_length_; } | 1532 bool IsArrayLength() { return is_array_length_; } |
1537 bool IsUninitialized() { return is_uninitialized_; } | 1533 bool IsUninitialized() { return is_uninitialized_; } |
1538 | 1534 |
1539 protected: | 1535 protected: |
1540 template<class> friend class AstNodeFactory; | 1536 template<class> friend class AstNodeFactory; |
1541 | 1537 |
1542 Property(Isolate* isolate, | 1538 Property(Isolate* isolate, |
1543 Expression* obj, | 1539 Expression* obj, |
1544 Expression* key, | 1540 Expression* key, |
1545 int pos) | 1541 int pos) |
(...skipping 1442 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2988 private: | 2984 private: |
2989 Isolate* isolate_; | 2985 Isolate* isolate_; |
2990 Zone* zone_; | 2986 Zone* zone_; |
2991 Visitor visitor_; | 2987 Visitor visitor_; |
2992 }; | 2988 }; |
2993 | 2989 |
2994 | 2990 |
2995 } } // namespace v8::internal | 2991 } } // namespace v8::internal |
2996 | 2992 |
2997 #endif // V8_AST_H_ | 2993 #endif // V8_AST_H_ |
OLD | NEW |