Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(341)

Side by Side Diff: test/cctest/test-heap.cc

Issue 10824082: Make AlwaysAllocateScope imply DisallowAllocationFailure. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 8 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/heap.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 2
3 #include <stdlib.h> 3 #include <stdlib.h>
4 4
5 #include "v8.h" 5 #include "v8.h"
6 6
7 #include "execution.h" 7 #include "execution.h"
8 #include "factory.h" 8 #include "factory.h"
9 #include "macro-assembler.h" 9 #include "macro-assembler.h"
10 #include "global-handles.h" 10 #include "global-handles.h"
(...skipping 1250 matching lines...) Expand 10 before | Expand all | Expand 10 after
1261 CHECK_GT(size_of_objects_2 / 20, delta); 1261 CHECK_GT(size_of_objects_2 / 20, delta);
1262 } 1262 }
1263 } 1263 }
1264 1264
1265 1265
1266 static void FillUpNewSpace(NewSpace* new_space) { 1266 static void FillUpNewSpace(NewSpace* new_space) {
1267 // Fill up new space to the point that it is completely full. Make sure 1267 // Fill up new space to the point that it is completely full. Make sure
1268 // that the scavenger does not undo the filling. 1268 // that the scavenger does not undo the filling.
1269 v8::HandleScope scope; 1269 v8::HandleScope scope;
1270 AlwaysAllocateScope always_allocate; 1270 AlwaysAllocateScope always_allocate;
1271 LinearAllocationScope allocate_linearly;
1271 intptr_t available = new_space->EffectiveCapacity() - new_space->Size(); 1272 intptr_t available = new_space->EffectiveCapacity() - new_space->Size();
1272 intptr_t number_of_fillers = (available / FixedArray::SizeFor(32)) - 1; 1273 intptr_t number_of_fillers = (available / FixedArray::SizeFor(32)) - 1;
1273 for (intptr_t i = 0; i < number_of_fillers; i++) { 1274 for (intptr_t i = 0; i < number_of_fillers; i++) {
1274 CHECK(HEAP->InNewSpace(*FACTORY->NewFixedArray(32, NOT_TENURED))); 1275 CHECK(HEAP->InNewSpace(*FACTORY->NewFixedArray(32, NOT_TENURED)));
1275 } 1276 }
1276 } 1277 }
1277 1278
1278 1279
1279 TEST(GrowAndShrinkNewSpace) { 1280 TEST(GrowAndShrinkNewSpace) {
1280 InitializeVM(); 1281 InitializeVM();
(...skipping 696 matching lines...) Expand 10 before | Expand all | Expand 10 after
1977 CompileRun(source); 1978 CompileRun(source);
1978 Handle<JSFunction> g = 1979 Handle<JSFunction> g =
1979 v8::Utils::OpenHandle( 1980 v8::Utils::OpenHandle(
1980 *v8::Handle<v8::Function>::Cast( 1981 *v8::Handle<v8::Function>::Cast(
1981 v8::Context::GetCurrent()->Global()->Get(v8_str("g")))); 1982 v8::Context::GetCurrent()->Global()->Get(v8_str("g"))));
1982 1983
1983 AssertNoAllocation no_alloc; 1984 AssertNoAllocation no_alloc;
1984 g->shared()->PrintLn(); 1985 g->shared()->PrintLn();
1985 } 1986 }
1986 #endif // OBJECT_PRINT 1987 #endif // OBJECT_PRINT
OLDNEW
« no previous file with comments | « src/heap.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698