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
}
-#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
};
-#ifdef DEBUG
class DisallowAllocationFailure {
public:
inline DisallowAllocationFailure();
inline ~DisallowAllocationFailure();
+#ifdef DEBUG
private:
bool old_state_;
-};
#endif
+};
class AlwaysAllocateScope {
inline AlwaysAllocateScope();
inline ~AlwaysAllocateScope();
-#ifdef DEBUG
private:
// Implicitly disable artificial allocation failures.
DisallowAllocationFailure disallow_allocation_failure_;
-#endif
};
ASSERT(Isolate::Current() == this);
TRACE_ISOLATE(init);
-#ifdef DEBUG
// The initialization process does not handle memory exhaustion.
DisallowAllocationFailure disallow_allocation_failure;
-#endif
InitializeLoggingAndCounters();
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;