This removes the DisallowAllocationFailure assertion scope which mostly
coincided with the AlwaysAllocateScope anyways. Access to the bitfield
in the Isolate was not synchronized and hence the AlwaysAllocateScope
was not thread-safe in debug mode, now it is.
R=mlippautz@chromium.org
Review URL: https://codereview.chromium.org/
1319153006
Cr-Commit-Position: refs/heads/master@{#30637}
template class PerIsolateAssertScope<JAVASCRIPT_EXECUTION_ASSERT, true>;
template class PerIsolateAssertScope<JAVASCRIPT_EXECUTION_THROWS, false>;
template class PerIsolateAssertScope<JAVASCRIPT_EXECUTION_THROWS, true>;
-template class PerIsolateAssertScope<ALLOCATION_FAILURE_ASSERT, false>;
-template class PerIsolateAssertScope<ALLOCATION_FAILURE_ASSERT, true>;
template class PerIsolateAssertScope<DEOPTIMIZATION_ASSERT, false>;
template class PerIsolateAssertScope<DEOPTIMIZATION_ASSERT, true>;
template class PerIsolateAssertScope<COMPILATION_ASSERT, false>;
enum PerIsolateAssertType {
JAVASCRIPT_EXECUTION_ASSERT,
JAVASCRIPT_EXECUTION_THROWS,
- ALLOCATION_FAILURE_ASSERT,
DEOPTIMIZATION_ASSERT,
COMPILATION_ASSERT
};
typedef PerIsolateAssertScope<JAVASCRIPT_EXECUTION_THROWS, true>
NoThrowOnJavascriptExecution;
-// Scope to document where we do not expect an allocation failure.
-typedef PerIsolateAssertScopeDebugOnly<ALLOCATION_FAILURE_ASSERT, false>
- DisallowAllocationFailure;
-
-// Scope to introduce an exception to DisallowAllocationFailure.
-typedef PerIsolateAssertScopeDebugOnly<ALLOCATION_FAILURE_ASSERT, true>
- AllowAllocationFailure;
-
// Scope to document where we do not expect deoptimization.
typedef PerIsolateAssertScopeDebugOnly<DEOPTIMIZATION_ASSERT, false>
DisallowDeoptimization;
DCHECK(AllowHeapAllocation::IsAllowed());
DCHECK(gc_state_ == NOT_IN_GC);
#ifdef DEBUG
- if (FLAG_gc_interval >= 0 && AllowAllocationFailure::IsAllowed(isolate_) &&
+ if (FLAG_gc_interval >= 0 && !always_allocate() &&
Heap::allocation_timeout_-- <= 0) {
return AllocationResult::Retry(space);
}
AlwaysAllocateScope::AlwaysAllocateScope(Isolate* isolate)
- : heap_(isolate->heap()), daf_(isolate) {
+ : heap_(isolate->heap()) {
heap_->always_allocate_scope_count_.Increment(1);
}
inline ~AlwaysAllocateScope();
private:
- // Implicitly disable artificial allocation failures.
Heap* heap_;
- DisallowAllocationFailure daf_;
};
}
// The initialization process does not handle memory exhaustion.
- DisallowAllocationFailure disallow_allocation_failure(this);
+ AlwaysAllocateScope always_allocate(this);
memory_allocator_ = new MemoryAllocator(this);
code_range_ = new CodeRange(this);