OLD | NEW |
1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 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 708 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
719 | 719 |
720 int position() const { return position_; } | 720 int position() const { return position_; } |
721 void set_position(int pos) { position_ = pos; } | 721 void set_position(int pos) { position_ = pos; } |
722 | 722 |
723 int EntryId() { return entry_id_; } | 723 int EntryId() { return entry_id_; } |
724 int CompareId() { return compare_id_; } | 724 int CompareId() { return compare_id_; } |
725 | 725 |
726 // Type feedback information. | 726 // Type feedback information. |
727 void RecordTypeFeedback(TypeFeedbackOracle* oracle); | 727 void RecordTypeFeedback(TypeFeedbackOracle* oracle); |
728 bool IsSmiCompare() { return compare_type_ == SMI_ONLY; } | 728 bool IsSmiCompare() { return compare_type_ == SMI_ONLY; } |
| 729 bool IsSymbolCompare() { return compare_type_ == SYMBOL_ONLY; } |
| 730 bool IsStringCompare() { return compare_type_ == STRING_ONLY; } |
729 bool IsObjectCompare() { return compare_type_ == OBJECT_ONLY; } | 731 bool IsObjectCompare() { return compare_type_ == OBJECT_ONLY; } |
730 | 732 |
731 private: | 733 private: |
732 Expression* label_; | 734 Expression* label_; |
733 Label body_target_; | 735 Label body_target_; |
734 ZoneList<Statement*>* statements_; | 736 ZoneList<Statement*>* statements_; |
735 int position_; | 737 int position_; |
736 enum CompareTypeFeedback { NONE, SMI_ONLY, OBJECT_ONLY }; | 738 enum CompareTypeFeedback { |
| 739 NONE, |
| 740 SMI_ONLY, |
| 741 SYMBOL_ONLY, |
| 742 STRING_ONLY, |
| 743 OBJECT_ONLY |
| 744 }; |
737 CompareTypeFeedback compare_type_; | 745 CompareTypeFeedback compare_type_; |
738 int compare_id_; | 746 int compare_id_; |
739 int entry_id_; | 747 int entry_id_; |
740 }; | 748 }; |
741 | 749 |
742 | 750 |
743 class SwitchStatement: public BreakableStatement { | 751 class SwitchStatement: public BreakableStatement { |
744 public: | 752 public: |
745 SwitchStatement(Isolate* isolate, ZoneStringList* labels) | 753 SwitchStatement(Isolate* isolate, ZoneStringList* labels) |
746 : BreakableStatement(isolate, labels, TARGET_FOR_ANONYMOUS), | 754 : BreakableStatement(isolate, labels, TARGET_FOR_ANONYMOUS), |
(...skipping 1369 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2116 class RegExpEmpty: public RegExpTree { | 2124 class RegExpEmpty: public RegExpTree { |
2117 public: | 2125 public: |
2118 RegExpEmpty() { } | 2126 RegExpEmpty() { } |
2119 virtual void* Accept(RegExpVisitor* visitor, void* data); | 2127 virtual void* Accept(RegExpVisitor* visitor, void* data); |
2120 virtual RegExpNode* ToNode(RegExpCompiler* compiler, | 2128 virtual RegExpNode* ToNode(RegExpCompiler* compiler, |
2121 RegExpNode* on_success); | 2129 RegExpNode* on_success); |
2122 virtual RegExpEmpty* AsEmpty(); | 2130 virtual RegExpEmpty* AsEmpty(); |
2123 virtual bool IsEmpty(); | 2131 virtual bool IsEmpty(); |
2124 virtual int min_match() { return 0; } | 2132 virtual int min_match() { return 0; } |
2125 virtual int max_match() { return 0; } | 2133 virtual int max_match() { return 0; } |
2126 static RegExpEmpty* GetInstance() { return &kInstance; } | 2134 static RegExpEmpty* GetInstance() { |
2127 private: | 2135 static RegExpEmpty* instance = ::new RegExpEmpty(); |
2128 static RegExpEmpty kInstance; | 2136 return instance; |
| 2137 } |
2129 }; | 2138 }; |
2130 | 2139 |
2131 | 2140 |
2132 // ---------------------------------------------------------------------------- | 2141 // ---------------------------------------------------------------------------- |
2133 // Basic visitor | 2142 // Basic visitor |
2134 // - leaf node visitors are abstract. | 2143 // - leaf node visitors are abstract. |
2135 | 2144 |
2136 class AstVisitor BASE_EMBEDDED { | 2145 class AstVisitor BASE_EMBEDDED { |
2137 public: | 2146 public: |
2138 AstVisitor() : isolate_(Isolate::Current()), stack_overflow_(false) { } | 2147 AstVisitor() : isolate_(Isolate::Current()), stack_overflow_(false) { } |
(...skipping 28 matching lines...) Expand all Loading... |
2167 | 2176 |
2168 private: | 2177 private: |
2169 Isolate* isolate_; | 2178 Isolate* isolate_; |
2170 bool stack_overflow_; | 2179 bool stack_overflow_; |
2171 }; | 2180 }; |
2172 | 2181 |
2173 | 2182 |
2174 } } // namespace v8::internal | 2183 } } // namespace v8::internal |
2175 | 2184 |
2176 #endif // V8_AST_H_ | 2185 #endif // V8_AST_H_ |
OLD | NEW |