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

Unified Diff: src/api.cc

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
« no previous file with comments | « src/api.h ('k') | src/arm/assembler-arm.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/api.cc
diff --git a/src/api.cc b/src/api.cc
index c2c7930f48ca5b3ee49696481f8c402fef43287e..f65e7e6dc3b6531f85dd81dca0980de690832a7c 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(
@@ -6270,14 +6271,13 @@ Local<Integer> v8::Integer::NewFromUnsigned(uint32_t value, Isolate* isolate) {
#ifdef DEBUG
-v8::AssertNoGCScope::AssertNoGCScope(v8::Isolate* isolate)
- : isolate_(isolate),
- last_state_(i::EnterAllocationScope(
- reinterpret_cast<i::Isolate*>(isolate), false)) {
+v8::AssertNoGCScope::AssertNoGCScope(v8::Isolate* isolate) {
+ disallow_heap_allocation_ = new i::DisallowHeapAllocation();
}
v8::AssertNoGCScope::~AssertNoGCScope() {
- i::ExitAllocationScope(reinterpret_cast<i::Isolate*>(isolate_), last_state_);
+ delete
+ reinterpret_cast<i::DisallowHeapAllocation*>(disallow_heap_allocation_);
Sven Panne 2013/06/03 14:11:46 I think this has to be a static_cast, IIRC.
}
#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 SealHandleScope here. Assert this.
ASSERT(prev_limit == block_limit ||
!(block_start <= prev_limit && prev_limit <= block_limit));
if (prev_limit == block_limit) break;
« no previous file with comments | « src/api.h ('k') | src/arm/assembler-arm.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698