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 25 matching lines...) Expand all Loading... |
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(0); |
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 = 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 |
51 // in order to make the test harder. | 51 // in order to make the test harder. |
52 break; | 52 break; |
53 } | 53 } |
54 } | 54 } |
55 CHECK(!Heap::AllocateByteArray(100)->IsFailure()); | 55 CHECK(!Heap::AllocateByteArray(100)->IsFailure()); |
56 CHECK(!Heap::AllocateFixedArray(100, NOT_TENURED)->IsFailure()); | 56 CHECK(!Heap::AllocateFixedArray(100, NOT_TENURED)->IsFailure()); |
(...skipping 149 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 |