| 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 668 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 679 int size = source_->GetInt() << kObjectAlignmentBits; | 679 int size = source_->GetInt() << kObjectAlignmentBits; |
| 680 Address address = Allocate(space_number, space, size); | 680 Address address = Allocate(space_number, space, size); |
| 681 *write_back = HeapObject::FromAddress(address); | 681 *write_back = HeapObject::FromAddress(address); |
| 682 Object** current = reinterpret_cast<Object**>(address); | 682 Object** current = reinterpret_cast<Object**>(address); |
| 683 Object** limit = current + (size >> kPointerSizeLog2); | 683 Object** limit = current + (size >> kPointerSizeLog2); |
| 684 if (FLAG_log_snapshot_positions) { | 684 if (FLAG_log_snapshot_positions) { |
| 685 LOG(SnapshotPositionEvent(address, source_->position())); | 685 LOG(SnapshotPositionEvent(address, source_->position())); |
| 686 } | 686 } |
| 687 ReadChunk(current, limit, space_number, address); | 687 ReadChunk(current, limit, space_number, address); |
| 688 | 688 |
| 689 if (space == HEAP->map_space()) { | 689 if (space == space->heap()->map_space()) { |
| 690 ASSERT(size == Map::kSize); | 690 ASSERT(size == Map::kSize); |
| 691 HeapObject* obj = HeapObject::FromAddress(address); | 691 HeapObject* obj = HeapObject::FromAddress(address); |
| 692 Map* map = reinterpret_cast<Map*>(obj); | 692 Map* map = reinterpret_cast<Map*>(obj); |
| 693 if (map->instance_type() == MAP_TYPE) { | 693 map->set_heap(space->heap()); |
| 694 // Meta map has Heap pointer instead of scavenger. | |
| 695 ASSERT(map == map->map()); | |
| 696 map->set_heap(HEAP); | |
| 697 } | |
| 698 } | 694 } |
| 699 } | 695 } |
| 700 | 696 |
| 701 | 697 |
| 702 // This macro is always used with a constant argument so it should all fold | 698 // This macro is always used with a constant argument so it should all fold |
| 703 // away to almost nothing in the generated code. It might be nicer to do this | 699 // away to almost nothing in the generated code. It might be nicer to do this |
| 704 // with the ternary operator but there are type issues with that. | 700 // with the ternary operator but there are type issues with that. |
| 705 #define ASSIGN_DEST_SPACE(space_number) \ | 701 #define ASSIGN_DEST_SPACE(space_number) \ |
| 706 Space* dest_space; \ | 702 Space* dest_space; \ |
| 707 if (space_number == NEW_SPACE) { \ | 703 if (space_number == NEW_SPACE) { \ |
| (...skipping 798 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1506 fullness_[space] = RoundUp(fullness_[space], Page::kPageSize); | 1502 fullness_[space] = RoundUp(fullness_[space], Page::kPageSize); |
| 1507 } | 1503 } |
| 1508 } | 1504 } |
| 1509 int allocation_address = fullness_[space]; | 1505 int allocation_address = fullness_[space]; |
| 1510 fullness_[space] = allocation_address + size; | 1506 fullness_[space] = allocation_address + size; |
| 1511 return allocation_address; | 1507 return allocation_address; |
| 1512 } | 1508 } |
| 1513 | 1509 |
| 1514 | 1510 |
| 1515 } } // namespace v8::internal | 1511 } } // namespace v8::internal |
| OLD | NEW |