| 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 389 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 400 ASSERT(*known_map_ != NULL); | 400 ASSERT(*known_map_ != NULL); |
| 401 GenerateKnownObjects(masm); | 401 GenerateKnownObjects(masm); |
| 402 break; | 402 break; |
| 403 case CompareIC::GENERIC: | 403 case CompareIC::GENERIC: |
| 404 GenerateGeneric(masm); | 404 GenerateGeneric(masm); |
| 405 break; | 405 break; |
| 406 } | 406 } |
| 407 } | 407 } |
| 408 | 408 |
| 409 | 409 |
| 410 CompareNilICStub::Types CompareNilICStub::GetPatchedICFlags( |
| 411 Code* ic, |
| 412 EqualityKind kind, |
| 413 NilValue nil, |
| 414 Handle<Object> object, |
| 415 bool* already_monomorphic) { |
| 416 Code::ExtraICState extra_state = ic->extra_ic_state(); |
| 417 CompareNilICStub::Types types = |
| 418 CompareNilICStub::TypesFromExtraICState(extra_state); |
| 419 ASSERT(types != CompareNilICStub::kFullCompare); |
| 420 *already_monomorphic = |
| 421 (types & CompareNilICStub::kCompareAgainstMonomorphicMap) != 0; |
| 422 if (kind == kStrictEquality) { |
| 423 if (nil == kNullValue) { |
| 424 return CompareNilICStub::kCompareAgainstNull; |
| 425 } else { |
| 426 return CompareNilICStub::kCompareAgainstUndefined; |
| 427 } |
| 428 } else { |
| 429 if (object->IsNull()) { |
| 430 types = static_cast<CompareNilICStub::Types>( |
| 431 types | CompareNilICStub::kCompareAgainstNull); |
| 432 } else if (object->IsUndefined()) { |
| 433 types = static_cast<CompareNilICStub::Types>( |
| 434 types | CompareNilICStub::kCompareAgainstUndefined); |
| 435 } else { |
| 436 if (object->IsUndetectableObject() || !object->IsHeapObject()) { |
| 437 types = CompareNilICStub::kFullCompare; |
| 438 } else { |
| 439 if ((types & CompareNilICStub::kCompareAgainstMonomorphicMap) != 0) { |
| 440 ASSERT_EQ(Code::COMPARE_NIL_IC, ic->kind()); |
| 441 Map* monomorphic_map = ic->FindFirstMap(); |
| 442 if (monomorphic_map != Handle<HeapObject>::cast(object)->map()) { |
| 443 types = CompareNilICStub::kFullCompare; |
| 444 } |
| 445 } else { |
| 446 types = static_cast<CompareNilICStub::Types>( |
| 447 types | CompareNilICStub::kCompareAgainstMonomorphicMap); |
| 448 } |
| 449 } |
| 450 } |
| 451 } |
| 452 return types; |
| 453 } |
| 454 |
| 455 |
| 410 void InstanceofStub::PrintName(StringStream* stream) { | 456 void InstanceofStub::PrintName(StringStream* stream) { |
| 411 const char* args = ""; | 457 const char* args = ""; |
| 412 if (HasArgsInRegisters()) { | 458 if (HasArgsInRegisters()) { |
| 413 args = "_REGS"; | 459 args = "_REGS"; |
| 414 } | 460 } |
| 415 | 461 |
| 416 const char* inline_check = ""; | 462 const char* inline_check = ""; |
| 417 if (HasCallSiteInlineCheck()) { | 463 if (HasCallSiteInlineCheck()) { |
| 418 inline_check = "_INLINE"; | 464 inline_check = "_INLINE"; |
| 419 } | 465 } |
| (...skipping 231 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 651 // already active, as the hooks won't stack. | 697 // already active, as the hooks won't stack. |
| 652 if (entry_hook != 0 && entry_hook_ != 0) | 698 if (entry_hook != 0 && entry_hook_ != 0) |
| 653 return false; | 699 return false; |
| 654 | 700 |
| 655 entry_hook_ = entry_hook; | 701 entry_hook_ = entry_hook; |
| 656 return true; | 702 return true; |
| 657 } | 703 } |
| 658 | 704 |
| 659 | 705 |
| 660 } } // namespace v8::internal | 706 } } // namespace v8::internal |
| OLD | NEW |