Commit 6f454aa1 authored by mstarzinger's avatar mstarzinger Committed by Commit bot

[heap] Remove obsolete DisallowAllocationFailure scope.

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}
parent a93ffde3
......@@ -145,8 +145,6 @@ template class PerIsolateAssertScope<JAVASCRIPT_EXECUTION_ASSERT, false>;
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>;
......
......@@ -29,7 +29,6 @@ enum PerThreadAssertType {
enum PerIsolateAssertType {
JAVASCRIPT_EXECUTION_ASSERT,
JAVASCRIPT_EXECUTION_THROWS,
ALLOCATION_FAILURE_ASSERT,
DEOPTIMIZATION_ASSERT,
COMPILATION_ASSERT
};
......@@ -156,14 +155,6 @@ typedef PerIsolateAssertScope<JAVASCRIPT_EXECUTION_THROWS, false>
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;
......
......@@ -198,7 +198,7 @@ AllocationResult Heap::AllocateRaw(int size_in_bytes, AllocationSpace space,
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);
}
......@@ -748,7 +748,7 @@ void Heap::SetSetterStubDeoptPCOffset(int pc_offset) {
AlwaysAllocateScope::AlwaysAllocateScope(Isolate* isolate)
: heap_(isolate->heap()), daf_(isolate) {
: heap_(isolate->heap()) {
heap_->always_allocate_scope_count_.Increment(1);
}
......
......@@ -2398,9 +2398,7 @@ class AlwaysAllocateScope {
inline ~AlwaysAllocateScope();
private:
// Implicitly disable artificial allocation failures.
Heap* heap_;
DisallowAllocationFailure daf_;
};
......
......@@ -2074,7 +2074,7 @@ bool Isolate::Init(Deserializer* des) {
}
// 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);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment