| 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 521 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 532 } else if (space_index == kLargeFixedArray) { | 532 } else if (space_index == kLargeFixedArray) { |
| 533 new_allocation = lo_space->AllocateRawFixedArray(size); | 533 new_allocation = lo_space->AllocateRawFixedArray(size); |
| 534 } else { | 534 } else { |
| 535 ASSERT_EQ(kLargeCode, space_index); | 535 ASSERT_EQ(kLargeCode, space_index); |
| 536 new_allocation = lo_space->AllocateRawCode(size); | 536 new_allocation = lo_space->AllocateRawCode(size); |
| 537 } | 537 } |
| 538 ASSERT(!new_allocation->IsFailure()); | 538 ASSERT(!new_allocation->IsFailure()); |
| 539 HeapObject* new_object = HeapObject::cast(new_allocation); | 539 HeapObject* new_object = HeapObject::cast(new_allocation); |
| 540 // Record all large objects in the same space. | 540 // Record all large objects in the same space. |
| 541 address = new_object->address(); | 541 address = new_object->address(); |
| 542 high_water_[LO_SPACE] = address + size; | 542 pages_[LO_SPACE].Add(address); |
| 543 } | 543 } |
| 544 last_object_address_ = address; | 544 last_object_address_ = address; |
| 545 return address; | 545 return address; |
| 546 } | 546 } |
| 547 | 547 |
| 548 | 548 |
| 549 // This returns the address of an object that has been described in the | 549 // This returns the address of an object that has been described in the |
| 550 // snapshot as being offset bytes back in a particular space. | 550 // snapshot as being offset bytes back in a particular space. |
| 551 HeapObject* Deserializer::GetAddressFromEnd(int space) { | 551 HeapObject* Deserializer::GetAddressFromEnd(int space) { |
| 552 int offset = source_->GetInt(); | 552 int offset = source_->GetInt(); |
| (...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 658 case (base_tag) + kLargeCode: /* NOLINT */ \ | 658 case (base_tag) + kLargeCode: /* NOLINT */ \ |
| 659 case (base_tag) + kLargeFixedArray: /* NOLINT */ | 659 case (base_tag) + kLargeFixedArray: /* NOLINT */ |
| 660 | 660 |
| 661 | 661 |
| 662 void Deserializer::ReadChunk(Object** current, | 662 void Deserializer::ReadChunk(Object** current, |
| 663 Object** limit, | 663 Object** limit, |
| 664 int space, | 664 int space, |
| 665 Address address) { | 665 Address address) { |
| 666 while (current < limit) { | 666 while (current < limit) { |
| 667 int data = source_->Get(); | 667 int data = source_->Get(); |
| 668 Trace("Tag", data); |
| 668 switch (data) { | 669 switch (data) { |
| 669 #define RAW_CASE(index, size) \ | 670 #define RAW_CASE(index, size) \ |
| 670 case RAW_DATA_SERIALIZATION + index: { \ | 671 case RAW_DATA_SERIALIZATION + index: { \ |
| 671 byte* raw_data_out = reinterpret_cast<byte*>(current); \ | 672 byte* raw_data_out = reinterpret_cast<byte*>(current); \ |
| 672 source_->CopyRaw(raw_data_out, size); \ | 673 source_->CopyRaw(raw_data_out, size); \ |
| 673 current = reinterpret_cast<Object**>(raw_data_out + size); \ | 674 current = reinterpret_cast<Object**>(raw_data_out + size); \ |
| 674 break; \ | 675 break; \ |
| 675 } | 676 } |
| 676 COMMON_RAW_LENGTHS(RAW_CASE) | 677 COMMON_RAW_LENGTHS(RAW_CASE) |
| 677 #undef RAW_CASE | 678 #undef RAW_CASE |
| (...skipping 672 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1350 if (used_in_this_page + size > Page::kObjectAreaSize) { | 1351 if (used_in_this_page + size > Page::kObjectAreaSize) { |
| 1351 *new_page = true; | 1352 *new_page = true; |
| 1352 fullness_[space] = RoundUp(fullness_[space], Page::kPageSize); | 1353 fullness_[space] = RoundUp(fullness_[space], Page::kPageSize); |
| 1353 } | 1354 } |
| 1354 } | 1355 } |
| 1355 int allocation_address = fullness_[space]; | 1356 int allocation_address = fullness_[space]; |
| 1356 fullness_[space] = allocation_address + size; | 1357 fullness_[space] = allocation_address + size; |
| 1357 return allocation_address; | 1358 return allocation_address; |
| 1358 } | 1359 } |
| 1359 | 1360 |
| 1361 bool SerializerDeserializer::tracing_; |
| 1362 |
| 1360 | 1363 |
| 1361 } } // namespace v8::internal | 1364 } } // namespace v8::internal |
| OLD | NEW |