Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(391)

Side by Side Diff: src/serialize.cc

Issue 9295047: Revert 10542 (boot time memory reduction) due to map alignment (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 8 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/mark-compact.cc ('k') | src/snapshot.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 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 594 matching lines...) Expand 10 before | Expand all | Expand 10 after
605 ASSERT_EQ(kLargeCode, space_index); 605 ASSERT_EQ(kLargeCode, space_index);
606 new_allocation = 606 new_allocation =
607 lo_space->AllocateRaw(size, EXECUTABLE)->ToObjectUnchecked(); 607 lo_space->AllocateRaw(size, EXECUTABLE)->ToObjectUnchecked();
608 } 608 }
609 HeapObject* new_object = HeapObject::cast(new_allocation); 609 HeapObject* new_object = HeapObject::cast(new_allocation);
610 // Record all large objects in the same space. 610 // Record all large objects in the same space.
611 address = new_object->address(); 611 address = new_object->address();
612 pages_[LO_SPACE].Add(address); 612 pages_[LO_SPACE].Add(address);
613 } 613 }
614 last_object_address_ = address; 614 last_object_address_ = address;
615 ASSERT(address >= Page::FromAddress(address)->ObjectAreaStart());
616 return address; 615 return address;
617 } 616 }
618 617
619 618
620 // This returns the address of an object that has been described in the 619 // This returns the address of an object that has been described in the
621 // snapshot as being offset bytes back in a particular space. 620 // snapshot as being offset bytes back in a particular space.
622 HeapObject* Deserializer::GetAddressFromEnd(int space) { 621 HeapObject* Deserializer::GetAddressFromEnd(int space) {
623 int offset = source_->GetInt(); 622 int offset = source_->GetInt();
624 ASSERT(!SpaceIsLarge(space)); 623 ASSERT(!SpaceIsLarge(space));
625 offset <<= kObjectAlignmentBits; 624 offset <<= kObjectAlignmentBits;
626 Address address = high_water_[space] - offset; 625 return HeapObject::FromAddress(high_water_[space] - offset);
627 // This assert will fail if kMinimumSpaceSizes is too small for a space,
628 // because we rely on the fact that all allocation is linear when the VM
629 // is very young.
630 ASSERT(address >= Page::FromAddress(address)->ObjectAreaStart());
631 return HeapObject::FromAddress(address);
632 } 626 }
633 627
634 628
635 // This returns the address of an object that has been described in the 629 // This returns the address of an object that has been described in the
636 // snapshot as being offset bytes into a particular space. 630 // snapshot as being offset bytes into a particular space.
637 HeapObject* Deserializer::GetAddressFromStart(int space) { 631 HeapObject* Deserializer::GetAddressFromStart(int space) {
638 int offset = source_->GetInt(); 632 int offset = source_->GetInt();
639 if (SpaceIsLarge(space)) { 633 if (SpaceIsLarge(space)) {
640 // Large spaces have one object per 'page'. 634 // Large spaces have one object per 'page'.
641 return HeapObject::FromAddress(pages_[LO_SPACE][offset]); 635 return HeapObject::FromAddress(pages_[LO_SPACE][offset]);
(...skipping 1012 matching lines...) Expand 10 before | Expand all | Expand 10 after
1654 fullness_[space] = RoundUp(fullness_[space], Page::kPageSize); 1648 fullness_[space] = RoundUp(fullness_[space], Page::kPageSize);
1655 } 1649 }
1656 } 1650 }
1657 int allocation_address = fullness_[space]; 1651 int allocation_address = fullness_[space];
1658 fullness_[space] = allocation_address + size; 1652 fullness_[space] = allocation_address + size;
1659 return allocation_address; 1653 return allocation_address;
1660 } 1654 }
1661 1655
1662 1656
1663 } } // namespace v8::internal 1657 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/mark-compact.cc ('k') | src/snapshot.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698