| 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 906 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 917 | 917 |
| 918 class ForInStatement V8_FINAL : public ForEachStatement { | 918 class ForInStatement V8_FINAL : public ForEachStatement { |
| 919 public: | 919 public: |
| 920 DECLARE_NODE_TYPE(ForInStatement) | 920 DECLARE_NODE_TYPE(ForInStatement) |
| 921 | 921 |
| 922 Expression* enumerable() const { | 922 Expression* enumerable() const { |
| 923 return subject(); | 923 return subject(); |
| 924 } | 924 } |
| 925 | 925 |
| 926 TypeFeedbackId ForInFeedbackId() const { return reuse(PrepareId()); } | 926 TypeFeedbackId ForInFeedbackId() const { return reuse(PrepareId()); } |
| 927 void RecordTypeFeedback(TypeFeedbackOracle* oracle); | |
| 928 enum ForInType { FAST_FOR_IN, SLOW_FOR_IN }; | 927 enum ForInType { FAST_FOR_IN, SLOW_FOR_IN }; |
| 929 ForInType for_in_type() const { return for_in_type_; } | 928 ForInType for_in_type() const { return for_in_type_; } |
| 929 void set_for_in_type(ForInType type) { for_in_type_ = type; } |
| 930 | 930 |
| 931 BailoutId BodyId() const { return body_id_; } | 931 BailoutId BodyId() const { return body_id_; } |
| 932 BailoutId PrepareId() const { return prepare_id_; } | 932 BailoutId PrepareId() const { return prepare_id_; } |
| 933 virtual BailoutId ContinueId() const V8_OVERRIDE { return EntryId(); } | 933 virtual BailoutId ContinueId() const V8_OVERRIDE { return EntryId(); } |
| 934 virtual BailoutId StackCheckId() const V8_OVERRIDE { return body_id_; } | 934 virtual BailoutId StackCheckId() const V8_OVERRIDE { return body_id_; } |
| 935 | 935 |
| 936 protected: | 936 protected: |
| 937 ForInStatement(Isolate* isolate, ZoneStringList* labels, int pos) | 937 ForInStatement(Isolate* isolate, ZoneStringList* labels, int pos) |
| 938 : ForEachStatement(isolate, labels, pos), | 938 : ForEachStatement(isolate, labels, pos), |
| 939 for_in_type_(SLOW_FOR_IN), | 939 for_in_type_(SLOW_FOR_IN), |
| (...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1115 CHECK(!is_default()); | 1115 CHECK(!is_default()); |
| 1116 return label_; | 1116 return label_; |
| 1117 } | 1117 } |
| 1118 Label* body_target() { return &body_target_; } | 1118 Label* body_target() { return &body_target_; } |
| 1119 ZoneList<Statement*>* statements() const { return statements_; } | 1119 ZoneList<Statement*>* statements() const { return statements_; } |
| 1120 | 1120 |
| 1121 BailoutId EntryId() const { return entry_id_; } | 1121 BailoutId EntryId() const { return entry_id_; } |
| 1122 | 1122 |
| 1123 // Type feedback information. | 1123 // Type feedback information. |
| 1124 TypeFeedbackId CompareId() { return compare_id_; } | 1124 TypeFeedbackId CompareId() { return compare_id_; } |
| 1125 void RecordTypeFeedback(TypeFeedbackOracle* oracle); | |
| 1126 Handle<Type> compare_type() { return compare_type_; } | 1125 Handle<Type> compare_type() { return compare_type_; } |
| 1126 void set_compare_type(Handle<Type> type) { compare_type_ = type; } |
| 1127 | 1127 |
| 1128 private: | 1128 private: |
| 1129 CaseClause(Isolate* isolate, | 1129 CaseClause(Isolate* isolate, |
| 1130 Expression* label, | 1130 Expression* label, |
| 1131 ZoneList<Statement*>* statements, | 1131 ZoneList<Statement*>* statements, |
| 1132 int pos); | 1132 int pos); |
| 1133 | 1133 |
| 1134 Expression* label_; | 1134 Expression* label_; |
| 1135 Label body_target_; | 1135 Label body_target_; |
| 1136 ZoneList<Statement*>* statements_; | 1136 ZoneList<Statement*>* statements_; |
| (...skipping 547 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1684 | 1684 |
| 1685 Expression* obj() const { return obj_; } | 1685 Expression* obj() const { return obj_; } |
| 1686 Expression* key() const { return key_; } | 1686 Expression* key() const { return key_; } |
| 1687 | 1687 |
| 1688 BailoutId LoadId() const { return load_id_; } | 1688 BailoutId LoadId() const { return load_id_; } |
| 1689 | 1689 |
| 1690 bool IsStringAccess() const { return is_string_access_; } | 1690 bool IsStringAccess() const { return is_string_access_; } |
| 1691 bool IsFunctionPrototype() const { return is_function_prototype_; } | 1691 bool IsFunctionPrototype() const { return is_function_prototype_; } |
| 1692 | 1692 |
| 1693 // Type feedback information. | 1693 // Type feedback information. |
| 1694 void RecordTypeFeedback(TypeFeedbackOracle* oracle, Zone* zone); | |
| 1695 virtual bool IsMonomorphic() V8_OVERRIDE { return is_monomorphic_; } | 1694 virtual bool IsMonomorphic() V8_OVERRIDE { return is_monomorphic_; } |
| 1696 virtual SmallMapList* GetReceiverTypes() V8_OVERRIDE { | 1695 virtual SmallMapList* GetReceiverTypes() V8_OVERRIDE { |
| 1697 return &receiver_types_; | 1696 return &receiver_types_; |
| 1698 } | 1697 } |
| 1699 virtual KeyedAccessStoreMode GetStoreMode() V8_OVERRIDE { | 1698 virtual KeyedAccessStoreMode GetStoreMode() V8_OVERRIDE { |
| 1700 return STANDARD_STORE; | 1699 return STANDARD_STORE; |
| 1701 } | 1700 } |
| 1702 bool IsUninitialized() { return is_uninitialized_; } | 1701 bool IsUninitialized() { return is_uninitialized_; } |
| 1703 bool IsPreMonomorphic() { return is_pre_monomorphic_; } | 1702 bool IsPreMonomorphic() { return is_pre_monomorphic_; } |
| 1704 bool HasNoTypeInformation() { | 1703 bool HasNoTypeInformation() { |
| 1705 return is_uninitialized_ || is_pre_monomorphic_; | 1704 return is_uninitialized_ || is_pre_monomorphic_; |
| 1706 } | 1705 } |
| 1706 void set_is_uninitialized(bool b) { is_uninitialized_ = b; } |
| 1707 void set_is_monomorphic(bool b) { is_monomorphic_ = b; } |
| 1708 void set_is_pre_monomorphic(bool b) { is_pre_monomorphic_ = b; } |
| 1709 void set_is_string_access(bool b) { is_string_access_ = b; } |
| 1710 void set_is_function_prototype(bool b) { is_function_prototype_ = b; } |
| 1711 |
| 1707 TypeFeedbackId PropertyFeedbackId() { return reuse(id()); } | 1712 TypeFeedbackId PropertyFeedbackId() { return reuse(id()); } |
| 1708 | 1713 |
| 1709 protected: | 1714 protected: |
| 1710 Property(Isolate* isolate, | 1715 Property(Isolate* isolate, |
| 1711 Expression* obj, | 1716 Expression* obj, |
| 1712 Expression* key, | 1717 Expression* key, |
| 1713 int pos) | 1718 int pos) |
| 1714 : Expression(isolate, pos), | 1719 : Expression(isolate, pos), |
| 1715 obj_(obj), | 1720 obj_(obj), |
| 1716 key_(key), | 1721 key_(key), |
| (...skipping 272 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1989 bool is_prefix() const { return is_prefix_; } | 1994 bool is_prefix() const { return is_prefix_; } |
| 1990 bool is_postfix() const { return !is_prefix_; } | 1995 bool is_postfix() const { return !is_prefix_; } |
| 1991 | 1996 |
| 1992 Token::Value op() const { return op_; } | 1997 Token::Value op() const { return op_; } |
| 1993 Token::Value binary_op() { | 1998 Token::Value binary_op() { |
| 1994 return (op() == Token::INC) ? Token::ADD : Token::SUB; | 1999 return (op() == Token::INC) ? Token::ADD : Token::SUB; |
| 1995 } | 2000 } |
| 1996 | 2001 |
| 1997 Expression* expression() const { return expression_; } | 2002 Expression* expression() const { return expression_; } |
| 1998 | 2003 |
| 1999 void RecordTypeFeedback(TypeFeedbackOracle* oracle, Zone* zone); | |
| 2000 virtual bool IsMonomorphic() V8_OVERRIDE { return is_monomorphic_; } | 2004 virtual bool IsMonomorphic() V8_OVERRIDE { return is_monomorphic_; } |
| 2001 virtual SmallMapList* GetReceiverTypes() V8_OVERRIDE { | 2005 virtual SmallMapList* GetReceiverTypes() V8_OVERRIDE { |
| 2002 return &receiver_types_; | 2006 return &receiver_types_; |
| 2003 } | 2007 } |
| 2004 virtual KeyedAccessStoreMode GetStoreMode() V8_OVERRIDE { | 2008 virtual KeyedAccessStoreMode GetStoreMode() V8_OVERRIDE { |
| 2005 return store_mode_; | 2009 return store_mode_; |
| 2006 } | 2010 } |
| 2007 Handle<Type> type() const { return type_; } | 2011 Handle<Type> type() const { return type_; } |
| 2012 void set_is_monomorphic(bool b) { is_monomorphic_ = b; } |
| 2013 void set_store_mode(KeyedAccessStoreMode mode) { store_mode_ = mode; } |
| 2014 void set_type(Handle<Type> type) { type_ = type; } |
| 2008 | 2015 |
| 2009 BailoutId AssignmentId() const { return assignment_id_; } | 2016 BailoutId AssignmentId() const { return assignment_id_; } |
| 2010 | 2017 |
| 2011 TypeFeedbackId CountBinOpFeedbackId() const { return count_id_; } | 2018 TypeFeedbackId CountBinOpFeedbackId() const { return count_id_; } |
| 2012 TypeFeedbackId CountStoreFeedbackId() const { return reuse(id()); } | 2019 TypeFeedbackId CountStoreFeedbackId() const { return reuse(id()); } |
| 2013 | 2020 |
| 2014 protected: | 2021 protected: |
| 2015 CountOperation(Isolate* isolate, | 2022 CountOperation(Isolate* isolate, |
| 2016 Token::Value op, | 2023 Token::Value op, |
| 2017 bool is_prefix, | 2024 bool is_prefix, |
| (...skipping 1273 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3291 private: | 3298 private: |
| 3292 Isolate* isolate_; | 3299 Isolate* isolate_; |
| 3293 Zone* zone_; | 3300 Zone* zone_; |
| 3294 Visitor visitor_; | 3301 Visitor visitor_; |
| 3295 }; | 3302 }; |
| 3296 | 3303 |
| 3297 | 3304 |
| 3298 } } // namespace v8::internal | 3305 } } // namespace v8::internal |
| 3299 | 3306 |
| 3300 #endif // V8_AST_H_ | 3307 #endif // V8_AST_H_ |
| OLD | NEW |