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

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

Issue 358363002: Move platform abstraction to base library (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: updates Created 6 years, 5 months 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 | Annotate | Revision Log
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 152 matching lines...) Expand 10 before | Expand all | Expand 10 after
163 : MemoryChunk::kObjectStartOffset; 163 : MemoryChunk::kObjectStartOffset;
164 size_t guard_size = (executable == EXECUTABLE) 164 size_t guard_size = (executable == EXECUTABLE)
165 ? MemoryAllocator::CodePageGuardSize() 165 ? MemoryAllocator::CodePageGuardSize()
166 : 0; 166 : 0;
167 167
168 MemoryChunk* memory_chunk = memory_allocator->AllocateChunk(reserve_area_size, 168 MemoryChunk* memory_chunk = memory_allocator->AllocateChunk(reserve_area_size,
169 commit_area_size, 169 commit_area_size,
170 executable, 170 executable,
171 NULL); 171 NULL);
172 size_t alignment = code_range != NULL && code_range->valid() ? 172 size_t alignment = code_range != NULL && code_range->valid() ?
173 MemoryChunk::kAlignment : OS::CommitPageSize(); 173 MemoryChunk::kAlignment : v8::base::OS::CommitPageSize();
174 size_t reserved_size = ((executable == EXECUTABLE)) 174 size_t reserved_size =
175 ? RoundUp(header_size + guard_size + reserve_area_size + guard_size, 175 ((executable == EXECUTABLE))
176 alignment) 176 ? RoundUp(header_size + guard_size + reserve_area_size + guard_size,
177 : RoundUp(header_size + reserve_area_size, OS::CommitPageSize()); 177 alignment)
178 : RoundUp(header_size + reserve_area_size,
179 v8::base::OS::CommitPageSize());
178 CHECK(memory_chunk->size() == reserved_size); 180 CHECK(memory_chunk->size() == reserved_size);
179 CHECK(memory_chunk->area_start() < memory_chunk->address() + 181 CHECK(memory_chunk->area_start() < memory_chunk->address() +
180 memory_chunk->size()); 182 memory_chunk->size());
181 CHECK(memory_chunk->area_end() <= memory_chunk->address() + 183 CHECK(memory_chunk->area_end() <= memory_chunk->address() +
182 memory_chunk->size()); 184 memory_chunk->size());
183 CHECK(static_cast<size_t>(memory_chunk->area_size()) == commit_area_size); 185 CHECK(static_cast<size_t>(memory_chunk->area_size()) == commit_area_size);
184 186
185 Address area_start = memory_chunk->area_start(); 187 Address area_start = memory_chunk->area_start();
186 188
187 memory_chunk->CommitArea(second_commit_area_size); 189 memory_chunk->CommitArea(second_commit_area_size);
(...skipping 230 matching lines...) Expand 10 before | Expand all | Expand 10 after
418 CompileRun("/*empty*/"); 420 CompileRun("/*empty*/");
419 for (int i = FIRST_PAGED_SPACE; i <= LAST_PAGED_SPACE; i++) { 421 for (int i = FIRST_PAGED_SPACE; i <= LAST_PAGED_SPACE; i++) {
420 // Debug code can be very large, so skip CODE_SPACE if we are generating it. 422 // Debug code can be very large, so skip CODE_SPACE if we are generating it.
421 if (i == CODE_SPACE && i::FLAG_debug_code) continue; 423 if (i == CODE_SPACE && i::FLAG_debug_code) continue;
422 CHECK_EQ(1, isolate->heap()->paged_space(i)->CountTotalPages()); 424 CHECK_EQ(1, isolate->heap()->paged_space(i)->CountTotalPages());
423 } 425 }
424 426
425 // No large objects required to perform the above steps. 427 // No large objects required to perform the above steps.
426 CHECK(isolate->heap()->lo_space()->IsEmpty()); 428 CHECK(isolate->heap()->lo_space()->IsEmpty());
427 } 429 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698