OLD | NEW |
1 // Copyright 2006-2008 the V8 project authors. All rights reserved. | 1 // Copyright 2006-2008 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 662 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
673 Object** write_back) { | 673 Object** write_back) { |
674 int size = source_->GetInt() << kObjectAlignmentBits; | 674 int size = source_->GetInt() << kObjectAlignmentBits; |
675 Address address = Allocate(space_number, space, size); | 675 Address address = Allocate(space_number, space, size); |
676 *write_back = HeapObject::FromAddress(address); | 676 *write_back = HeapObject::FromAddress(address); |
677 Object** current = reinterpret_cast<Object**>(address); | 677 Object** current = reinterpret_cast<Object**>(address); |
678 Object** limit = current + (size >> kPointerSizeLog2); | 678 Object** limit = current + (size >> kPointerSizeLog2); |
679 if (FLAG_log_snapshot_positions) { | 679 if (FLAG_log_snapshot_positions) { |
680 LOG(SnapshotPositionEvent(address, source_->position())); | 680 LOG(SnapshotPositionEvent(address, source_->position())); |
681 } | 681 } |
682 ReadChunk(current, limit, space_number, address); | 682 ReadChunk(current, limit, space_number, address); |
683 | |
684 if (space == Heap::map_space()) { | |
685 ASSERT(size == Map::kSize); | |
686 HeapObject* obj = HeapObject::FromAddress(address); | |
687 Map* map = reinterpret_cast<Map*>(obj); | |
688 map->set_scavenger(Heap::GetScavenger(map->instance_type(), | |
689 map->instance_size())); | |
690 } | |
691 } | 683 } |
692 | 684 |
693 | 685 |
694 // This macro is always used with a constant argument so it should all fold | 686 // This macro is always used with a constant argument so it should all fold |
695 // away to almost nothing in the generated code. It might be nicer to do this | 687 // away to almost nothing in the generated code. It might be nicer to do this |
696 // with the ternary operator but there are type issues with that. | 688 // with the ternary operator but there are type issues with that. |
697 #define ASSIGN_DEST_SPACE(space_number) \ | 689 #define ASSIGN_DEST_SPACE(space_number) \ |
698 Space* dest_space; \ | 690 Space* dest_space; \ |
699 if (space_number == NEW_SPACE) { \ | 691 if (space_number == NEW_SPACE) { \ |
700 dest_space = Heap::new_space(); \ | 692 dest_space = Heap::new_space(); \ |
(...skipping 756 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1457 fullness_[space] = RoundUp(fullness_[space], Page::kPageSize); | 1449 fullness_[space] = RoundUp(fullness_[space], Page::kPageSize); |
1458 } | 1450 } |
1459 } | 1451 } |
1460 int allocation_address = fullness_[space]; | 1452 int allocation_address = fullness_[space]; |
1461 fullness_[space] = allocation_address + size; | 1453 fullness_[space] = allocation_address + size; |
1462 return allocation_address; | 1454 return allocation_address; |
1463 } | 1455 } |
1464 | 1456 |
1465 | 1457 |
1466 } } // namespace v8::internal | 1458 } } // namespace v8::internal |
OLD | NEW |