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