Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(246)

Side by Side Diff: src/objects-debug.cc

Issue 6321012: Version 3.0.9... (Closed) Base URL: http://v8.googlecode.com/svn/trunk/
Patch Set: Created 9 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/objects.h ('k') | src/objects-inl.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 652 matching lines...) Expand 10 before | Expand all | Expand 10 after
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();
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 && finger == size));
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 STATIC_ASSERT(2 == kEntrySize); 677 for (int i = kEntriesIndex; i < size; i++) {
678 for (int i = kEntriesIndex; i < length(); i += kEntrySize) { 678 ASSERT(!get(i)->IsTheHole());
679 get(i)->Verify(); 679 get(i)->Verify();
680 get(i + 1)->Verify(); 680 }
681 // Key and value must be either both the holes, or not. 681 for (int i = size; i < length(); i++) {
682 ASSERT(get(i)->IsTheHole() == get(i + 1)->IsTheHole()); 682 ASSERT(get(i)->IsTheHole());
683 get(i)->Verify();
683 } 684 }
684 } 685 }
685 } 686 }
686 687
687 688
688 void NormalizedMapCache::NormalizedMapCacheVerify() { 689 void NormalizedMapCache::NormalizedMapCacheVerify() {
689 FixedArray::cast(this)->Verify(); 690 FixedArray::cast(this)->Verify();
690 if (FLAG_enable_slow_asserts) { 691 if (FLAG_enable_slow_asserts) {
691 for (int i = 0; i < length(); i++) { 692 for (int i = 0; i < length(); i++) {
692 Object* e = get(i); 693 Object* e = get(i);
693 if (e->IsMap()) { 694 if (e->IsMap()) {
694 Map::cast(e)->SharedMapVerify(); 695 Map::cast(e)->SharedMapVerify();
695 } else { 696 } else {
696 ASSERT(e->IsUndefined()); 697 ASSERT(e->IsUndefined());
697 } 698 }
698 } 699 }
699 } 700 }
700 } 701 }
701 702
702 703
703 #endif // DEBUG 704 #endif // DEBUG
704 705
705 } } // namespace v8::internal 706 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/objects.h ('k') | src/objects-inl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698