| 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 975 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 986 ReferenceRepresentation reference_representation) { | 986 ReferenceRepresentation reference_representation) { |
| 987 CHECK(o->IsHeapObject()); | 987 CHECK(o->IsHeapObject()); |
| 988 HeapObject* heap_object = HeapObject::cast(o); | 988 HeapObject* heap_object = HeapObject::cast(o); |
| 989 if (partial_) { | 989 if (partial_) { |
| 990 int root_index = RootIndex(heap_object); | 990 int root_index = RootIndex(heap_object); |
| 991 if (root_index != kInvalidRootIndex) { | 991 if (root_index != kInvalidRootIndex) { |
| 992 sink_->Put(ROOT_SERIALIZATION, "RootSerialization"); | 992 sink_->Put(ROOT_SERIALIZATION, "RootSerialization"); |
| 993 sink_->PutInt(root_index, "root_index"); | 993 sink_->PutInt(root_index, "root_index"); |
| 994 return; | 994 return; |
| 995 } | 995 } |
| 996 // TODO(erikcorry): Handle symbols here. | 996 // All the symbols that the snapshot needs should be in the root table. |
| 997 ASSERT(!heap_object->IsSymbol()); |
| 997 } | 998 } |
| 998 if (SerializationAddressMapper::IsMapped(heap_object)) { | 999 if (SerializationAddressMapper::IsMapped(heap_object)) { |
| 999 int space = SpaceOfAlreadySerializedObject(heap_object); | 1000 int space = SpaceOfAlreadySerializedObject(heap_object); |
| 1000 int address = SerializationAddressMapper::MappedTo(heap_object); | 1001 int address = SerializationAddressMapper::MappedTo(heap_object); |
| 1001 int offset = CurrentAllocationAddress(space) - address; | 1002 int offset = CurrentAllocationAddress(space) - address; |
| 1002 bool from_start = true; | 1003 bool from_start = true; |
| 1003 if (SpaceIsPaged(space)) { | 1004 if (SpaceIsPaged(space)) { |
| 1004 if ((CurrentAllocationAddress(space) >> kPageSizeBits) == | 1005 if ((CurrentAllocationAddress(space) >> kPageSizeBits) == |
| 1005 (address >> kPageSizeBits)) { | 1006 (address >> kPageSizeBits)) { |
| 1006 from_start = false; | 1007 from_start = false; |
| (...skipping 243 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1250 fullness_[space] = RoundUp(fullness_[space], Page::kPageSize); | 1251 fullness_[space] = RoundUp(fullness_[space], Page::kPageSize); |
| 1251 } | 1252 } |
| 1252 } | 1253 } |
| 1253 int allocation_address = fullness_[space]; | 1254 int allocation_address = fullness_[space]; |
| 1254 fullness_[space] = allocation_address + size; | 1255 fullness_[space] = allocation_address + size; |
| 1255 return allocation_address; | 1256 return allocation_address; |
| 1256 } | 1257 } |
| 1257 | 1258 |
| 1258 | 1259 |
| 1259 } } // namespace v8::internal | 1260 } } // namespace v8::internal |
| OLD | NEW |