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