Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1040)

Side by Side Diff: src/snapshot/deserializer.cc

Issue 1991793002: [serializer] cosmetic changes to SerializerReference. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/address-map.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « src/address-map.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698