OLD | NEW |
1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 16 matching lines...) Expand all Loading... |
27 | 27 |
28 #include "v8.h" | 28 #include "v8.h" |
29 #include "accessors.h" | 29 #include "accessors.h" |
30 | 30 |
31 #include "cctest.h" | 31 #include "cctest.h" |
32 | 32 |
33 | 33 |
34 using namespace v8::internal; | 34 using namespace v8::internal; |
35 | 35 |
36 | 36 |
37 static inline void SimulateFullSpace(PagedSpace* space) { | 37 // Also used in test-heap.cc test cases. |
| 38 void SimulateFullSpace(PagedSpace* space) { |
38 int old_linear_size = static_cast<int>(space->limit() - space->top()); | 39 int old_linear_size = static_cast<int>(space->limit() - space->top()); |
39 space->Free(space->top(), old_linear_size); | 40 space->Free(space->top(), old_linear_size); |
40 space->SetTop(space->limit(), space->limit()); | 41 space->SetTop(space->limit(), space->limit()); |
41 space->ResetFreeList(); | 42 space->ResetFreeList(); |
42 space->ClearStats(); | 43 space->ClearStats(); |
43 } | 44 } |
44 | 45 |
45 | 46 |
46 static MaybeObject* AllocateAfterFailures() { | 47 static MaybeObject* AllocateAfterFailures() { |
47 static int attempts = 0; | 48 static int attempts = 0; |
(...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
228 blocks[index] = blocks.RemoveLast(); | 229 blocks[index] = blocks.RemoveLast(); |
229 } else { | 230 } else { |
230 blocks.RemoveLast(); | 231 blocks.RemoveLast(); |
231 } | 232 } |
232 } | 233 } |
233 } | 234 } |
234 | 235 |
235 code_range->TearDown(); | 236 code_range->TearDown(); |
236 delete code_range; | 237 delete code_range; |
237 } | 238 } |
OLD | NEW |