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 419 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
430 chunk->flags_ = 0; | 430 chunk->flags_ = 0; |
431 chunk->set_owner(owner); | 431 chunk->set_owner(owner); |
432 chunk->InitializeReservedMemory(); | 432 chunk->InitializeReservedMemory(); |
433 chunk->slots_buffer_ = NULL; | 433 chunk->slots_buffer_ = NULL; |
434 chunk->skip_list_ = NULL; | 434 chunk->skip_list_ = NULL; |
435 Bitmap::Clear(chunk); | 435 Bitmap::Clear(chunk); |
436 chunk->initialize_scan_on_scavenge(false); | 436 chunk->initialize_scan_on_scavenge(false); |
437 chunk->SetFlag(WAS_SWEPT_PRECISELY); | 437 chunk->SetFlag(WAS_SWEPT_PRECISELY); |
438 | 438 |
439 ASSERT(OFFSET_OF(MemoryChunk, flags_) == kFlagsOffset); | 439 ASSERT(OFFSET_OF(MemoryChunk, flags_) == kFlagsOffset); |
| 440 ASSERT(OFFSET_OF(MemoryChunk, live_byte_count_) == kLiveBytesOffset); |
440 | 441 |
441 if (executable == EXECUTABLE) chunk->SetFlag(IS_EXECUTABLE); | 442 if (executable == EXECUTABLE) chunk->SetFlag(IS_EXECUTABLE); |
442 | 443 |
443 if (owner == heap->old_data_space()) chunk->SetFlag(CONTAINS_ONLY_DATA); | 444 if (owner == heap->old_data_space()) chunk->SetFlag(CONTAINS_ONLY_DATA); |
444 | 445 |
445 return chunk; | 446 return chunk; |
446 } | 447 } |
447 | 448 |
448 | 449 |
449 void MemoryChunk::InsertAfter(MemoryChunk* other) { | 450 void MemoryChunk::InsertAfter(MemoryChunk* other) { |
(...skipping 365 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
815 // All the interior pointers should be contained in the heap. | 816 // All the interior pointers should be contained in the heap. |
816 int size = object->Size(); | 817 int size = object->Size(); |
817 object->IterateBody(map->instance_type(), size, visitor); | 818 object->IterateBody(map->instance_type(), size, visitor); |
818 if (Marking::IsBlack(Marking::MarkBitFrom(object))) { | 819 if (Marking::IsBlack(Marking::MarkBitFrom(object))) { |
819 black_size += size; | 820 black_size += size; |
820 } | 821 } |
821 | 822 |
822 ASSERT(object->address() + size <= top); | 823 ASSERT(object->address() + size <= top); |
823 end_of_previous_object = object->address() + size; | 824 end_of_previous_object = object->address() + size; |
824 } | 825 } |
825 // TODO(1672): Page live bytes are off for some tests. | 826 CHECK_LE(black_size, page->LiveBytes()); |
826 // CHECK_LE(black_size, page->LiveBytes()); | |
827 } | 827 } |
828 } | 828 } |
829 #endif | 829 #endif |
830 | 830 |
831 | 831 |
832 // ----------------------------------------------------------------------------- | 832 // ----------------------------------------------------------------------------- |
833 // NewSpace implementation | 833 // NewSpace implementation |
834 | 834 |
835 | 835 |
836 bool NewSpace::Setup(int reserved_semispace_capacity, | 836 bool NewSpace::Setup(int reserved_semispace_capacity, |
(...skipping 1663 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2500 for (HeapObject* obj = obj_it.Next(); obj != NULL; obj = obj_it.Next()) { | 2500 for (HeapObject* obj = obj_it.Next(); obj != NULL; obj = obj_it.Next()) { |
2501 if (obj->IsCode()) { | 2501 if (obj->IsCode()) { |
2502 Code* code = Code::cast(obj); | 2502 Code* code = Code::cast(obj); |
2503 isolate->code_kind_statistics()[code->kind()] += code->Size(); | 2503 isolate->code_kind_statistics()[code->kind()] += code->Size(); |
2504 } | 2504 } |
2505 } | 2505 } |
2506 } | 2506 } |
2507 #endif // DEBUG | 2507 #endif // DEBUG |
2508 | 2508 |
2509 } } // namespace v8::internal | 2509 } } // namespace v8::internal |
OLD | NEW |