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 950 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
961 | 961 |
962 int position() const { return position_; } | 962 int position() const { return position_; } |
963 void set_position(int pos) { position_ = pos; } | 963 void set_position(int pos) { position_ = pos; } |
964 | 964 |
965 BailoutId EntryId() const { return entry_id_; } | 965 BailoutId EntryId() const { return entry_id_; } |
966 | 966 |
967 // Type feedback information. | 967 // Type feedback information. |
968 TypeFeedbackId CompareId() { return compare_id_; } | 968 TypeFeedbackId CompareId() { return compare_id_; } |
969 void RecordTypeFeedback(TypeFeedbackOracle* oracle); | 969 void RecordTypeFeedback(TypeFeedbackOracle* oracle); |
970 bool IsSmiCompare() { return compare_type_ == SMI_ONLY; } | 970 bool IsSmiCompare() { return compare_type_ == SMI_ONLY; } |
971 bool IsSymbolCompare() { return compare_type_ == SYMBOL_ONLY; } | 971 bool IsNameCompare() { return compare_type_ == NAME_ONLY; } |
972 bool IsStringCompare() { return compare_type_ == STRING_ONLY; } | 972 bool IsStringCompare() { return compare_type_ == STRING_ONLY; } |
973 bool IsObjectCompare() { return compare_type_ == OBJECT_ONLY; } | 973 bool IsObjectCompare() { return compare_type_ == OBJECT_ONLY; } |
974 | 974 |
975 private: | 975 private: |
976 Expression* label_; | 976 Expression* label_; |
977 Label body_target_; | 977 Label body_target_; |
978 ZoneList<Statement*>* statements_; | 978 ZoneList<Statement*>* statements_; |
979 int position_; | 979 int position_; |
980 enum CompareTypeFeedback { | 980 enum CompareTypeFeedback { |
981 NONE, | 981 NONE, |
982 SMI_ONLY, | 982 SMI_ONLY, |
983 SYMBOL_ONLY, | 983 NAME_ONLY, |
984 STRING_ONLY, | 984 STRING_ONLY, |
985 OBJECT_ONLY | 985 OBJECT_ONLY |
986 }; | 986 }; |
987 CompareTypeFeedback compare_type_; | 987 CompareTypeFeedback compare_type_; |
988 const TypeFeedbackId compare_id_; | 988 const TypeFeedbackId compare_id_; |
989 const BailoutId entry_id_; | 989 const BailoutId entry_id_; |
990 }; | 990 }; |
991 | 991 |
992 | 992 |
993 class SwitchStatement: public BreakableStatement { | 993 class SwitchStatement: public BreakableStatement { |
(...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1164 protected: | 1164 protected: |
1165 EmptyStatement() {} | 1165 EmptyStatement() {} |
1166 }; | 1166 }; |
1167 | 1167 |
1168 | 1168 |
1169 class Literal: public Expression { | 1169 class Literal: public Expression { |
1170 public: | 1170 public: |
1171 DECLARE_NODE_TYPE(Literal) | 1171 DECLARE_NODE_TYPE(Literal) |
1172 | 1172 |
1173 virtual bool IsPropertyName() { | 1173 virtual bool IsPropertyName() { |
1174 if (handle_->IsSymbol()) { | 1174 if (handle_->IsInternalizedString()) { |
1175 uint32_t ignored; | 1175 uint32_t ignored; |
1176 return !String::cast(*handle_)->AsArrayIndex(&ignored); | 1176 return !String::cast(*handle_)->AsArrayIndex(&ignored); |
1177 } | 1177 } |
1178 return false; | 1178 return false; |
1179 } | 1179 } |
1180 | 1180 |
1181 Handle<String> AsPropertyName() { | 1181 Handle<String> AsPropertyName() { |
1182 ASSERT(IsPropertyName()); | 1182 ASSERT(IsPropertyName()); |
1183 return Handle<String>::cast(handle_); | 1183 return Handle<String>::cast(handle_); |
1184 } | 1184 } |
(...skipping 1747 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2932 private: | 2932 private: |
2933 Isolate* isolate_; | 2933 Isolate* isolate_; |
2934 Zone* zone_; | 2934 Zone* zone_; |
2935 Visitor visitor_; | 2935 Visitor visitor_; |
2936 }; | 2936 }; |
2937 | 2937 |
2938 | 2938 |
2939 } } // namespace v8::internal | 2939 } } // namespace v8::internal |
2940 | 2940 |
2941 #endif // V8_AST_H_ | 2941 #endif // V8_AST_H_ |
OLD | NEW |