OLD | NEW |
1 // Copyright 2016 the V8 project authors. All rights reserved. | 1 // Copyright 2016 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "src/snapshot/deserializer.h" | 5 #include "src/snapshot/deserializer.h" |
6 | 6 |
7 #include "src/bootstrapper.h" | 7 #include "src/bootstrapper.h" |
8 #include "src/external-reference-table.h" | 8 #include "src/external-reference-table.h" |
9 #include "src/heap/heap.h" | 9 #include "src/heap/heap.h" |
10 #include "src/isolate.h" | 10 #include "src/isolate.h" |
(...skipping 294 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
305 // Assign a new script id to avoid collision. | 305 // Assign a new script id to avoid collision. |
306 script->set_id(isolate_->heap()->NextScriptId()); | 306 script->set_id(isolate_->heap()->NextScriptId()); |
307 // Add script to list. | 307 // Add script to list. |
308 Handle<Object> list = WeakFixedArray::Add(factory->script_list(), script); | 308 Handle<Object> list = WeakFixedArray::Add(factory->script_list(), script); |
309 heap->SetRootScriptList(*list); | 309 heap->SetRootScriptList(*list); |
310 } | 310 } |
311 } | 311 } |
312 | 312 |
313 HeapObject* Deserializer::GetBackReferencedObject(int space) { | 313 HeapObject* Deserializer::GetBackReferencedObject(int space) { |
314 HeapObject* obj; | 314 HeapObject* obj; |
315 SerializerReference back_reference(source_.GetInt()); | 315 SerializerReference back_reference = |
| 316 SerializerReference::FromBitfield(source_.GetInt()); |
316 if (space == LO_SPACE) { | 317 if (space == LO_SPACE) { |
317 CHECK(back_reference.chunk_index() == 0); | 318 CHECK(back_reference.chunk_index() == 0); |
318 uint32_t index = back_reference.large_object_index(); | 319 uint32_t index = back_reference.large_object_index(); |
319 obj = deserialized_large_objects_[index]; | 320 obj = deserialized_large_objects_[index]; |
320 } else { | 321 } else { |
321 DCHECK(space < kNumberOfPreallocatedSpaces); | 322 DCHECK(space < kNumberOfPreallocatedSpaces); |
322 uint32_t chunk_index = back_reference.chunk_index(); | 323 uint32_t chunk_index = back_reference.chunk_index(); |
323 DCHECK_LE(chunk_index, current_chunk_[space]); | 324 DCHECK_LE(chunk_index, current_chunk_[space]); |
324 uint32_t chunk_offset = back_reference.chunk_offset(); | 325 uint32_t chunk_offset = back_reference.chunk_offset(); |
325 Address address = reservations_[space][chunk_index].start + chunk_offset; | 326 Address address = reservations_[space][chunk_index].start + chunk_offset; |
(...skipping 479 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
805 | 806 |
806 default: | 807 default: |
807 CHECK(false); | 808 CHECK(false); |
808 } | 809 } |
809 } | 810 } |
810 CHECK_EQ(limit, current); | 811 CHECK_EQ(limit, current); |
811 return true; | 812 return true; |
812 } | 813 } |
813 } // namespace internal | 814 } // namespace internal |
814 } // namespace v8 | 815 } // namespace v8 |
OLD | NEW |