| 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 695 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 706 Object** write_back) { | 706 Object** write_back) { |
| 707 int size = source_->GetInt() << kObjectAlignmentBits; | 707 int size = source_->GetInt() << kObjectAlignmentBits; |
| 708 Address address = Allocate(space_number, space, size); | 708 Address address = Allocate(space_number, space, size); |
| 709 *write_back = HeapObject::FromAddress(address); | 709 *write_back = HeapObject::FromAddress(address); |
| 710 Object** current = reinterpret_cast<Object**>(address); | 710 Object** current = reinterpret_cast<Object**>(address); |
| 711 Object** limit = current + (size >> kPointerSizeLog2); | 711 Object** limit = current + (size >> kPointerSizeLog2); |
| 712 if (FLAG_log_snapshot_positions) { | 712 if (FLAG_log_snapshot_positions) { |
| 713 LOG(SnapshotPositionEvent(address, source_->position())); | 713 LOG(SnapshotPositionEvent(address, source_->position())); |
| 714 } | 714 } |
| 715 ReadChunk(current, limit, space_number, address); | 715 ReadChunk(current, limit, space_number, address); |
| 716 | |
| 717 if (space_number == MAP_SPACE) { | |
| 718 ASSERT(size == Map::kSize); | |
| 719 HeapObject* obj = HeapObject::FromAddress(address); | |
| 720 Map* map = reinterpret_cast<Map*>(obj); | |
| 721 map->set_heap(isolate_->heap()); | |
| 722 } | |
| 723 } | 716 } |
| 724 | 717 |
| 725 | 718 |
| 726 // This macro is always used with a constant argument so it should all fold | 719 // This macro is always used with a constant argument so it should all fold |
| 727 // away to almost nothing in the generated code. It might be nicer to do this | 720 // away to almost nothing in the generated code. It might be nicer to do this |
| 728 // with the ternary operator but there are type issues with that. | 721 // with the ternary operator but there are type issues with that. |
| 729 #define ASSIGN_DEST_SPACE(space_number) \ | 722 #define ASSIGN_DEST_SPACE(space_number) \ |
| 730 Space* dest_space; \ | 723 Space* dest_space; \ |
| 731 if (space_number == NEW_SPACE) { \ | 724 if (space_number == NEW_SPACE) { \ |
| 732 dest_space = isolate->heap()->new_space(); \ | 725 dest_space = isolate->heap()->new_space(); \ |
| (...skipping 804 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1537 fullness_[space] = RoundUp(fullness_[space], Page::kPageSize); | 1530 fullness_[space] = RoundUp(fullness_[space], Page::kPageSize); |
| 1538 } | 1531 } |
| 1539 } | 1532 } |
| 1540 int allocation_address = fullness_[space]; | 1533 int allocation_address = fullness_[space]; |
| 1541 fullness_[space] = allocation_address + size; | 1534 fullness_[space] = allocation_address + size; |
| 1542 return allocation_address; | 1535 return allocation_address; |
| 1543 } | 1536 } |
| 1544 | 1537 |
| 1545 | 1538 |
| 1546 } } // namespace v8::internal | 1539 } } // namespace v8::internal |
| OLD | NEW |