| 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 22 matching lines...) Expand all Loading... |
| 33 #include "test/cctest/heap-tester.h" | 33 #include "test/cctest/heap-tester.h" |
| 34 | 34 |
| 35 | 35 |
| 36 using namespace v8::internal; | 36 using namespace v8::internal; |
| 37 | 37 |
| 38 | 38 |
| 39 AllocationResult v8::internal::HeapTester::AllocateAfterFailures() { | 39 AllocationResult v8::internal::HeapTester::AllocateAfterFailures() { |
| 40 Heap* heap = CcTest::heap(); | 40 Heap* heap = CcTest::heap(); |
| 41 | 41 |
| 42 // New space. | 42 // New space. |
| 43 SimulateFullSpace(heap->new_space()); | |
| 44 heap->AllocateByteArray(100).ToObjectChecked(); | 43 heap->AllocateByteArray(100).ToObjectChecked(); |
| 45 heap->AllocateFixedArray(100, NOT_TENURED).ToObjectChecked(); | 44 heap->AllocateFixedArray(100, NOT_TENURED).ToObjectChecked(); |
| 46 | 45 |
| 47 // Make sure we can allocate through optimized allocation functions | 46 // Make sure we can allocate through optimized allocation functions |
| 48 // for specific kinds. | 47 // for specific kinds. |
| 49 heap->AllocateFixedArray(100).ToObjectChecked(); | 48 heap->AllocateFixedArray(100).ToObjectChecked(); |
| 50 heap->AllocateHeapNumber(0.42).ToObjectChecked(); | 49 heap->AllocateHeapNumber(0.42).ToObjectChecked(); |
| 51 Object* object = heap->AllocateJSObject( | 50 Object* object = heap->AllocateJSObject( |
| 52 *CcTest::i_isolate()->object_function()).ToObjectChecked(); | 51 *CcTest::i_isolate()->object_function()).ToObjectChecked(); |
| 53 heap->CopyJSObject(JSObject::cast(object)).ToObjectChecked(); | 52 heap->CopyJSObject(JSObject::cast(object)).ToObjectChecked(); |
| (...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 235 code_range.FreeRawMemory(blocks[index].base, blocks[index].size); | 234 code_range.FreeRawMemory(blocks[index].base, blocks[index].size); |
| 236 current_allocated -= blocks[index].size; | 235 current_allocated -= blocks[index].size; |
| 237 if (index < blocks.length() - 1) { | 236 if (index < blocks.length() - 1) { |
| 238 blocks[index] = blocks.RemoveLast(); | 237 blocks[index] = blocks.RemoveLast(); |
| 239 } else { | 238 } else { |
| 240 blocks.RemoveLast(); | 239 blocks.RemoveLast(); |
| 241 } | 240 } |
| 242 } | 241 } |
| 243 } | 242 } |
| 244 } | 243 } |
| OLD | NEW |