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::ExtraICState extra_ic_state, |
| 412 Handle<Object> object, |
| 413 bool* already_monomorphic) { |
| 414 Types types = TypesField::decode(extra_ic_state); |
| 415 NilValue nil = NilValueField::decode(extra_ic_state); |
| 416 EqualityKind kind = EqualityKindField::decode(extra_ic_state); |
| 417 ASSERT(types != CompareNilICStub::kFullCompare); |
| 418 *already_monomorphic = |
| 419 (types & CompareNilICStub::kCompareAgainstMonomorphicMap) != 0; |
| 420 if (kind == kStrictEquality) { |
| 421 if (nil == kNullValue) { |
| 422 return CompareNilICStub::kCompareAgainstNull; |
| 423 } else { |
| 424 return CompareNilICStub::kCompareAgainstUndefined; |
| 425 } |
| 426 } else { |
| 427 if (object->IsNull()) { |
| 428 types = static_cast<CompareNilICStub::Types>( |
| 429 types | CompareNilICStub::kCompareAgainstNull); |
| 430 } else if (object->IsUndefined()) { |
| 431 types = static_cast<CompareNilICStub::Types>( |
| 432 types | CompareNilICStub::kCompareAgainstUndefined); |
| 433 } else if (object->IsUndetectableObject() || !object->IsHeapObject()) { |
| 434 types = CompareNilICStub::kFullCompare; |
| 435 } else if ((types & CompareNilICStub::kCompareAgainstMonomorphicMap) != 0) { |
| 436 types = CompareNilICStub::kFullCompare; |
| 437 } else { |
| 438 types = static_cast<CompareNilICStub::Types>( |
| 439 types | CompareNilICStub::kCompareAgainstMonomorphicMap); |
| 440 } |
| 441 } |
| 442 return types; |
| 443 } |
| 444 |
| 445 |
410 void InstanceofStub::PrintName(StringStream* stream) { | 446 void InstanceofStub::PrintName(StringStream* stream) { |
411 const char* args = ""; | 447 const char* args = ""; |
412 if (HasArgsInRegisters()) { | 448 if (HasArgsInRegisters()) { |
413 args = "_REGS"; | 449 args = "_REGS"; |
414 } | 450 } |
415 | 451 |
416 const char* inline_check = ""; | 452 const char* inline_check = ""; |
417 if (HasCallSiteInlineCheck()) { | 453 if (HasCallSiteInlineCheck()) { |
418 inline_check = "_INLINE"; | 454 inline_check = "_INLINE"; |
419 } | 455 } |
(...skipping 231 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
651 // already active, as the hooks won't stack. | 687 // already active, as the hooks won't stack. |
652 if (entry_hook != 0 && entry_hook_ != 0) | 688 if (entry_hook != 0 && entry_hook_ != 0) |
653 return false; | 689 return false; |
654 | 690 |
655 entry_hook_ = entry_hook; | 691 entry_hook_ = entry_hook; |
656 return true; | 692 return true; |
657 } | 693 } |
658 | 694 |
659 | 695 |
660 } } // namespace v8::internal | 696 } } // namespace v8::internal |
OLD | NEW |