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

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

Issue 177243012: heap: allow allocation in gc prologue/epilogue (Closed) Base URL: gh:v8/v8@master
Patch Set: fixes Created 6 years, 9 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
« no previous file with comments | « src/heap.cc ('k') | test/cctest/test-api.cc » ('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 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
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
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_
OLDNEW
« no previous file with comments | « src/heap.cc ('k') | test/cctest/test-api.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698