Make AlwaysAllocateScope imply DisallowAllocationFailure.

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

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@12229 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent bfd51f29
......@@ -2149,10 +2149,28 @@ class HeapStats {
};
#ifdef DEBUG
class DisallowAllocationFailure {
public:
inline DisallowAllocationFailure();
inline ~DisallowAllocationFailure();
private:
bool old_state_;
};
#endif
class AlwaysAllocateScope {
public:
inline AlwaysAllocateScope();
inline ~AlwaysAllocateScope();
#ifdef DEBUG
private:
// Implicitly disable artificial allocation failures.
DisallowAllocationFailure disallow_allocation_failure_;
#endif
};
......@@ -2397,18 +2415,6 @@ class DescriptorLookupCache {
};
#ifdef DEBUG
class DisallowAllocationFailure {
public:
inline DisallowAllocationFailure();
inline ~DisallowAllocationFailure();
private:
bool old_state_;
};
#endif
// A helper class to document/test C++ scopes where we do not
// expect a GC. Usage:
//
......
......@@ -1268,6 +1268,7 @@ static void FillUpNewSpace(NewSpace* new_space) {
// that the scavenger does not undo the filling.
v8::HandleScope scope;
AlwaysAllocateScope always_allocate;
LinearAllocationScope allocate_linearly;
intptr_t available = new_space->EffectiveCapacity() - new_space->Size();
intptr_t number_of_fillers = (available / FixedArray::SizeFor(32)) - 1;
for (intptr_t i = 0; i < number_of_fillers; i++) {
......
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