Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1109)

Side by Side Diff: test/cctest/test-spaces.cc

Issue 742733002: Reserve code range block for evacuation. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fix test/cctest/test-spaces.cc Created 6 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/heap/spaces.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 198 matching lines...) Expand 10 before | Expand all | Expand 10 after
209 Heap* heap = isolate->heap(); 209 Heap* heap = isolate->heap();
210 MemoryAllocator* memory_allocator = new MemoryAllocator(isolate); 210 MemoryAllocator* memory_allocator = new MemoryAllocator(isolate);
211 CHECK( 211 CHECK(
212 memory_allocator->SetUp(heap->MaxReserved(), heap->MaxExecutableSize())); 212 memory_allocator->SetUp(heap->MaxReserved(), heap->MaxExecutableSize()));
213 TestMemoryAllocatorScope test_allocator_scope(isolate, memory_allocator); 213 TestMemoryAllocatorScope test_allocator_scope(isolate, memory_allocator);
214 CodeRange* code_range = new CodeRange(isolate); 214 CodeRange* code_range = new CodeRange(isolate);
215 const size_t code_range_size = 4 * MB; 215 const size_t code_range_size = 4 * MB;
216 if (!code_range->SetUp( 216 if (!code_range->SetUp(
217 code_range_size + 217 code_range_size +
218 RoundUp(v8::base::OS::CommitPageSize() * kReservedCodeRangePages, 218 RoundUp(v8::base::OS::CommitPageSize() * kReservedCodeRangePages,
219 MemoryChunk::kAlignment))) { 219 MemoryChunk::kAlignment) +
220 v8::internal::MemoryAllocator::CodePageAreaSize())) {
220 return; 221 return;
221 } 222 }
222 Address address; 223 Address address;
223 size_t size; 224 size_t size;
224 address = code_range->AllocateRawMemory(code_range_size - MB, 225 address = code_range->AllocateRawMemory(code_range_size - MB,
225 code_range_size - MB, &size); 226 code_range_size - MB, &size);
226 CHECK(address != NULL); 227 CHECK(address != NULL);
227 Address null_address; 228 Address null_address;
228 size_t null_size; 229 size_t null_size;
229 null_address = code_range->AllocateRawMemory( 230 null_address = code_range->AllocateRawMemory(
(...skipping 271 matching lines...) Expand 10 before | Expand all | Expand 10 after
501 502
502 // Turn the allocation into a proper object so isolate teardown won't 503 // Turn the allocation into a proper object so isolate teardown won't
503 // crash. 504 // crash.
504 v8::internal::FreeListNode* node = 505 v8::internal::FreeListNode* node =
505 v8::internal::FreeListNode::cast(allocation.ToObjectChecked()); 506 v8::internal::FreeListNode::cast(allocation.ToObjectChecked());
506 node->set_size(new_space->heap(), 80); 507 node->set_size(new_space->heap(), 80);
507 } 508 }
508 } 509 }
509 isolate->Dispose(); 510 isolate->Dispose();
510 } 511 }
OLDNEW
« no previous file with comments | « src/heap/spaces.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698