OLD | NEW |
---|---|
1 // Copyright 2010 the V8 project authors. All rights reserved. | 1 // Copyright 2010 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 1190 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1201 // of the resolved Reference. | 1201 // of the resolved Reference. |
1202 enum Type { NORMAL, SYNTHETIC }; | 1202 enum Type { NORMAL, SYNTHETIC }; |
1203 Property(Expression* obj, Expression* key, int pos, Type type = NORMAL) | 1203 Property(Expression* obj, Expression* key, int pos, Type type = NORMAL) |
1204 : obj_(obj), | 1204 : obj_(obj), |
1205 key_(key), | 1205 key_(key), |
1206 pos_(pos), | 1206 pos_(pos), |
1207 type_(type), | 1207 type_(type), |
1208 receiver_types_(NULL), | 1208 receiver_types_(NULL), |
1209 is_monomorphic_(false), | 1209 is_monomorphic_(false), |
1210 is_array_length_(false), | 1210 is_array_length_(false), |
1211 has_pixel_array_elements_(false), | |
Kevin Millikin (Chromium)
2011/02/07 12:39:08
This field seems to be unused.
danno
2011/02/08 09:25:57
Done.
| |
1211 is_string_length_(false), | 1212 is_string_length_(false), |
1212 is_function_prototype_(false), | 1213 is_function_prototype_(false), |
1213 is_arguments_access_(false) { } | 1214 is_arguments_access_(false) { } |
1214 | 1215 |
1215 DECLARE_NODE_TYPE(Property) | 1216 DECLARE_NODE_TYPE(Property) |
1216 | 1217 |
1217 virtual bool IsValidLeftHandSide() { return true; } | 1218 virtual bool IsValidLeftHandSide() { return true; } |
1218 virtual bool IsInlineable() const; | 1219 virtual bool IsInlineable() const; |
1219 | 1220 |
1220 Expression* obj() const { return obj_; } | 1221 Expression* obj() const { return obj_; } |
1221 Expression* key() const { return key_; } | 1222 Expression* key() const { return key_; } |
1222 int position() const { return pos_; } | 1223 int position() const { return pos_; } |
1223 bool is_synthetic() const { return type_ == SYNTHETIC; } | 1224 bool is_synthetic() const { return type_ == SYNTHETIC; } |
1224 | 1225 |
1225 bool IsStringLength() const { return is_string_length_; } | 1226 bool IsStringLength() const { return is_string_length_; } |
1226 bool IsFunctionPrototype() const { return is_function_prototype_; } | 1227 bool IsFunctionPrototype() const { return is_function_prototype_; } |
1227 | 1228 |
1228 // Marks that this is actually an argument rewritten to a keyed property | 1229 // Marks that this is actually an argument rewritten to a keyed property |
1229 // accessing the argument through the arguments shadow object. | 1230 // accessing the argument through the arguments shadow object. |
1230 void set_is_arguments_access(bool is_arguments_access) { | 1231 void set_is_arguments_access(bool is_arguments_access) { |
1231 is_arguments_access_ = is_arguments_access; | 1232 is_arguments_access_ = is_arguments_access; |
1232 } | 1233 } |
1233 bool is_arguments_access() const { return is_arguments_access_; } | 1234 bool is_arguments_access() const { return is_arguments_access_; } |
1234 | 1235 |
1235 // Type feedback information. | 1236 // Type feedback information. |
1236 void RecordTypeFeedback(TypeFeedbackOracle* oracle); | 1237 void RecordTypeFeedback(TypeFeedbackOracle* oracle); |
1237 virtual bool IsMonomorphic() { return is_monomorphic_; } | 1238 virtual bool IsMonomorphic() { return is_monomorphic_; } |
1238 virtual ZoneMapList* GetReceiverTypes() { return receiver_types_; } | 1239 virtual ZoneMapList* GetReceiverTypes() { return receiver_types_; } |
1239 virtual bool IsArrayLength() { return is_array_length_; } | 1240 virtual bool IsArrayLength() { return is_array_length_; } |
1241 virtual bool HasPixelArrayElements() { return has_pixel_array_elements_; } | |
1240 virtual Handle<Map> GetMonomorphicReceiverType() { | 1242 virtual Handle<Map> GetMonomorphicReceiverType() { |
1241 return monomorphic_receiver_type_; | 1243 return monomorphic_receiver_type_; |
1242 } | 1244 } |
1243 | 1245 |
1244 // Returns a property singleton property access on 'this'. Used | 1246 // Returns a property singleton property access on 'this'. Used |
1245 // during preparsing. | 1247 // during preparsing. |
1246 static Property* this_property() { return &this_property_; } | 1248 static Property* this_property() { return &this_property_; } |
1247 | 1249 |
1248 private: | 1250 private: |
1249 Expression* obj_; | 1251 Expression* obj_; |
1250 Expression* key_; | 1252 Expression* key_; |
1251 int pos_; | 1253 int pos_; |
1252 Type type_; | 1254 Type type_; |
1253 | 1255 |
1254 ZoneMapList* receiver_types_; | 1256 ZoneMapList* receiver_types_; |
1255 bool is_monomorphic_ : 1; | 1257 bool is_monomorphic_ : 1; |
1256 bool is_array_length_ : 1; | 1258 bool is_array_length_ : 1; |
1259 bool has_pixel_array_elements_ : 1; | |
1257 bool is_string_length_ : 1; | 1260 bool is_string_length_ : 1; |
1258 bool is_function_prototype_ : 1; | 1261 bool is_function_prototype_ : 1; |
1259 bool is_arguments_access_ : 1; | 1262 bool is_arguments_access_ : 1; |
1260 Handle<Map> monomorphic_receiver_type_; | 1263 Handle<Map> monomorphic_receiver_type_; |
1261 | 1264 |
1262 // Dummy property used during preparsing. | 1265 // Dummy property used during preparsing. |
1263 static Property this_property_; | 1266 static Property this_property_; |
1264 }; | 1267 }; |
1265 | 1268 |
1266 | 1269 |
(...skipping 901 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2168 AST_NODE_LIST(DEF_VISIT) | 2171 AST_NODE_LIST(DEF_VISIT) |
2169 #undef DEF_VISIT | 2172 #undef DEF_VISIT |
2170 | 2173 |
2171 private: | 2174 private: |
2172 bool stack_overflow_; | 2175 bool stack_overflow_; |
2173 }; | 2176 }; |
2174 | 2177 |
2175 } } // namespace v8::internal | 2178 } } // namespace v8::internal |
2176 | 2179 |
2177 #endif // V8_AST_H_ | 2180 #endif // V8_AST_H_ |
OLD | NEW |