OLD | NEW |
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 Loading... |
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 Loading... |
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 |
OLD | NEW |