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 is_monomorphic_(false), | 1208 is_monomorphic_(false), |
1209 receiver_types_(NULL), | 1209 receiver_types_(NULL), |
1210 is_array_length_(false), | 1210 is_array_length_(false), |
| 1211 is_function_prototype_(false), |
1211 is_arguments_access_(false) { } | 1212 is_arguments_access_(false) { } |
1212 | 1213 |
1213 DECLARE_NODE_TYPE(Property) | 1214 DECLARE_NODE_TYPE(Property) |
1214 | 1215 |
1215 virtual bool IsValidLeftHandSide() { return true; } | 1216 virtual bool IsValidLeftHandSide() { return true; } |
1216 virtual bool IsInlineable() const; | 1217 virtual bool IsInlineable() const; |
1217 | 1218 |
1218 Expression* obj() const { return obj_; } | 1219 Expression* obj() const { return obj_; } |
1219 Expression* key() const { return key_; } | 1220 Expression* key() const { return key_; } |
1220 int position() const { return pos_; } | 1221 int position() const { return pos_; } |
1221 bool is_synthetic() const { return type_ == SYNTHETIC; } | 1222 bool is_synthetic() const { return type_ == SYNTHETIC; } |
1222 | 1223 |
| 1224 bool IsFunctionPrototype() const { return is_function_prototype_; } |
| 1225 |
1223 // Marks that this is actually an argument rewritten to a keyed property | 1226 // Marks that this is actually an argument rewritten to a keyed property |
1224 // accessing the argument through the arguments shadow object. | 1227 // accessing the argument through the arguments shadow object. |
1225 void set_is_arguments_access(bool is_arguments_access) { | 1228 void set_is_arguments_access(bool is_arguments_access) { |
1226 is_arguments_access_ = is_arguments_access; | 1229 is_arguments_access_ = is_arguments_access; |
1227 } | 1230 } |
1228 bool is_arguments_access() const { return is_arguments_access_; } | 1231 bool is_arguments_access() const { return is_arguments_access_; } |
1229 | 1232 |
1230 // Type feedback information. | 1233 // Type feedback information. |
1231 void RecordTypeFeedback(TypeFeedbackOracle* oracle); | 1234 void RecordTypeFeedback(TypeFeedbackOracle* oracle); |
1232 virtual bool IsMonomorphic() { return is_monomorphic_; } | 1235 virtual bool IsMonomorphic() { return is_monomorphic_; } |
1233 virtual ZoneMapList* GetReceiverTypes() { return receiver_types_; } | 1236 virtual ZoneMapList* GetReceiverTypes() { return receiver_types_; } |
1234 virtual bool IsArrayLength() { return is_array_length_; } | 1237 virtual bool IsArrayLength() { return is_array_length_; } |
1235 virtual Handle<Map> GetMonomorphicReceiverType() { | 1238 virtual Handle<Map> GetMonomorphicReceiverType() { |
1236 return monomorphic_receiver_type_; | 1239 return monomorphic_receiver_type_; |
1237 } | 1240 } |
1238 | 1241 |
1239 // Returns a property singleton property access on 'this'. Used | 1242 // Returns a property singleton property access on 'this'. Used |
1240 // during preparsing. | 1243 // during preparsing. |
1241 static Property* this_property() { return &this_property_; } | 1244 static Property* this_property() { return &this_property_; } |
1242 | 1245 |
1243 private: | 1246 private: |
1244 Expression* obj_; | 1247 Expression* obj_; |
1245 Expression* key_; | 1248 Expression* key_; |
1246 int pos_; | 1249 int pos_; |
1247 Type type_; | 1250 Type type_; |
1248 | 1251 |
1249 bool is_monomorphic_; | 1252 bool is_monomorphic_; |
1250 ZoneMapList* receiver_types_; | 1253 ZoneMapList* receiver_types_; |
1251 bool is_array_length_; | 1254 bool is_array_length_; |
| 1255 bool is_function_prototype_; |
1252 bool is_arguments_access_; | 1256 bool is_arguments_access_; |
1253 Handle<Map> monomorphic_receiver_type_; | 1257 Handle<Map> monomorphic_receiver_type_; |
1254 | 1258 |
1255 // Dummy property used during preparsing. | 1259 // Dummy property used during preparsing. |
1256 static Property this_property_; | 1260 static Property this_property_; |
1257 }; | 1261 }; |
1258 | 1262 |
1259 | 1263 |
1260 class Call: public Expression { | 1264 class Call: public Expression { |
1261 public: | 1265 public: |
(...skipping 898 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2160 AST_NODE_LIST(DEF_VISIT) | 2164 AST_NODE_LIST(DEF_VISIT) |
2161 #undef DEF_VISIT | 2165 #undef DEF_VISIT |
2162 | 2166 |
2163 private: | 2167 private: |
2164 bool stack_overflow_; | 2168 bool stack_overflow_; |
2165 }; | 2169 }; |
2166 | 2170 |
2167 } } // namespace v8::internal | 2171 } } // namespace v8::internal |
2168 | 2172 |
2169 #endif // V8_AST_H_ | 2173 #endif // V8_AST_H_ |
OLD | NEW |