Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2010 the V8 project authors. All rights reserved. | 1 // Copyright 2010 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 645 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 656 } | 656 } |
| 657 current = hash; | 657 current = hash; |
| 658 } | 658 } |
| 659 return true; | 659 return true; |
| 660 } | 660 } |
| 661 | 661 |
| 662 | 662 |
| 663 void JSFunctionResultCache::JSFunctionResultCacheVerify() { | 663 void JSFunctionResultCache::JSFunctionResultCacheVerify() { |
| 664 JSFunction::cast(get(kFactoryIndex))->Verify(); | 664 JSFunction::cast(get(kFactoryIndex))->Verify(); |
| 665 | 665 |
| 666 int size = Smi::cast(get(kCacheSizeIndex))->value(); | 666 int size = Smi::cast(get(kCacheSizeIndex))->value(); |
|
Vitaly Repeshko
2011/01/14 21:22:27
Probably needs USE(size) now.
| |
| 667 ASSERT(kEntriesIndex <= size); | 667 ASSERT(kEntriesIndex <= size); |
| 668 ASSERT(size <= length()); | 668 ASSERT(size <= length()); |
| 669 ASSERT_EQ(0, size % kEntrySize); | 669 ASSERT_EQ(0, size % kEntrySize); |
| 670 | 670 |
| 671 int finger = Smi::cast(get(kFingerIndex))->value(); | 671 int finger = Smi::cast(get(kFingerIndex))->value(); |
| 672 ASSERT(kEntriesIndex <= finger); | 672 ASSERT(kEntriesIndex <= finger); |
| 673 ASSERT(finger < size || finger == kEntriesIndex); | 673 ASSERT(finger < size || finger == kEntriesIndex); |
| 674 ASSERT_EQ(0, finger % kEntrySize); | 674 ASSERT_EQ(0, finger % kEntrySize); |
| 675 | 675 |
| 676 if (FLAG_enable_slow_asserts) { | 676 if (FLAG_enable_slow_asserts) { |
| 677 for (int i = kEntriesIndex; i < size; i++) { | 677 STATIC_ASSERT(2 == kEntrySize); |
| 678 ASSERT(!get(i)->IsTheHole()); | 678 for (int i = kEntriesIndex; i < length(); i += kEntrySize) { |
| 679 get(i)->Verify(); | 679 get(i)->Verify(); |
| 680 } | 680 get(i + 1)->Verify(); |
| 681 for (int i = size; i < length(); i++) { | 681 // Key and value must be either both the holes, or not. |
| 682 ASSERT(get(i)->IsTheHole()); | 682 ASSERT(get(i)->IsTheHole() == get(i + 1)->IsTheHole()); |
| 683 get(i)->Verify(); | |
| 684 } | 683 } |
| 685 } | 684 } |
| 686 } | 685 } |
| 687 | 686 |
| 688 | 687 |
| 689 void NormalizedMapCache::NormalizedMapCacheVerify() { | 688 void NormalizedMapCache::NormalizedMapCacheVerify() { |
| 690 FixedArray::cast(this)->Verify(); | 689 FixedArray::cast(this)->Verify(); |
| 691 if (FLAG_enable_slow_asserts) { | 690 if (FLAG_enable_slow_asserts) { |
| 692 for (int i = 0; i < length(); i++) { | 691 for (int i = 0; i < length(); i++) { |
| 693 Object* e = get(i); | 692 Object* e = get(i); |
| 694 if (e->IsMap()) { | 693 if (e->IsMap()) { |
| 695 Map::cast(e)->SharedMapVerify(); | 694 Map::cast(e)->SharedMapVerify(); |
| 696 } else { | 695 } else { |
| 697 ASSERT(e->IsUndefined()); | 696 ASSERT(e->IsUndefined()); |
| 698 } | 697 } |
| 699 } | 698 } |
| 700 } | 699 } |
| 701 } | 700 } |
| 702 | 701 |
| 703 | 702 |
| 704 #endif // DEBUG | 703 #endif // DEBUG |
| 705 | 704 |
| 706 } } // namespace v8::internal | 705 } } // namespace v8::internal |
| OLD | NEW |