Make test-serialize resilient against --gc-interval.

R=erik.corry@gmail.com
TEST=cctest/test-serialize (--gc-interval=100)

Review URL: https://chromiumcodereview.appspot.com/10829097

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@12240 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent 1d0f872e
......@@ -757,17 +757,19 @@ double GCTracer::SizeOfHeapObjects() {
}
#ifdef DEBUG
DisallowAllocationFailure::DisallowAllocationFailure() {
#ifdef DEBUG
old_state_ = HEAP->disallow_allocation_failure_;
HEAP->disallow_allocation_failure_ = true;
#endif
}
DisallowAllocationFailure::~DisallowAllocationFailure() {
#ifdef DEBUG
HEAP->disallow_allocation_failure_ = old_state_;
}
#endif
}
#ifdef DEBUG
......
......@@ -2149,16 +2149,16 @@ class HeapStats {
};
#ifdef DEBUG
class DisallowAllocationFailure {
public:
inline DisallowAllocationFailure();
inline ~DisallowAllocationFailure();
#ifdef DEBUG
private:
bool old_state_;
};
#endif
};
class AlwaysAllocateScope {
......@@ -2166,11 +2166,9 @@ class AlwaysAllocateScope {
inline AlwaysAllocateScope();
inline ~AlwaysAllocateScope();
#ifdef DEBUG
private:
// Implicitly disable artificial allocation failures.
DisallowAllocationFailure disallow_allocation_failure_;
#endif
};
......
......@@ -1780,10 +1780,8 @@ bool Isolate::Init(Deserializer* des) {
ASSERT(Isolate::Current() == this);
TRACE_ISOLATE(init);
#ifdef DEBUG
// The initialization process does not handle memory exhaustion.
DisallowAllocationFailure disallow_allocation_failure;
#endif
InitializeLoggingAndCounters();
......
......@@ -584,6 +584,7 @@ TEST(LinearAllocation) {
HEAP->cell_space()->RoundSizeDownToObjectAlignment(paged_space_size),
size); // Large object space.
LinearAllocationScope linear_allocation_scope;
DisallowAllocationFailure disallow_allocation_failure;
const int kSmallFixedArrayLength = 4;
const int kSmallFixedArraySize =
FixedArray::kHeaderSize + kSmallFixedArrayLength * kPointerSize;
......
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