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

Side by Side Diff: src/heap-inl.h

Issue 23567002: Assert external strings in external string table. Remove TODOs. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 3 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/heap.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 700 matching lines...) Expand 10 before | Expand all | Expand 10 after
711 } 711 }
712 } 712 }
713 713
714 714
715 // Verify() is inline to avoid ifdef-s around its calls in release 715 // Verify() is inline to avoid ifdef-s around its calls in release
716 // mode. 716 // mode.
717 void ExternalStringTable::Verify() { 717 void ExternalStringTable::Verify() {
718 #ifdef DEBUG 718 #ifdef DEBUG
719 for (int i = 0; i < new_space_strings_.length(); ++i) { 719 for (int i = 0; i < new_space_strings_.length(); ++i) {
720 Object* obj = Object::cast(new_space_strings_[i]); 720 Object* obj = Object::cast(new_space_strings_[i]);
721 // TODO(yangguo): check that the object is indeed an external string.
722 ASSERT(heap_->InNewSpace(obj)); 721 ASSERT(heap_->InNewSpace(obj));
723 ASSERT(obj != HEAP->the_hole_value()); 722 ASSERT(obj != HEAP->the_hole_value());
724 } 723 }
725 for (int i = 0; i < old_space_strings_.length(); ++i) { 724 for (int i = 0; i < old_space_strings_.length(); ++i) {
726 Object* obj = Object::cast(old_space_strings_[i]); 725 Object* obj = Object::cast(old_space_strings_[i]);
727 // TODO(yangguo): check that the object is indeed an external string.
728 ASSERT(!heap_->InNewSpace(obj)); 726 ASSERT(!heap_->InNewSpace(obj));
729 ASSERT(obj != HEAP->the_hole_value()); 727 ASSERT(obj != HEAP->the_hole_value());
730 } 728 }
731 #endif 729 #endif
732 } 730 }
733 731
734 732
735 void ExternalStringTable::AddOldString(String* string) { 733 void ExternalStringTable::AddOldString(String* string) {
736 ASSERT(string->IsExternalString()); 734 ASSERT(string->IsExternalString());
737 ASSERT(!heap_->InNewSpace(string)); 735 ASSERT(!heap_->InNewSpace(string));
(...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after
883 DisallowAllocationFailure::~DisallowAllocationFailure() { 881 DisallowAllocationFailure::~DisallowAllocationFailure() {
884 #ifdef DEBUG 882 #ifdef DEBUG
885 HEAP->disallow_allocation_failure_ = old_state_; 883 HEAP->disallow_allocation_failure_ = old_state_;
886 #endif 884 #endif
887 } 885 }
888 886
889 887
890 } } // namespace v8::internal 888 } } // namespace v8::internal
891 889
892 #endif // V8_HEAP_INL_H_ 890 #endif // V8_HEAP_INL_H_
OLDNEW
« no previous file with comments | « src/heap.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698