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 700 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 Loading... |
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_ |
OLD | NEW |