| 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 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 53 | 53 |
| 54 // Old data space. | 54 // Old data space. |
| 55 heap::SimulateFullSpace(heap->old_space()); | 55 heap::SimulateFullSpace(heap->old_space()); |
| 56 heap->AllocateByteArray(100, TENURED).ToObjectChecked(); | 56 heap->AllocateByteArray(100, TENURED).ToObjectChecked(); |
| 57 | 57 |
| 58 // Old pointer space. | 58 // Old pointer space. |
| 59 heap::SimulateFullSpace(heap->old_space()); | 59 heap::SimulateFullSpace(heap->old_space()); |
| 60 heap->AllocateFixedArray(10000, TENURED).ToObjectChecked(); | 60 heap->AllocateFixedArray(10000, TENURED).ToObjectChecked(); |
| 61 | 61 |
| 62 // Large object space. | 62 // Large object space. |
| 63 static const int kLargeObjectSpaceFillerLength = 3 * (Page::kPageSize / 10); | 63 static const size_t kLargeObjectSpaceFillerLength = |
| 64 static const int kLargeObjectSpaceFillerSize = FixedArray::SizeFor( | 64 3 * (Page::kPageSize / 10); |
| 65 kLargeObjectSpaceFillerLength); | 65 static const size_t kLargeObjectSpaceFillerSize = |
| 66 CHECK(kLargeObjectSpaceFillerSize > heap->old_space()->AreaSize()); | 66 FixedArray::SizeFor(kLargeObjectSpaceFillerLength); |
| 67 CHECK_GT(kLargeObjectSpaceFillerSize, |
| 68 static_cast<size_t>(heap->old_space()->AreaSize())); |
| 67 while (heap->OldGenerationSpaceAvailable() > kLargeObjectSpaceFillerSize) { | 69 while (heap->OldGenerationSpaceAvailable() > kLargeObjectSpaceFillerSize) { |
| 68 heap->AllocateFixedArray( | 70 heap->AllocateFixedArray( |
| 69 kLargeObjectSpaceFillerLength, TENURED).ToObjectChecked(); | 71 kLargeObjectSpaceFillerLength, TENURED).ToObjectChecked(); |
| 70 } | 72 } |
| 71 heap->AllocateFixedArray( | 73 heap->AllocateFixedArray( |
| 72 kLargeObjectSpaceFillerLength, TENURED).ToObjectChecked(); | 74 kLargeObjectSpaceFillerLength, TENURED).ToObjectChecked(); |
| 73 | 75 |
| 74 // Map space. | 76 // Map space. |
| 75 heap::SimulateFullSpace(heap->map_space()); | 77 heap::SimulateFullSpace(heap->map_space()); |
| 76 int instance_size = JSObject::kHeaderSize; | 78 int instance_size = JSObject::kHeaderSize; |
| (...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 239 code_range.FreeRawMemory(blocks[index].base, blocks[index].size); | 241 code_range.FreeRawMemory(blocks[index].base, blocks[index].size); |
| 240 current_allocated -= blocks[index].size; | 242 current_allocated -= blocks[index].size; |
| 241 if (index < blocks.length() - 1) { | 243 if (index < blocks.length() - 1) { |
| 242 blocks[index] = blocks.RemoveLast(); | 244 blocks[index] = blocks.RemoveLast(); |
| 243 } else { | 245 } else { |
| 244 blocks.RemoveLast(); | 246 blocks.RemoveLast(); |
| 245 } | 247 } |
| 246 } | 248 } |
| 247 } | 249 } |
| 248 } | 250 } |
| OLD | NEW |