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 223 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
234 class ObjectLiteralProperty; | 234 class ObjectLiteralProperty; |
235 | 235 |
236 | 236 |
237 class TypeFeedbackOracle: public ZoneObject { | 237 class TypeFeedbackOracle: public ZoneObject { |
238 public: | 238 public: |
239 TypeFeedbackOracle(Handle<Code> code, | 239 TypeFeedbackOracle(Handle<Code> code, |
240 Handle<Context> native_context, | 240 Handle<Context> native_context, |
241 Isolate* isolate, | 241 Isolate* isolate, |
242 Zone* zone); | 242 Zone* zone); |
243 | 243 |
244 bool LoadIsMonomorphicNormal(Property* expr); | 244 bool LoadIsMonomorphicNormal(TypeFeedbackId id); |
245 bool LoadIsUninitialized(Property* expr); | 245 bool LoadIsUninitialized(TypeFeedbackId id); |
246 bool LoadIsPreMonomorphic(Property* expr); | 246 bool LoadIsPreMonomorphic(TypeFeedbackId id); |
247 bool LoadIsPolymorphic(Property* expr); | 247 bool LoadIsPolymorphic(TypeFeedbackId id); |
248 bool StoreIsUninitialized(TypeFeedbackId ast_id); | 248 bool StoreIsUninitialized(TypeFeedbackId ast_id); |
249 bool StoreIsMonomorphicNormal(TypeFeedbackId ast_id); | 249 bool StoreIsMonomorphicNormal(TypeFeedbackId ast_id); |
250 bool StoreIsPreMonomorphic(TypeFeedbackId ast_id); | 250 bool StoreIsPreMonomorphic(TypeFeedbackId ast_id); |
251 bool StoreIsKeyedPolymorphic(TypeFeedbackId ast_id); | 251 bool StoreIsKeyedPolymorphic(TypeFeedbackId ast_id); |
252 bool CallIsMonomorphic(Call* expr); | 252 bool CallIsMonomorphic(Call* expr); |
253 bool KeyedArrayCallIsHoley(Call* expr); | 253 bool KeyedArrayCallIsHoley(Call* expr); |
254 bool CallNewIsMonomorphic(CallNew* expr); | 254 bool CallNewIsMonomorphic(CallNew* expr); |
255 bool ObjectLiteralStoreIsMonomorphic(ObjectLiteralProperty* prop); | 255 bool ObjectLiteralStoreIsMonomorphic(ObjectLiteralProperty* prop); |
256 | 256 |
257 // TODO(1571) We can't use ForInStatement::ForInType as the return value due | 257 // TODO(1571) We can't use ForInStatement::ForInType as the return value due |
258 // to various cycles in our headers. | 258 // to various cycles in our headers. |
259 // TODO(rossberg): once all oracle access is removed from ast.cc, it should | 259 // TODO(rossberg): once all oracle access is removed from ast.cc, it should |
260 // be possible. | 260 // be possible. |
261 byte ForInType(TypeFeedbackId id); | 261 byte ForInType(TypeFeedbackId id); |
262 | 262 |
263 Handle<Map> LoadMonomorphicReceiverType(Property* expr); | 263 Handle<Map> LoadMonomorphicReceiverType(TypeFeedbackId id); |
264 Handle<Map> StoreMonomorphicReceiverType(TypeFeedbackId id); | 264 Handle<Map> StoreMonomorphicReceiverType(TypeFeedbackId id); |
265 | 265 |
266 KeyedAccessStoreMode GetStoreMode(TypeFeedbackId ast_id); | 266 KeyedAccessStoreMode GetStoreMode(TypeFeedbackId ast_id); |
267 | 267 |
268 void LoadReceiverTypes(Property* expr, | 268 void LoadReceiverTypes(TypeFeedbackId id, |
269 Handle<String> name, | 269 Handle<String> name, |
270 SmallMapList* types); | 270 SmallMapList* types); |
271 void StoreReceiverTypes(Assignment* expr, | 271 void StoreReceiverTypes(Assignment* expr, |
272 Handle<String> name, | 272 Handle<String> name, |
273 SmallMapList* types); | 273 SmallMapList* types); |
274 void CallReceiverTypes(Call* expr, | 274 void CallReceiverTypes(Call* expr, |
275 Handle<String> name, | 275 Handle<String> name, |
276 CallKind call_kind, | 276 CallKind call_kind, |
277 SmallMapList* types); | 277 SmallMapList* types); |
278 void CollectKeyedReceiverTypes(TypeFeedbackId ast_id, | 278 void CollectKeyedReceiverTypes(TypeFeedbackId ast_id, |
279 SmallMapList* types); | 279 SmallMapList* types); |
280 void CollectPolymorphicStoreReceiverTypes(TypeFeedbackId ast_id, | 280 void CollectPolymorphicStoreReceiverTypes(TypeFeedbackId ast_id, |
281 SmallMapList* types); | 281 SmallMapList* types); |
282 | 282 |
| 283 void PropertyReceiverTypes(TypeFeedbackId id, |
| 284 Handle<String> name, |
| 285 SmallMapList* receiver_types, |
| 286 bool* is_prototype); |
| 287 void KeyedPropertyReceiverTypes(TypeFeedbackId id, |
| 288 SmallMapList* receiver_types, |
| 289 bool* is_string); |
| 290 void CountReceiverTypes(TypeFeedbackId id, |
| 291 SmallMapList* receiver_types); |
| 292 |
283 static bool CanRetainOtherContext(Map* map, Context* native_context); | 293 static bool CanRetainOtherContext(Map* map, Context* native_context); |
284 static bool CanRetainOtherContext(JSFunction* function, | 294 static bool CanRetainOtherContext(JSFunction* function, |
285 Context* native_context); | 295 Context* native_context); |
286 | 296 |
287 void CollectPolymorphicMaps(Handle<Code> code, SmallMapList* types); | 297 void CollectPolymorphicMaps(Handle<Code> code, SmallMapList* types); |
288 | 298 |
289 CheckType GetCallCheckType(Call* expr); | 299 CheckType GetCallCheckType(Call* expr); |
290 Handle<JSFunction> GetCallTarget(Call* expr); | 300 Handle<JSFunction> GetCallTarget(Call* expr); |
291 Handle<JSFunction> GetCallNewTarget(CallNew* expr); | 301 Handle<JSFunction> GetCallNewTarget(CallNew* expr); |
292 Handle<Cell> GetCallNewAllocationInfoCell(CallNew* expr); | 302 Handle<Cell> GetCallNewAllocationInfoCell(CallNew* expr); |
293 | 303 |
294 Handle<Map> GetObjectLiteralStoreMap(ObjectLiteralProperty* prop); | 304 Handle<Map> GetObjectLiteralStoreMap(ObjectLiteralProperty* prop); |
295 | 305 |
296 bool LoadIsBuiltin(Property* expr, Builtins::Name id); | 306 bool LoadIsBuiltin(TypeFeedbackId id, Builtins::Name builtin_id); |
297 bool LoadIsStub(Property* expr, ICStub* stub); | 307 bool LoadIsStub(TypeFeedbackId id, ICStub* stub); |
298 | 308 |
299 // TODO(1571) We can't use ToBooleanStub::Types as the return value because | 309 // TODO(1571) We can't use ToBooleanStub::Types as the return value because |
300 // of various cycles in our headers. Death to tons of implementations in | 310 // of various cycles in our headers. Death to tons of implementations in |
301 // headers!! :-P | 311 // headers!! :-P |
302 byte ToBooleanTypes(TypeFeedbackId id); | 312 byte ToBooleanTypes(TypeFeedbackId id); |
303 | 313 |
304 // Get type information for arithmetic operations and compares. | 314 // Get type information for arithmetic operations and compares. |
305 void BinaryType(TypeFeedbackId id, | 315 void BinaryType(TypeFeedbackId id, |
306 Handle<Type>* left, | 316 Handle<Type>* left, |
307 Handle<Type>* right, | 317 Handle<Type>* right, |
308 Handle<Type>* result, | 318 Handle<Type>* result, |
309 Maybe<int>* fixed_right_arg, | 319 Maybe<int>* fixed_right_arg, |
310 Token::Value operation); | 320 Token::Value operation); |
311 | 321 |
312 void CompareType(TypeFeedbackId id, | 322 void CompareType(TypeFeedbackId id, |
313 Handle<Type>* left, | 323 Handle<Type>* left, |
314 Handle<Type>* right, | 324 Handle<Type>* right, |
315 Handle<Type>* combined); | 325 Handle<Type>* combined); |
316 | 326 |
317 Handle<Type> CountType(TypeFeedbackId id); | 327 Handle<Type> CountType(TypeFeedbackId id); |
318 void CountReceiverTypes(TypeFeedbackId id, SmallMapList* receiver_types); | |
319 | 328 |
320 Handle<Type> ClauseType(TypeFeedbackId id); | 329 Handle<Type> ClauseType(TypeFeedbackId id); |
321 | 330 |
322 Zone* zone() const { return zone_; } | 331 Zone* zone() const { return zone_; } |
323 Isolate* isolate() const { return isolate_; } | 332 Isolate* isolate() const { return isolate_; } |
324 | 333 |
325 private: | 334 private: |
326 void CollectReceiverTypes(TypeFeedbackId ast_id, | 335 void CollectReceiverTypes(TypeFeedbackId ast_id, |
327 Handle<String> name, | 336 Handle<String> name, |
328 Code::Flags flags, | 337 Code::Flags flags, |
(...skipping 22 matching lines...) Expand all Loading... |
351 Isolate* isolate_; | 360 Isolate* isolate_; |
352 Zone* zone_; | 361 Zone* zone_; |
353 Handle<UnseededNumberDictionary> dictionary_; | 362 Handle<UnseededNumberDictionary> dictionary_; |
354 | 363 |
355 DISALLOW_COPY_AND_ASSIGN(TypeFeedbackOracle); | 364 DISALLOW_COPY_AND_ASSIGN(TypeFeedbackOracle); |
356 }; | 365 }; |
357 | 366 |
358 } } // namespace v8::internal | 367 } } // namespace v8::internal |
359 | 368 |
360 #endif // V8_TYPE_INFO_H_ | 369 #endif // V8_TYPE_INFO_H_ |
OLD | NEW |