| OLD | NEW |
| 1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 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 190 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 201 | 201 |
| 202 TEST(Regress3540) { | 202 TEST(Regress3540) { |
| 203 Isolate* isolate = CcTest::i_isolate(); | 203 Isolate* isolate = CcTest::i_isolate(); |
| 204 Heap* heap = isolate->heap(); | 204 Heap* heap = isolate->heap(); |
| 205 MemoryAllocator* memory_allocator = new MemoryAllocator(isolate); | 205 MemoryAllocator* memory_allocator = new MemoryAllocator(isolate); |
| 206 CHECK(memory_allocator->SetUp(heap->MaxReserved(), heap->MaxExecutableSize(), | 206 CHECK(memory_allocator->SetUp(heap->MaxReserved(), heap->MaxExecutableSize(), |
| 207 0)); | 207 0)); |
| 208 TestMemoryAllocatorScope test_allocator_scope(isolate, memory_allocator); | 208 TestMemoryAllocatorScope test_allocator_scope(isolate, memory_allocator); |
| 209 CodeRange* code_range = new CodeRange(isolate); | 209 CodeRange* code_range = new CodeRange(isolate); |
| 210 size_t code_range_size = | 210 size_t code_range_size = |
| 211 kMinimumCodeRangeSize > 0 ? kMinimumCodeRangeSize : 3 * MB; | 211 kMinimumCodeRangeSize > 0 ? kMinimumCodeRangeSize : 3 * Page::kPageSize; |
| 212 if (!code_range->SetUp(code_range_size)) { | 212 if (!code_range->SetUp(code_range_size)) { |
| 213 return; | 213 return; |
| 214 } | 214 } |
| 215 | 215 |
| 216 Address address; | 216 Address address; |
| 217 size_t size; | 217 size_t size; |
| 218 size_t request_size = code_range_size - Page::kPageSize; | 218 size_t request_size = code_range_size - Page::kPageSize; |
| 219 address = code_range->AllocateRawMemory( | 219 address = code_range->AllocateRawMemory( |
| 220 request_size, request_size - (2 * MemoryAllocator::CodePageGuardSize()), | 220 request_size, request_size - (2 * MemoryAllocator::CodePageGuardSize()), |
| 221 &size); | 221 &size); |
| (...skipping 454 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 676 new_space->RemoveAllocationObserver(&observer2); | 676 new_space->RemoveAllocationObserver(&observer2); |
| 677 | 677 |
| 678 CHECK_EQ(observer1.count(), 32); | 678 CHECK_EQ(observer1.count(), 32); |
| 679 CHECK_EQ(observer2.count(), 28); | 679 CHECK_EQ(observer2.count(), 28); |
| 680 } | 680 } |
| 681 isolate->Dispose(); | 681 isolate->Dispose(); |
| 682 } | 682 } |
| 683 | 683 |
| 684 } // namespace internal | 684 } // namespace internal |
| 685 } // namespace v8 | 685 } // namespace v8 |
| OLD | NEW |