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 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
162 ? MemoryAllocator::CodePageGuardStartOffset() | 162 ? MemoryAllocator::CodePageGuardStartOffset() |
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->exists() ? | 172 size_t alignment = code_range != NULL && code_range->valid() ? |
173 MemoryChunk::kAlignment : OS::CommitPageSize(); | 173 MemoryChunk::kAlignment : OS::CommitPageSize(); |
174 size_t reserved_size = ((executable == EXECUTABLE)) | 174 size_t reserved_size = ((executable == EXECUTABLE)) |
175 ? RoundUp(header_size + guard_size + reserve_area_size + guard_size, | 175 ? RoundUp(header_size + guard_size + reserve_area_size + guard_size, |
176 alignment) | 176 alignment) |
177 : RoundUp(header_size + reserve_area_size, OS::CommitPageSize()); | 177 : RoundUp(header_size + reserve_area_size, OS::CommitPageSize()); |
178 CHECK(memory_chunk->size() == reserved_size); | 178 CHECK(memory_chunk->size() == reserved_size); |
179 CHECK(memory_chunk->area_start() < memory_chunk->address() + | 179 CHECK(memory_chunk->area_start() < memory_chunk->address() + |
180 memory_chunk->size()); | 180 memory_chunk->size()); |
181 CHECK(memory_chunk->area_end() <= memory_chunk->address() + | 181 CHECK(memory_chunk->area_end() <= memory_chunk->address() + |
182 memory_chunk->size()); | 182 memory_chunk->size()); |
(...skipping 235 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
418 CompileRun("/*empty*/"); | 418 CompileRun("/*empty*/"); |
419 for (int i = FIRST_PAGED_SPACE; i <= LAST_PAGED_SPACE; i++) { | 419 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. | 420 // 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; | 421 if (i == CODE_SPACE && i::FLAG_debug_code) continue; |
422 CHECK_EQ(1, isolate->heap()->paged_space(i)->CountTotalPages()); | 422 CHECK_EQ(1, isolate->heap()->paged_space(i)->CountTotalPages()); |
423 } | 423 } |
424 | 424 |
425 // No large objects required to perform the above steps. | 425 // No large objects required to perform the above steps. |
426 CHECK(isolate->heap()->lo_space()->IsEmpty()); | 426 CHECK(isolate->heap()->lo_space()->IsEmpty()); |
427 } | 427 } |
OLD | NEW |