Index: src/api.cc |
diff --git a/src/api.cc b/src/api.cc |
index c2c7930f48ca5b3ee49696481f8c402fef43287e..94af3613f1b93f6e4bca4c07211830c752ae4f1a 100644 |
--- a/src/api.cc |
+++ b/src/api.cc |
@@ -35,6 +35,7 @@ |
#include "../include/v8-debug.h" |
#include "../include/v8-profiler.h" |
#include "../include/v8-testing.h" |
+#include "assert-scope.h" |
#include "bootstrapper.h" |
#include "code-stubs.h" |
#include "compiler.h" |
@@ -5106,7 +5107,7 @@ void v8::V8::VisitHandlesWithClassIds(PersistentHandleVisitor* visitor) { |
i::Isolate* isolate = i::Isolate::Current(); |
IsDeadCheck(isolate, "v8::V8::VisitHandlesWithClassId"); |
- i::AssertNoAllocation no_allocation; |
+ i::DisallowHeapAllocation no_allocation; |
VisitorAdapter visitor_adapter(visitor); |
isolate->global_handles()->IterateAllRootsWithClassIds(&visitor_adapter); |
@@ -5119,7 +5120,7 @@ void v8::V8::VisitHandlesForPartialDependence( |
ASSERT(isolate == i::Isolate::Current()); |
IsDeadCheck(isolate, "v8::V8::VisitHandlesForPartialDependence"); |
- i::AssertNoAllocation no_allocation; |
+ i::DisallowHeapAllocation no_allocation; |
VisitorAdapter visitor_adapter(visitor); |
isolate->global_handles()->IterateAllRootsInNewSpaceWithClassIds( |
@@ -6271,13 +6272,12 @@ Local<Integer> v8::Integer::NewFromUnsigned(uint32_t value, Isolate* isolate) { |
#ifdef DEBUG |
v8::AssertNoGCScope::AssertNoGCScope(v8::Isolate* isolate) |
Sven Panne
2013/06/03 09:58:23
This class is identical to DisallowHeapAllocation
Yang
2013/06/03 13:37:15
Done.
|
- : isolate_(isolate), |
- last_state_(i::EnterAllocationScope( |
- reinterpret_cast<i::Isolate*>(isolate), false)) { |
+ : last_state_(i::AllowHeapAllocation::IsAllowed()) { |
+ i::AllowHeapAllocation::SetIsAllowed(false); |
} |
v8::AssertNoGCScope::~AssertNoGCScope() { |
- i::ExitAllocationScope(reinterpret_cast<i::Isolate*>(isolate_), last_state_); |
+ i::AllowHeapAllocation::SetIsAllowed(last_state_); |
} |
#endif |
@@ -7809,8 +7809,7 @@ DeferredHandles* HandleScopeImplementer::Detach(Object** prev_limit) { |
while (!blocks_.is_empty()) { |
Object** block_start = blocks_.last(); |
Object** block_limit = &block_start[kHandleBlockSize]; |
- // We should not need to check for NoHandleAllocation here. Assert |
- // this. |
+ // We should not need to check for RequireNewHandleScope here. Assert this. |
ASSERT(prev_limit == block_limit || |
!(block_start <= prev_limit && prev_limit <= block_limit)); |
if (prev_limit == block_limit) break; |