Chromium Code Reviews| 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 { | |
| 434 if (object->IsUndetectableObject() || !object->IsHeapObject()) { | |
|
mvstanton
2013/04/23 09:27:30
Could you combine the if with the else above
danno
2013/04/23 16:14:47
Done.
| |
| 435 types = CompareNilICStub::kFullCompare; | |
| 436 } else { | |
| 437 if ((types & CompareNilICStub::kCompareAgainstMonomorphicMap) != 0) { | |
|
mvstanton
2013/04/23 09:27:30
And again here.
danno
2013/04/23 16:14:47
Done.
| |
| 438 types = CompareNilICStub::kFullCompare; | |
| 439 } else { | |
| 440 types = static_cast<CompareNilICStub::Types>( | |
| 441 types | CompareNilICStub::kCompareAgainstMonomorphicMap); | |
| 442 } | |
| 443 } | |
| 444 } | |
| 445 } | |
| 446 return types; | |
| 447 } | |
| 448 | |
| 449 | |
| 410 void InstanceofStub::PrintName(StringStream* stream) { | 450 void InstanceofStub::PrintName(StringStream* stream) { |
| 411 const char* args = ""; | 451 const char* args = ""; |
| 412 if (HasArgsInRegisters()) { | 452 if (HasArgsInRegisters()) { |
| 413 args = "_REGS"; | 453 args = "_REGS"; |
| 414 } | 454 } |
| 415 | 455 |
| 416 const char* inline_check = ""; | 456 const char* inline_check = ""; |
| 417 if (HasCallSiteInlineCheck()) { | 457 if (HasCallSiteInlineCheck()) { |
| 418 inline_check = "_INLINE"; | 458 inline_check = "_INLINE"; |
| 419 } | 459 } |
| (...skipping 231 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 651 // already active, as the hooks won't stack. | 691 // already active, as the hooks won't stack. |
| 652 if (entry_hook != 0 && entry_hook_ != 0) | 692 if (entry_hook != 0 && entry_hook_ != 0) |
| 653 return false; | 693 return false; |
| 654 | 694 |
| 655 entry_hook_ = entry_hook; | 695 entry_hook_ = entry_hook; |
| 656 return true; | 696 return true; |
| 657 } | 697 } |
| 658 | 698 |
| 659 | 699 |
| 660 } } // namespace v8::internal | 700 } } // namespace v8::internal |
| OLD | NEW |