| 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 316 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 327 case CompareIC::OBJECTS: | 327 case CompareIC::OBJECTS: |
| 328 // TODO(kasperl): We really need a type for JS objects here. | 328 // TODO(kasperl): We really need a type for JS objects here. |
| 329 return TypeInfo::NonPrimitive(); | 329 return TypeInfo::NonPrimitive(); |
| 330 case CompareIC::GENERIC: | 330 case CompareIC::GENERIC: |
| 331 default: | 331 default: |
| 332 return unknown; | 332 return unknown; |
| 333 } | 333 } |
| 334 } | 334 } |
| 335 | 335 |
| 336 | 336 |
| 337 TypeInfo TypeFeedbackOracle::IncrementType(CountOperation* expr) { |
| 338 Handle<Object> object = GetInfo(expr->CountId()); |
| 339 TypeInfo unknown = TypeInfo::Unknown(); |
| 340 if (!object->IsCode()) return unknown; |
| 341 Handle<Code> code = Handle<Code>::cast(object); |
| 342 if (!code->is_type_recording_binary_op_stub()) return unknown; |
| 343 |
| 344 TRBinaryOpIC::TypeInfo type = static_cast<TRBinaryOpIC::TypeInfo>( |
| 345 code->type_recording_binary_op_type()); |
| 346 switch (type) { |
| 347 case TRBinaryOpIC::UNINITIALIZED: |
| 348 case TRBinaryOpIC::SMI: |
| 349 return TypeInfo::Smi(); |
| 350 case TRBinaryOpIC::INT32: |
| 351 return TypeInfo::Integer32(); |
| 352 case TRBinaryOpIC::HEAP_NUMBER: |
| 353 return TypeInfo::Double(); |
| 354 case TRBinaryOpIC::BOTH_STRING: |
| 355 case TRBinaryOpIC::STRING: |
| 356 case TRBinaryOpIC::GENERIC: |
| 357 return unknown; |
| 358 default: |
| 359 return unknown; |
| 360 } |
| 361 UNREACHABLE(); |
| 362 return unknown; |
| 363 } |
| 364 |
| 365 |
| 337 ZoneMapList* TypeFeedbackOracle::CollectReceiverTypes(unsigned ast_id, | 366 ZoneMapList* TypeFeedbackOracle::CollectReceiverTypes(unsigned ast_id, |
| 338 Handle<String> name, | 367 Handle<String> name, |
| 339 Code::Flags flags) { | 368 Code::Flags flags) { |
| 340 Isolate* isolate = Isolate::Current(); | 369 Isolate* isolate = Isolate::Current(); |
| 341 Handle<Object> object = GetInfo(ast_id); | 370 Handle<Object> object = GetInfo(ast_id); |
| 342 if (object->IsUndefined() || object->IsSmi()) return NULL; | 371 if (object->IsUndefined() || object->IsSmi()) return NULL; |
| 343 | 372 |
| 344 if (*object == isolate->builtins()->builtin(Builtins::kStoreIC_GlobalProxy)) { | 373 if (*object == isolate->builtins()->builtin(Builtins::kStoreIC_GlobalProxy)) { |
| 345 // TODO(fschneider): We could collect the maps and signal that | 374 // TODO(fschneider): We could collect the maps and signal that |
| 346 // we need a generic store (or load) here. | 375 // we need a generic store (or load) here. |
| (...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 454 static_cast<int>(info->pc() - code->instruction_start())); | 483 static_cast<int>(info->pc() - code->instruction_start())); |
| 455 ASSERT(ast_ids->length() == 0 || | 484 ASSERT(ast_ids->length() == 0 || |
| 456 (*ast_ids)[ast_ids->length()-1] != | 485 (*ast_ids)[ast_ids->length()-1] != |
| 457 static_cast<unsigned>(info->data())); | 486 static_cast<unsigned>(info->data())); |
| 458 ast_ids->Add(static_cast<unsigned>(info->data())); | 487 ast_ids->Add(static_cast<unsigned>(info->data())); |
| 459 } | 488 } |
| 460 } | 489 } |
| 461 } | 490 } |
| 462 | 491 |
| 463 } } // namespace v8::internal | 492 } } // namespace v8::internal |
| OLD | NEW |