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 189 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
200 if (requested <= allocation_list_[current_allocation_block_index_].size) { | 200 if (requested <= allocation_list_[current_allocation_block_index_].size) { |
201 return; // Found a large enough allocation block. | 201 return; // Found a large enough allocation block. |
202 } | 202 } |
203 } | 203 } |
204 | 204 |
205 // Code range is full or too fragmented. | 205 // Code range is full or too fragmented. |
206 V8::FatalProcessOutOfMemory("CodeRange::GetNextAllocationBlock"); | 206 V8::FatalProcessOutOfMemory("CodeRange::GetNextAllocationBlock"); |
207 } | 207 } |
208 | 208 |
209 | 209 |
210 | |
211 Address CodeRange::AllocateRawMemory(const size_t requested, | 210 Address CodeRange::AllocateRawMemory(const size_t requested, |
212 size_t* allocated) { | 211 size_t* allocated, |
212 bool commit) { | |
213 ASSERT(current_allocation_block_index_ < allocation_list_.length()); | 213 ASSERT(current_allocation_block_index_ < allocation_list_.length()); |
214 if (requested > allocation_list_[current_allocation_block_index_].size) { | 214 if (requested > allocation_list_[current_allocation_block_index_].size) { |
215 // Find an allocation block large enough. This function call may | 215 // Find an allocation block large enough. This function call may |
216 // call V8::FatalProcessOutOfMemory if it cannot find a large enough block. | 216 // call V8::FatalProcessOutOfMemory if it cannot find a large enough block. |
217 GetNextAllocationBlock(requested); | 217 GetNextAllocationBlock(requested); |
218 } | 218 } |
219 // Commit the requested memory at the start of the current allocation block. | 219 // Commit the requested memory at the start of the current allocation block. |
220 size_t aligned_requested = RoundUp(requested, MemoryChunk::kAlignment); | 220 size_t aligned_requested = RoundUp(requested, MemoryChunk::kAlignment); |
221 FreeBlock current = allocation_list_[current_allocation_block_index_]; | 221 FreeBlock current = allocation_list_[current_allocation_block_index_]; |
222 if (aligned_requested >= (current.size - Page::kPageSize)) { | 222 if (aligned_requested >= (current.size - Page::kPageSize)) { |
223 // Don't leave a small free block, useless for a large object or chunk. | 223 // Don't leave a small free block, useless for a large object or chunk. |
224 *allocated = current.size; | 224 *allocated = current.size; |
225 } else { | 225 } else { |
226 *allocated = aligned_requested; | 226 *allocated = aligned_requested; |
227 } | 227 } |
228 ASSERT(*allocated <= current.size); | 228 ASSERT(*allocated <= current.size); |
229 ASSERT(IsAddressAligned(current.start, MemoryChunk::kAlignment)); | 229 ASSERT(IsAddressAligned(current.start, MemoryChunk::kAlignment)); |
230 if (!MemoryAllocator::CommitCodePage(code_range_, | 230 if (commit && !CommitRawMemory(current.start, *allocated)) { |
231 current.start, | |
232 *allocated)) { | |
233 *allocated = 0; | 231 *allocated = 0; |
234 return NULL; | 232 return NULL; |
235 } | 233 } |
236 allocation_list_[current_allocation_block_index_].start += *allocated; | 234 allocation_list_[current_allocation_block_index_].start += *allocated; |
237 allocation_list_[current_allocation_block_index_].size -= *allocated; | 235 allocation_list_[current_allocation_block_index_].size -= *allocated; |
238 if (*allocated == current.size) { | 236 if (*allocated == current.size) { |
239 GetNextAllocationBlock(0); // This block is used up, get the next one. | 237 GetNextAllocationBlock(0); // This block is used up, get the next one. |
240 } | 238 } |
241 return current.start; | 239 return current.start; |
242 } | 240 } |
243 | 241 |
244 | 242 |
243 bool CodeRange::CommitRawMemory(Address start, size_t size) { | |
244 return MemoryAllocator::CommitCodePage(code_range_, start, size); | |
245 } | |
246 | |
247 | |
245 void CodeRange::FreeRawMemory(Address address, size_t length) { | 248 void CodeRange::FreeRawMemory(Address address, size_t length) { |
246 ASSERT(IsAddressAligned(address, MemoryChunk::kAlignment)); | 249 ASSERT(IsAddressAligned(address, MemoryChunk::kAlignment)); |
247 free_list_.Add(FreeBlock(address, length)); | 250 free_list_.Add(FreeBlock(address, length)); |
248 code_range_->Uncommit(address, length); | 251 code_range_->Uncommit(address, length); |
249 } | 252 } |
250 | 253 |
251 | 254 |
252 void CodeRange::TearDown() { | 255 void CodeRange::TearDown() { |
253 delete code_range_; // Frees all memory in the virtual memory range. | 256 delete code_range_; // Frees all memory in the virtual memory range. |
254 code_range_ = NULL; | 257 code_range_ = NULL; |
(...skipping 23 matching lines...) Expand all Loading... | |
278 size_ = 0; | 281 size_ = 0; |
279 size_executable_ = 0; | 282 size_executable_ = 0; |
280 | 283 |
281 return true; | 284 return true; |
282 } | 285 } |
283 | 286 |
284 | 287 |
285 void MemoryAllocator::TearDown() { | 288 void MemoryAllocator::TearDown() { |
286 // Check that spaces were torn down before MemoryAllocator. | 289 // Check that spaces were torn down before MemoryAllocator. |
287 ASSERT(size_ == 0); | 290 ASSERT(size_ == 0); |
288 // TODO(gc) this will be true again when we fix FreeMemory. | 291 ASSERT(size_executable_ == 0); |
289 // ASSERT(size_executable_ == 0); | |
290 capacity_ = 0; | 292 capacity_ = 0; |
291 capacity_executable_ = 0; | 293 capacity_executable_ = 0; |
292 } | 294 } |
293 | 295 |
294 | 296 |
295 void MemoryAllocator::FreeMemory(VirtualMemory* reservation, | 297 void MemoryAllocator::FreeMemory(VirtualMemory* reservation, |
296 Executability executable) { | 298 Executability executable) { |
297 // TODO(gc) make code_range part of memory allocator? | 299 // TODO(gc) make code_range part of memory allocator? |
298 ASSERT(reservation->IsReserved()); | 300 ASSERT(reservation->IsReserved()); |
299 size_t size = reservation->size(); | 301 size_t size = reservation->size(); |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
332 isolate_->code_range()->FreeRawMemory(base, size); | 334 isolate_->code_range()->FreeRawMemory(base, size); |
333 } else { | 335 } else { |
334 ASSERT(executable == NOT_EXECUTABLE || !isolate_->code_range()->exists()); | 336 ASSERT(executable == NOT_EXECUTABLE || !isolate_->code_range()->exists()); |
335 bool result = VirtualMemory::ReleaseRegion(base, size); | 337 bool result = VirtualMemory::ReleaseRegion(base, size); |
336 USE(result); | 338 USE(result); |
337 ASSERT(result); | 339 ASSERT(result); |
338 } | 340 } |
339 } | 341 } |
340 | 342 |
341 | 343 |
342 Address MemoryAllocator::ReserveAlignedMemory(size_t size, | 344 Address MemoryAllocator::ReserveAlignedMemory(size_t requested, |
343 size_t alignment, | 345 size_t alignment, |
346 Executability executable, | |
344 VirtualMemory* controller) { | 347 VirtualMemory* controller) { |
345 VirtualMemory reservation(size, alignment); | 348 VirtualMemory reservation(requested, alignment); |
349 if (!reservation.IsReserved()) return NULL; | |
346 | 350 |
347 if (!reservation.IsReserved()) return NULL; | 351 Address base = static_cast<Address>(reservation.address()); |
348 size_ += reservation.size(); | 352 size_ += reservation.size(); |
349 Address base = RoundUp(static_cast<Address>(reservation.address()), | 353 if (executable == EXECUTABLE) { |
danno
2013/01/15 09:41:18
It seems that you've removed the logic that rounds
haitao.feng
2013/01/16 13:02:06
This RoundUp is done in the reservation(requested,
| |
350 alignment); | 354 size_executable_ += reservation.size(); |
355 } | |
356 | |
351 controller->TakeControl(&reservation); | 357 controller->TakeControl(&reservation); |
352 return base; | 358 return base; |
353 } | 359 } |
354 | 360 |
355 | 361 |
356 Address MemoryAllocator::AllocateAlignedMemory(size_t size, | 362 Address MemoryAllocator::CommitAlignedMemory(VirtualMemory* reservation, |
357 size_t alignment, | 363 Executability executable) { |
358 Executability executable, | 364 Address base = static_cast<Address>(reservation->address()); |
359 VirtualMemory* controller) { | |
360 VirtualMemory reservation; | |
361 Address base = ReserveAlignedMemory(size, alignment, &reservation); | |
362 if (base == NULL) return NULL; | 365 if (base == NULL) return NULL; |
363 | 366 |
367 size_t size = reservation->size(); | |
368 | |
364 if (executable == EXECUTABLE) { | 369 if (executable == EXECUTABLE) { |
365 if (!CommitCodePage(&reservation, base, size)) { | 370 if (!CommitCodePage(reservation, base, size)) { |
366 base = NULL; | 371 base = NULL; |
367 } | 372 } |
368 } else { | 373 } else { |
369 if (!reservation.Commit(base, size, false)) { | 374 if (!reservation->Commit(base, size, false)) { |
370 base = NULL; | 375 base = NULL; |
371 } | 376 } |
372 } | 377 } |
373 | 378 |
374 if (base == NULL) { | 379 if (base == NULL) { |
375 // Failed to commit the body. Release the mapping and any partially | 380 // Failed to commit the body. Release the mapping and any partially |
376 // commited regions inside it. | 381 // commited regions inside it. |
377 reservation.Release(); | 382 reservation->Release(); |
378 return NULL; | 383 return NULL; |
379 } | 384 } |
380 | 385 |
386 return base; | |
387 } | |
388 | |
389 | |
390 Address MemoryAllocator::AllocateAlignedMemory(size_t size, | |
391 size_t alignment, | |
392 Executability executable, | |
393 VirtualMemory* controller) { | |
394 VirtualMemory reservation; | |
395 Address base = ReserveAlignedMemory(size, | |
396 alignment, | |
397 executable, | |
398 &reservation); | |
399 base = CommitAlignedMemory(&reservation, executable); | |
381 controller->TakeControl(&reservation); | 400 controller->TakeControl(&reservation); |
382 return base; | 401 return base; |
383 } | 402 } |
384 | 403 |
385 | 404 |
386 void Page::InitializeAsAnchor(PagedSpace* owner) { | 405 void Page::InitializeAsAnchor(PagedSpace* owner) { |
387 set_owner(owner); | 406 set_owner(owner); |
388 set_prev_page(this); | 407 set_prev_page(this); |
389 set_next_page(this); | 408 set_next_page(this); |
390 } | 409 } |
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
483 heap_->decrement_scan_on_scavenge_pages(); | 502 heap_->decrement_scan_on_scavenge_pages(); |
484 ClearFlag(SCAN_ON_SCAVENGE); | 503 ClearFlag(SCAN_ON_SCAVENGE); |
485 } | 504 } |
486 next_chunk_->prev_chunk_ = prev_chunk_; | 505 next_chunk_->prev_chunk_ = prev_chunk_; |
487 prev_chunk_->next_chunk_ = next_chunk_; | 506 prev_chunk_->next_chunk_ = next_chunk_; |
488 prev_chunk_ = NULL; | 507 prev_chunk_ = NULL; |
489 next_chunk_ = NULL; | 508 next_chunk_ = NULL; |
490 } | 509 } |
491 | 510 |
492 | 511 |
493 MemoryChunk* MemoryAllocator::AllocateChunk(intptr_t body_size, | 512 Address MemoryAllocator::ReserveChunk(size_t body_size, |
494 Executability executable, | 513 Executability executable, |
495 Space* owner) { | 514 VirtualMemory* controller) { |
496 size_t chunk_size; | 515 size_t chunk_size; |
497 Heap* heap = isolate_->heap(); | |
498 Address base = NULL; | 516 Address base = NULL; |
499 VirtualMemory reservation; | 517 VirtualMemory reservation; |
500 Address area_start = NULL; | |
501 Address area_end = NULL; | |
502 | 518 |
503 if (executable == EXECUTABLE) { | 519 if (executable == EXECUTABLE) { |
504 chunk_size = RoundUp(CodePageAreaStartOffset() + body_size, | 520 chunk_size = RoundUp(CodePageAreaStartOffset() + body_size, |
505 OS::CommitPageSize()) + CodePageGuardSize(); | 521 OS::CommitPageSize()) + CodePageGuardSize(); |
506 | 522 |
507 // Check executable memory limit. | 523 // Check executable memory limit. |
508 if (size_executable_ + chunk_size > capacity_executable_) { | 524 if (size_executable_ + chunk_size > capacity_executable_) { |
509 LOG(isolate_, | 525 LOG(isolate_, |
510 StringEvent("MemoryAllocator::AllocateRawMemory", | 526 StringEvent("MemoryAllocator::AllocateRawMemory", |
511 "V8 Executable Allocation capacity exceeded")); | 527 "V8 Executable Allocation capacity exceeded")); |
512 return NULL; | 528 return NULL; |
513 } | 529 } |
514 | 530 |
515 // Allocate executable memory either from code range or from the | 531 // Reserve executable chunk from the OS. |
516 // OS. | 532 base = ReserveAlignedMemory(chunk_size, |
517 if (isolate_->code_range()->exists()) { | 533 MemoryChunk::kAlignment, |
518 base = isolate_->code_range()->AllocateRawMemory(chunk_size, &chunk_size); | 534 EXECUTABLE, |
519 ASSERT(IsAligned(reinterpret_cast<intptr_t>(base), | 535 &reservation); |
520 MemoryChunk::kAlignment)); | |
521 if (base == NULL) return NULL; | |
522 size_ += chunk_size; | |
523 // Update executable memory size. | |
524 size_executable_ += chunk_size; | |
525 } else { | |
526 base = AllocateAlignedMemory(chunk_size, | |
527 MemoryChunk::kAlignment, | |
528 executable, | |
529 &reservation); | |
530 if (base == NULL) return NULL; | |
531 // Update executable memory size. | |
532 size_executable_ += reservation.size(); | |
533 } | |
534 | |
535 if (Heap::ShouldZapGarbage()) { | |
536 ZapBlock(base, CodePageGuardStartOffset()); | |
537 ZapBlock(base + CodePageAreaStartOffset(), body_size); | |
538 } | |
539 | |
540 area_start = base + CodePageAreaStartOffset(); | |
541 area_end = area_start + body_size; | |
542 } else { | 536 } else { |
543 chunk_size = MemoryChunk::kObjectStartOffset + body_size; | 537 chunk_size = MemoryChunk::kObjectStartOffset + body_size; |
544 base = AllocateAlignedMemory(chunk_size, | 538 base = ReserveAlignedMemory(chunk_size, |
danno
2013/01/15 09:41:18
Please move the Reserve call after the if {} else
| |
545 MemoryChunk::kAlignment, | 539 MemoryChunk::kAlignment, |
546 executable, | 540 NOT_EXECUTABLE, |
547 &reservation); | 541 &reservation); |
548 | |
549 if (base == NULL) return NULL; | |
550 | |
551 if (Heap::ShouldZapGarbage()) { | |
552 ZapBlock(base, chunk_size); | |
553 } | |
554 | |
555 area_start = base + Page::kObjectStartOffset; | |
556 area_end = base + chunk_size; | |
557 } | 542 } |
558 | 543 |
544 controller->TakeControl(&reservation); | |
545 return base; | |
546 } | |
547 | |
548 | |
549 Address MemoryAllocator::ReserveChunk(size_t body_size, size_t* reserved) { | |
550 // Reserve chunk from the code range. | |
551 ASSERT(isolate_->code_range()->exists()); | |
552 size_t chunk_size = RoundUp(CodePageAreaStartOffset() + body_size, | |
553 OS::CommitPageSize()) + CodePageGuardSize(); | |
554 Address base = isolate_->code_range()->AllocateRawMemory(chunk_size, | |
555 reserved, | |
556 false); | |
557 ASSERT(IsAligned(reinterpret_cast<intptr_t>(base), MemoryChunk::kAlignment)); | |
558 size_ += *reserved; | |
559 size_executable_ += *reserved; | |
560 return base; | |
561 } | |
562 | |
563 | |
564 MemoryChunk* MemoryAllocator::CommitChunkShared(Heap* heap, | |
565 Address base, | |
566 size_t chunk_size, | |
567 Address area_start, | |
568 Address area_end, | |
569 Executability executable, | |
570 Space* owner, | |
571 VirtualMemory* reservation) { | |
559 isolate_->counters()->memory_allocated()-> | 572 isolate_->counters()->memory_allocated()-> |
560 Increment(static_cast<int>(chunk_size)); | 573 Increment(static_cast<int>(chunk_size)); |
561 | 574 |
562 LOG(isolate_, NewEvent("MemoryChunk", base, chunk_size)); | 575 LOG(isolate_, NewEvent("MemoryChunk", base, chunk_size)); |
563 if (owner != NULL) { | 576 if (owner != NULL) { |
564 ObjectSpace space = static_cast<ObjectSpace>(1 << owner->identity()); | 577 ObjectSpace space = static_cast<ObjectSpace>(1 << owner->identity()); |
565 PerformAllocationCallback(space, kAllocationActionAllocate, chunk_size); | 578 PerformAllocationCallback(space, kAllocationActionAllocate, chunk_size); |
566 } | 579 } |
567 | 580 |
568 MemoryChunk* result = MemoryChunk::Initialize(heap, | 581 MemoryChunk* result = MemoryChunk::Initialize(heap, |
569 base, | 582 base, |
570 chunk_size, | 583 chunk_size, |
571 area_start, | 584 area_start, |
572 area_end, | 585 area_end, |
573 executable, | 586 executable, |
574 owner); | 587 owner); |
575 result->set_reserved_memory(&reservation); | 588 result->set_reserved_memory(reservation); |
576 return result; | 589 return result; |
577 } | 590 } |
578 | 591 |
579 | 592 |
593 MemoryChunk* MemoryAllocator::CommitChunk(size_t body_size, | |
594 Executability executable, | |
595 VirtualMemory* reservation, | |
596 Space* owner) { | |
597 Address base = CommitAlignedMemory(reservation, executable); | |
598 if (base == NULL) return NULL; | |
599 | |
600 size_t chunk_size = reservation->size(); | |
601 Address area_start = NULL; | |
602 Address area_end = NULL; | |
603 Heap* heap = isolate_->heap(); | |
604 | |
605 if (executable == EXECUTABLE) { | |
606 if (Heap::ShouldZapGarbage()) { | |
607 ZapBlock(base, CodePageGuardStartOffset()); | |
608 ZapBlock(base + CodePageAreaStartOffset(), body_size); | |
609 } | |
610 | |
611 area_start = base + CodePageAreaStartOffset(); | |
612 area_end = area_start + body_size; | |
613 } else { | |
614 if (Heap::ShouldZapGarbage()) { | |
615 ZapBlock(base, chunk_size); | |
616 } | |
617 | |
618 area_start = base + Page::kObjectStartOffset; | |
619 area_end = base + chunk_size; | |
620 } | |
621 | |
622 return CommitChunkShared(heap, | |
623 base, | |
624 chunk_size, | |
625 area_start, | |
626 area_end, | |
627 executable, | |
628 owner, | |
629 reservation); | |
630 } | |
631 | |
632 | |
633 MemoryChunk* MemoryAllocator::CommitChunk(size_t body_size, | |
634 Address base, | |
635 size_t chunk_size, | |
636 Space* owner) { | |
637 ASSERT(isolate_->code_range()->exists()); | |
638 if (base == NULL) return NULL; | |
639 | |
640 if (!isolate_->code_range()->CommitRawMemory(base, chunk_size)) { | |
641 return NULL; | |
642 } | |
643 | |
644 Address area_start = NULL; | |
645 Address area_end = NULL; | |
646 Heap* heap = isolate_->heap(); | |
647 VirtualMemory empty; | |
648 | |
649 if (Heap::ShouldZapGarbage()) { | |
650 ZapBlock(base, CodePageGuardStartOffset()); | |
651 ZapBlock(base + CodePageAreaStartOffset(), body_size); | |
652 } | |
653 | |
654 area_start = base + CodePageAreaStartOffset(); | |
655 area_end = area_start + body_size; | |
656 | |
657 return CommitChunkShared(heap, | |
658 base, | |
659 chunk_size, | |
660 area_start, | |
661 area_end, | |
662 EXECUTABLE, | |
663 owner, | |
664 &empty); | |
665 } | |
666 | |
667 | |
668 MemoryChunk* MemoryAllocator::AllocateChunk(intptr_t body_size, | |
669 Executability executable, | |
670 Space* owner) { | |
671 if ((executable == EXECUTABLE) && isolate_->code_range()->exists()) { | |
672 size_t chunk_size; | |
673 Address base = ReserveChunk(body_size, &chunk_size); | |
674 return CommitChunk(body_size, base, chunk_size, owner); | |
675 } else { | |
676 VirtualMemory reservation; | |
677 Address base = ReserveChunk(body_size, executable, &reservation); | |
678 if (base == NULL) return NULL; | |
679 return CommitChunk(body_size, executable, &reservation, owner); | |
680 } | |
681 } | |
682 | |
683 | |
580 Page* MemoryAllocator::AllocatePage(intptr_t size, | 684 Page* MemoryAllocator::AllocatePage(intptr_t size, |
581 PagedSpace* owner, | 685 PagedSpace* owner, |
582 Executability executable) { | 686 Executability executable) { |
583 MemoryChunk* chunk = AllocateChunk(size, executable, owner); | 687 MemoryChunk* chunk = AllocateChunk(size, executable, owner); |
584 | 688 |
585 if (chunk == NULL) return NULL; | 689 if (chunk == NULL) return NULL; |
586 | 690 |
587 return Page::Initialize(isolate_->heap(), chunk, executable, owner); | 691 return Page::Initialize(isolate_->heap(), chunk, executable, owner); |
588 } | 692 } |
589 | 693 |
(...skipping 471 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1061 int maximum_semispace_capacity) { | 1165 int maximum_semispace_capacity) { |
1062 // Set up new space based on the preallocated memory block defined by | 1166 // Set up new space based on the preallocated memory block defined by |
1063 // start and size. The provided space is divided into two semi-spaces. | 1167 // start and size. The provided space is divided into two semi-spaces. |
1064 // To support fast containment testing in the new space, the size of | 1168 // To support fast containment testing in the new space, the size of |
1065 // this chunk must be a power of two and it must be aligned to its size. | 1169 // this chunk must be a power of two and it must be aligned to its size. |
1066 int initial_semispace_capacity = heap()->InitialSemiSpaceSize(); | 1170 int initial_semispace_capacity = heap()->InitialSemiSpaceSize(); |
1067 | 1171 |
1068 size_t size = 2 * reserved_semispace_capacity; | 1172 size_t size = 2 * reserved_semispace_capacity; |
1069 Address base = | 1173 Address base = |
1070 heap()->isolate()->memory_allocator()->ReserveAlignedMemory( | 1174 heap()->isolate()->memory_allocator()->ReserveAlignedMemory( |
1071 size, size, &reservation_); | 1175 size, size, NOT_EXECUTABLE, &reservation_); |
1072 if (base == NULL) return false; | 1176 if (base == NULL) return false; |
1073 | 1177 |
1074 chunk_base_ = base; | 1178 chunk_base_ = base; |
1075 chunk_size_ = static_cast<uintptr_t>(size); | 1179 chunk_size_ = static_cast<uintptr_t>(size); |
1076 LOG(heap()->isolate(), NewEvent("InitialChunk", chunk_base_, chunk_size_)); | 1180 LOG(heap()->isolate(), NewEvent("InitialChunk", chunk_base_, chunk_size_)); |
1077 | 1181 |
1078 ASSERT(initial_semispace_capacity <= maximum_semispace_capacity); | 1182 ASSERT(initial_semispace_capacity <= maximum_semispace_capacity); |
1079 ASSERT(IsPowerOf2(maximum_semispace_capacity)); | 1183 ASSERT(IsPowerOf2(maximum_semispace_capacity)); |
1080 | 1184 |
1081 // Allocate and set up the histogram arrays if necessary. | 1185 // Allocate and set up the histogram arrays if necessary. |
(...skipping 1904 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2986 object->ShortPrint(); | 3090 object->ShortPrint(); |
2987 PrintF("\n"); | 3091 PrintF("\n"); |
2988 } | 3092 } |
2989 printf(" --------------------------------------\n"); | 3093 printf(" --------------------------------------\n"); |
2990 printf(" Marked: %x, LiveCount: %x\n", mark_size, LiveBytes()); | 3094 printf(" Marked: %x, LiveCount: %x\n", mark_size, LiveBytes()); |
2991 } | 3095 } |
2992 | 3096 |
2993 #endif // DEBUG | 3097 #endif // DEBUG |
2994 | 3098 |
2995 } } // namespace v8::internal | 3099 } } // namespace v8::internal |
OLD | NEW |