| 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 19 matching lines...) Expand all Loading... |
| 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 MaybeObject* AllocateAfterFailures() { | 37 static MaybeObject* AllocateAfterFailures() { |
| 38 static int attempts = 0; | 38 static int attempts = 0; |
| 39 if (++attempts < 3) return Failure::RetryAfterGC(); | 39 if (++attempts < 3) return Failure::RetryAfterGC(); |
| 40 Heap* heap = CcTest::i_isolate()->heap(); | 40 Heap* heap = CcTest::heap(); |
| 41 | 41 |
| 42 // New space. | 42 // New space. |
| 43 SimulateFullSpace(heap->new_space()); | 43 SimulateFullSpace(heap->new_space()); |
| 44 CHECK(!heap->AllocateByteArray(100)->IsFailure()); | 44 CHECK(!heap->AllocateByteArray(100)->IsFailure()); |
| 45 CHECK(!heap->AllocateFixedArray(100, NOT_TENURED)->IsFailure()); | 45 CHECK(!heap->AllocateFixedArray(100, NOT_TENURED)->IsFailure()); |
| 46 | 46 |
| 47 // Make sure we can allocate through optimized allocation functions | 47 // Make sure we can allocate through optimized allocation functions |
| 48 // for specific kinds. | 48 // for specific kinds. |
| 49 CHECK(!heap->AllocateFixedArray(100)->IsFailure()); | 49 CHECK(!heap->AllocateFixedArray(100)->IsFailure()); |
| 50 CHECK(!heap->AllocateHeapNumber(0.42)->IsFailure()); | 50 CHECK(!heap->AllocateHeapNumber(0.42)->IsFailure()); |
| (...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 219 if (index < blocks.length() - 1) { | 219 if (index < blocks.length() - 1) { |
| 220 blocks[index] = blocks.RemoveLast(); | 220 blocks[index] = blocks.RemoveLast(); |
| 221 } else { | 221 } else { |
| 222 blocks.RemoveLast(); | 222 blocks.RemoveLast(); |
| 223 } | 223 } |
| 224 } | 224 } |
| 225 } | 225 } |
| 226 | 226 |
| 227 code_range.TearDown(); | 227 code_range.TearDown(); |
| 228 } | 228 } |
| OLD | NEW |