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 791 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
802 } | 802 } |
803 | 803 |
804 | 804 |
805 NoWeakObjectVerificationScope::~NoWeakObjectVerificationScope() { | 805 NoWeakObjectVerificationScope::~NoWeakObjectVerificationScope() { |
806 Isolate* isolate = Isolate::Current(); | 806 Isolate* isolate = Isolate::Current(); |
807 isolate->heap()->no_weak_object_verification_scope_depth_--; | 807 isolate->heap()->no_weak_object_verification_scope_depth_--; |
808 } | 808 } |
809 #endif | 809 #endif |
810 | 810 |
811 | 811 |
| 812 GCCallbacksScope::GCCallbacksScope(Heap* heap) : heap_(heap) { |
| 813 heap_->gc_callbacks_depth_++; |
| 814 } |
| 815 |
| 816 |
| 817 GCCallbacksScope::~GCCallbacksScope() { |
| 818 heap_->gc_callbacks_depth_--; |
| 819 } |
| 820 |
| 821 |
| 822 bool GCCallbacksScope::CheckReenter() { |
| 823 return heap_->gc_callbacks_depth_ == 1; |
| 824 } |
| 825 |
| 826 |
812 void VerifyPointersVisitor::VisitPointers(Object** start, Object** end) { | 827 void VerifyPointersVisitor::VisitPointers(Object** start, Object** end) { |
813 for (Object** current = start; current < end; current++) { | 828 for (Object** current = start; current < end; current++) { |
814 if ((*current)->IsHeapObject()) { | 829 if ((*current)->IsHeapObject()) { |
815 HeapObject* object = HeapObject::cast(*current); | 830 HeapObject* object = HeapObject::cast(*current); |
816 CHECK(object->GetIsolate()->heap()->Contains(object)); | 831 CHECK(object->GetIsolate()->heap()->Contains(object)); |
817 CHECK(object->map()->IsMap()); | 832 CHECK(object->map()->IsMap()); |
818 } | 833 } |
819 } | 834 } |
820 } | 835 } |
821 | 836 |
(...skipping 23 matching lines...) Expand all Loading... |
845 #ifdef DEBUG | 860 #ifdef DEBUG |
846 Isolate* isolate = Isolate::Current(); | 861 Isolate* isolate = Isolate::Current(); |
847 isolate->heap()->disallow_allocation_failure_ = old_state_; | 862 isolate->heap()->disallow_allocation_failure_ = old_state_; |
848 #endif | 863 #endif |
849 } | 864 } |
850 | 865 |
851 | 866 |
852 } } // namespace v8::internal | 867 } } // namespace v8::internal |
853 | 868 |
854 #endif // V8_HEAP_INL_H_ | 869 #endif // V8_HEAP_INL_H_ |
OLD | NEW |