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 679 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
690 // time we need to use it to mark the space at the end of a page free (by | 690 // time we need to use it to mark the space at the end of a page free (by |
691 // making it into a byte array). | 691 // making it into a byte array). |
692 void Deserializer::ReadObject(int space_number, | 692 void Deserializer::ReadObject(int space_number, |
693 Space* space, | 693 Space* space, |
694 Object** write_back) { | 694 Object** write_back) { |
695 int size = source_->GetInt() << kObjectAlignmentBits; | 695 int size = source_->GetInt() << kObjectAlignmentBits; |
696 Address address = Allocate(space_number, space, size); | 696 Address address = Allocate(space_number, space, size); |
697 *write_back = HeapObject::FromAddress(address); | 697 *write_back = HeapObject::FromAddress(address); |
698 Object** current = reinterpret_cast<Object**>(address); | 698 Object** current = reinterpret_cast<Object**>(address); |
699 Object** limit = current + (size >> kPointerSizeLog2); | 699 Object** limit = current + (size >> kPointerSizeLog2); |
700 LOG(SnapshotPositionEvent(address, source_->position())); | |
Erik Corry
2010/01/18 15:47:51
Putting this in an if (FLAG_log_snapshot_positions
| |
700 ReadChunk(current, limit, space_number, address); | 701 ReadChunk(current, limit, space_number, address); |
701 } | 702 } |
702 | 703 |
703 | 704 |
704 #define ONE_CASE_PER_SPACE(base_tag) \ | 705 #define ONE_CASE_PER_SPACE(base_tag) \ |
705 case (base_tag) + NEW_SPACE: /* NOLINT */ \ | 706 case (base_tag) + NEW_SPACE: /* NOLINT */ \ |
706 case (base_tag) + OLD_POINTER_SPACE: /* NOLINT */ \ | 707 case (base_tag) + OLD_POINTER_SPACE: /* NOLINT */ \ |
707 case (base_tag) + OLD_DATA_SPACE: /* NOLINT */ \ | 708 case (base_tag) + OLD_DATA_SPACE: /* NOLINT */ \ |
708 case (base_tag) + CODE_SPACE: /* NOLINT */ \ | 709 case (base_tag) + CODE_SPACE: /* NOLINT */ \ |
709 case (base_tag) + MAP_SPACE: /* NOLINT */ \ | 710 case (base_tag) + MAP_SPACE: /* NOLINT */ \ |
(...skipping 372 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1082 int size = object_->Size(); | 1083 int size = object_->Size(); |
1083 | 1084 |
1084 if (reference_representation_ == TAGGED_REPRESENTATION) { | 1085 if (reference_representation_ == TAGGED_REPRESENTATION) { |
1085 sink_->Put(OBJECT_SERIALIZATION + space, "ObjectSerialization"); | 1086 sink_->Put(OBJECT_SERIALIZATION + space, "ObjectSerialization"); |
1086 } else { | 1087 } else { |
1087 CHECK_EQ(CODE_TARGET_REPRESENTATION, reference_representation_); | 1088 CHECK_EQ(CODE_TARGET_REPRESENTATION, reference_representation_); |
1088 sink_->Put(CODE_OBJECT_SERIALIZATION + space, "ObjectSerialization"); | 1089 sink_->Put(CODE_OBJECT_SERIALIZATION + space, "ObjectSerialization"); |
1089 } | 1090 } |
1090 sink_->PutInt(size >> kObjectAlignmentBits, "Size in words"); | 1091 sink_->PutInt(size >> kObjectAlignmentBits, "Size in words"); |
1091 | 1092 |
1093 LOG(SnapshotPositionEvent(object_->address(), sink_->Position())); | |
1094 | |
1092 // Mark this object as already serialized. | 1095 // Mark this object as already serialized. |
1093 bool start_new_page; | 1096 bool start_new_page; |
1094 SerializationAddressMapper::Map( | 1097 SerializationAddressMapper::Map( |
1095 object_, | 1098 object_, |
1096 serializer_->Allocate(space, size, &start_new_page)); | 1099 serializer_->Allocate(space, size, &start_new_page)); |
1097 if (start_new_page) { | 1100 if (start_new_page) { |
1098 sink_->Put(START_NEW_PAGE_SERIALIZATION, "NewPage"); | 1101 sink_->Put(START_NEW_PAGE_SERIALIZATION, "NewPage"); |
1099 sink_->PutSection(space, "NewPageSpace"); | 1102 sink_->PutSection(space, "NewPageSpace"); |
1100 } | 1103 } |
1101 | 1104 |
(...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1275 fullness_[space] = RoundUp(fullness_[space], Page::kPageSize); | 1278 fullness_[space] = RoundUp(fullness_[space], Page::kPageSize); |
1276 } | 1279 } |
1277 } | 1280 } |
1278 int allocation_address = fullness_[space]; | 1281 int allocation_address = fullness_[space]; |
1279 fullness_[space] = allocation_address + size; | 1282 fullness_[space] = allocation_address + size; |
1280 return allocation_address; | 1283 return allocation_address; |
1281 } | 1284 } |
1282 | 1285 |
1283 | 1286 |
1284 } } // namespace v8::internal | 1287 } } // namespace v8::internal |
OLD | NEW |