| Index: src/serialize.cc
|
| ===================================================================
|
| --- src/serialize.cc (revision 2321)
|
| +++ src/serialize.cc (working copy)
|
| @@ -44,11 +44,11 @@
|
|
|
| // Encoding: a RelativeAddress must be able to fit in a pointer:
|
| // it is encoded as an Address with (from MS to LS bits):
|
| -// 27 bits identifying a word in the space, in one of three formats:
|
| -// - MAP and OLD spaces: 16 bits of page number, 11 bits of word offset in page
|
| -// - NEW space: 27 bits of word offset
|
| -// - LO space: 27 bits of page number
|
| -// 3 bits to encode the AllocationSpace (special values for code in LO space)
|
| +// 26 bits identifying a word in the space, in one of three formats:
|
| +// - MAP and OLD spaces: 15 bits of page number, 11 bits of word offset in page
|
| +// - NEW space: 26 bits of word offset
|
| +// - LO space: 26 bits of page number
|
| +// 4 bits to encode the AllocationSpace (special values for code in LO space)
|
| // 2 bits identifying this as a HeapObject
|
|
|
| const int kSpaceShift = kHeapObjectTagSize;
|
| @@ -165,7 +165,8 @@
|
| return space_ == CODE_SPACE ||
|
| space_ == OLD_POINTER_SPACE ||
|
| space_ == OLD_DATA_SPACE ||
|
| - space_ == MAP_SPACE;
|
| + space_ == MAP_SPACE ||
|
| + space_ == GLOBAL_PROPERTY_CELL_SPACE;
|
| }
|
|
|
| void next_address(int offset) { page_offset_ += offset; }
|
| @@ -201,6 +202,7 @@
|
| int result = 0;
|
| switch (space_) {
|
| case MAP_SPACE:
|
| + case GLOBAL_PROPERTY_CELL_SPACE:
|
| case OLD_POINTER_SPACE:
|
| case OLD_DATA_SPACE:
|
| case CODE_SPACE:
|
| @@ -235,6 +237,7 @@
|
| ASSERT(page_offset_ >= 0 && page_index_ >= 0);
|
| switch (space_) {
|
| case MAP_SPACE:
|
| + case GLOBAL_PROPERTY_CELL_SPACE:
|
| case OLD_POINTER_SPACE:
|
| case OLD_DATA_SPACE:
|
| case CODE_SPACE:
|
| @@ -291,6 +294,7 @@
|
| void SimulatedHeapSpace::InitEmptyHeap(AllocationSpace space) {
|
| switch (space) {
|
| case MAP_SPACE:
|
| + case GLOBAL_PROPERTY_CELL_SPACE:
|
| case OLD_POINTER_SPACE:
|
| case OLD_DATA_SPACE:
|
| case CODE_SPACE:
|
| @@ -307,12 +311,15 @@
|
| void SimulatedHeapSpace::InitCurrentHeap(AllocationSpace space) {
|
| switch (space) {
|
| case MAP_SPACE:
|
| + case GLOBAL_PROPERTY_CELL_SPACE:
|
| case OLD_POINTER_SPACE:
|
| case OLD_DATA_SPACE:
|
| case CODE_SPACE: {
|
| PagedSpace* ps;
|
| if (space == MAP_SPACE) {
|
| ps = Heap::map_space();
|
| + } else if (space == GLOBAL_PROPERTY_CELL_SPACE) {
|
| + ps = Heap::global_property_cell_space();
|
| } else if (space == OLD_POINTER_SPACE) {
|
| ps = Heap::old_pointer_space();
|
| } else if (space == OLD_DATA_SPACE) {
|
| @@ -1113,6 +1120,8 @@
|
| writer_->PutInt(Heap::code_space()->Size() + Heap::new_space()->Size());
|
| writer_->PutC('|');
|
| writer_->PutInt(Heap::map_space()->Size());
|
| + writer_->PutC('|');
|
| + writer_->PutInt(Heap::global_property_cell_space()->Size());
|
| writer_->PutC(']');
|
| // Write global handles.
|
| writer_->PutC('G');
|
| @@ -1295,6 +1304,7 @@
|
| Deserializer::Deserializer(const byte* str, int len)
|
| : reader_(str, len),
|
| map_pages_(kInitArraySize),
|
| + global_property_cell_pages_(kInitArraySize),
|
| old_pointer_pages_(kInitArraySize),
|
| old_data_pages_(kInitArraySize),
|
| code_pages_(kInitArraySize),
|
| @@ -1467,6 +1477,9 @@
|
| InitPagedSpace(Heap::code_space(), reader_.GetInt(), &code_pages_);
|
| reader_.ExpectC('|');
|
| InitPagedSpace(Heap::map_space(), reader_.GetInt(), &map_pages_);
|
| + reader_.ExpectC('|');
|
| + InitPagedSpace(Heap::global_property_cell_space(), reader_.GetInt(),
|
| + &global_property_cell_pages_);
|
| reader_.ExpectC(']');
|
| // Create placeholders for global handles later to be fill during
|
| // IterateRoots.
|
| @@ -1599,6 +1612,10 @@
|
| case MAP_SPACE:
|
| return ResolvePaged(PageIndex(encoded), PageOffset(encoded),
|
| Heap::map_space(), &map_pages_);
|
| + case GLOBAL_PROPERTY_CELL_SPACE:
|
| + return ResolvePaged(PageIndex(encoded), PageOffset(encoded),
|
| + Heap::global_property_cell_space(),
|
| + &global_property_cell_pages_);
|
| case OLD_POINTER_SPACE:
|
| return ResolvePaged(PageIndex(encoded), PageOffset(encoded),
|
| Heap::old_pointer_space(), &old_pointer_pages_);
|
|
|