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

Unified Diff: src/heap.h

Issue 15691017: Make assertion scopes thread safe. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 7 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 side-by-side diff with in-line comments
Download patch
« src/api.cc ('K') | « src/handles-inl.h ('k') | src/heap.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/heap.h
diff --git a/src/heap.h b/src/heap.h
index 556e1dbca2674f108e24886ff562aeb32daeda17..5a93981b218d67e913b99f5a3cca73185f8d99fc 100644
--- a/src/heap.h
+++ b/src/heap.h
@@ -31,6 +31,7 @@
#include <cmath>
#include "allocation.h"
+#include "assert-scope.h"
#include "globals.h"
#include "incremental-marking.h"
#include "list.h"
@@ -1496,10 +1497,6 @@ class Heap {
inline bool IsInGCPostProcessing() { return gc_post_processing_depth_ > 0; }
#ifdef DEBUG
- bool IsAllocationAllowed() { return allocation_allowed_; }
- inline void set_allow_allocation(bool allocation_allowed);
- inline bool allow_allocation(bool enable);
-
bool disallow_allocation_failure() {
return disallow_allocation_failure_;
}
@@ -1979,8 +1976,6 @@ class Heap {
#undef ROOT_ACCESSOR
#ifdef DEBUG
- bool allocation_allowed_;
-
// If the --gc-interval flag is set to a positive value, this
// variable holds the value indicating the number of allocations
// remain until the next failure and garbage collection.
@@ -2697,43 +2692,6 @@ class DescriptorLookupCache {
};
-// A helper class to document/test C++ scopes where we do not
-// expect a GC. Usage:
-//
-// /* Allocation not allowed: we cannot handle a GC in this scope. */
-// { AssertNoAllocation nogc;
-// ...
-// }
-
-#ifdef DEBUG
-inline bool EnterAllocationScope(Isolate* isolate, bool allow_allocation);
-inline void ExitAllocationScope(Isolate* isolate, bool last_state);
-#endif
-
-
-class AssertNoAllocation {
- public:
- inline AssertNoAllocation();
- inline ~AssertNoAllocation();
-
-#ifdef DEBUG
- private:
- bool last_state_;
-#endif
-};
-
-
-class DisableAssertNoAllocation {
- public:
- inline DisableAssertNoAllocation();
- inline ~DisableAssertNoAllocation();
-
-#ifdef DEBUG
- private:
- bool last_state_;
-#endif
-};
-
// GCTracer collects and prints ONE line after each garbage collector
// invocation IFF --trace_gc is used.
@@ -3048,7 +3006,7 @@ class PathTracer : public ObjectVisitor {
what_to_find_(what_to_find),
visit_mode_(visit_mode),
object_stack_(20),
- no_alloc() {}
+ no_allocation() {}
virtual void VisitPointers(Object** start, Object** end);
@@ -3077,7 +3035,7 @@ class PathTracer : public ObjectVisitor {
VisitMode visit_mode_;
List<Object*> object_stack_;
- AssertNoAllocation no_alloc; // i.e. no gc allowed.
+ DisallowHeapAllocation no_allocation; // i.e. no gc allowed.
private:
DISALLOW_IMPLICIT_CONSTRUCTORS(PathTracer);
« src/api.cc ('K') | « src/handles-inl.h ('k') | src/heap.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698