| OLD | NEW |
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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 20 matching lines...) Expand all Loading... |
| 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 MaybeObject* AllocateAfterFailures() { | 38 static MaybeObject* AllocateAfterFailures() { |
| 39 static int attempts = 0; | 39 static int attempts = 0; |
| 40 if (++attempts < 3) return Failure::RetryAfterGC(); | 40 if (++attempts < 3) return Failure::RetryAfterGC(); |
| 41 Heap* heap = CcTest::heap(); | 41 TestHeap* heap = CcTest::test_heap(); |
| 42 | 42 |
| 43 // New space. | 43 // New space. |
| 44 SimulateFullSpace(heap->new_space()); | 44 SimulateFullSpace(heap->new_space()); |
| 45 CHECK(!heap->AllocateByteArray(100)->IsFailure()); | 45 CHECK(!heap->AllocateByteArray(100)->IsFailure()); |
| 46 CHECK(!heap->AllocateFixedArray(100, NOT_TENURED)->IsFailure()); | 46 CHECK(!heap->AllocateFixedArray(100, NOT_TENURED)->IsFailure()); |
| 47 | 47 |
| 48 // Make sure we can allocate through optimized allocation functions | 48 // Make sure we can allocate through optimized allocation functions |
| 49 // for specific kinds. | 49 // for specific kinds. |
| 50 CHECK(!heap->AllocateFixedArray(100)->IsFailure()); | 50 CHECK(!heap->AllocateFixedArray(100)->IsFailure()); |
| 51 CHECK(!heap->AllocateHeapNumber(0.42)->IsFailure()); | 51 CHECK(!heap->AllocateHeapNumber(0.42)->IsFailure()); |
| (...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 229 if (index < blocks.length() - 1) { | 229 if (index < blocks.length() - 1) { |
| 230 blocks[index] = blocks.RemoveLast(); | 230 blocks[index] = blocks.RemoveLast(); |
| 231 } else { | 231 } else { |
| 232 blocks.RemoveLast(); | 232 blocks.RemoveLast(); |
| 233 } | 233 } |
| 234 } | 234 } |
| 235 } | 235 } |
| 236 | 236 |
| 237 code_range.TearDown(); | 237 code_range.TearDown(); |
| 238 } | 238 } |
| OLD | NEW |