OLD | NEW |
1 // Copyright 2007-2008 the V8 project authors. All rights reserved. | 1 // Copyright 2007-2008 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 19 matching lines...) Expand all Loading... |
30 #include "top.h" | 30 #include "top.h" |
31 | 31 |
32 #include "cctest.h" | 32 #include "cctest.h" |
33 | 33 |
34 | 34 |
35 using namespace v8::internal; | 35 using namespace v8::internal; |
36 | 36 |
37 | 37 |
38 static Object* AllocateAfterFailures() { | 38 static Object* AllocateAfterFailures() { |
39 static int attempts = 0; | 39 static int attempts = 0; |
40 if (++attempts < 3) return Failure::RetryAfterGC(0); | 40 if (++attempts < 3) return Failure::RetryAfterGC(); |
41 | 41 |
42 // New space. | 42 // New space. |
43 NewSpace* new_space = Heap::new_space(); | 43 NewSpace* new_space = Heap::new_space(); |
44 static const int kNewSpaceFillerSize = ByteArray::SizeFor(0); | 44 static const int kNewSpaceFillerSize = ByteArray::SizeFor(0); |
45 while (new_space->Available() > kNewSpaceFillerSize) { | 45 while (new_space->Available() > kNewSpaceFillerSize) { |
46 int available_before = static_cast<int>(new_space->Available()); | 46 int available_before = static_cast<int>(new_space->Available()); |
47 CHECK(!Heap::AllocateByteArray(0)->IsFailure()); | 47 CHECK(!Heap::AllocateByteArray(0)->IsFailure()); |
48 if (available_before == new_space->Available()) { | 48 if (available_before == new_space->Available()) { |
49 // It seems that we are avoiding new space allocations when | 49 // It seems that we are avoiding new space allocations when |
50 // allocation is forced, so no need to fill up new space | 50 // allocation is forced, so no need to fill up new space |
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
206 if (index < blocks.length() - 1) { | 206 if (index < blocks.length() - 1) { |
207 blocks[index] = blocks.RemoveLast(); | 207 blocks[index] = blocks.RemoveLast(); |
208 } else { | 208 } else { |
209 blocks.RemoveLast(); | 209 blocks.RemoveLast(); |
210 } | 210 } |
211 } | 211 } |
212 } | 212 } |
213 | 213 |
214 CodeRange::TearDown(); | 214 CodeRange::TearDown(); |
215 } | 215 } |
OLD | NEW |