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

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

Issue 2801073006: Decouple root visitors from object visitors. (Closed)
Patch Set: rebase Created 3 years, 8 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/snapshot/serializer.h ('k') | src/snapshot/serializer-common.h » ('j') | 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/serializer.h" 5 #include "src/snapshot/serializer.h"
6 6
7 #include "src/assembler-inl.h" 7 #include "src/assembler-inl.h"
8 #include "src/deoptimizer.h" 8 #include "src/deoptimizer.h"
9 #include "src/heap/heap-inl.h" 9 #include "src/heap/heap-inl.h"
10 #include "src/macro-assembler.h" 10 #include "src/macro-assembler.h"
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
92 92
93 void Serializer::SerializeDeferredObjects() { 93 void Serializer::SerializeDeferredObjects() {
94 while (deferred_objects_.length() > 0) { 94 while (deferred_objects_.length() > 0) {
95 HeapObject* obj = deferred_objects_.RemoveLast(); 95 HeapObject* obj = deferred_objects_.RemoveLast();
96 ObjectSerializer obj_serializer(this, obj, &sink_, kPlain, kStartOfObject); 96 ObjectSerializer obj_serializer(this, obj, &sink_, kPlain, kStartOfObject);
97 obj_serializer.SerializeDeferred(); 97 obj_serializer.SerializeDeferred();
98 } 98 }
99 sink_.Put(kSynchronize, "Finished with deferred objects"); 99 sink_.Put(kSynchronize, "Finished with deferred objects");
100 } 100 }
101 101
102 void Serializer::VisitPointers(Object** start, Object** end) { 102 void Serializer::VisitRootPointers(Root root, Object** start, Object** end) {
103 for (Object** current = start; current < end; current++) { 103 for (Object** current = start; current < end; current++) {
104 if ((*current)->IsSmi()) { 104 if ((*current)->IsSmi()) {
105 PutSmi(Smi::cast(*current)); 105 PutSmi(Smi::cast(*current));
106 } else { 106 } else {
107 SerializeObject(HeapObject::cast(*current), kPlain, kStartOfObject, 0); 107 SerializeObject(HeapObject::cast(*current), kPlain, kStartOfObject, 0);
108 } 108 }
109 } 109 }
110 } 110 }
111 111
112 void Serializer::EncodeReservations( 112 void Serializer::EncodeReservations(
(...skipping 685 matching lines...) Expand 10 before | Expand all | Expand 10 after
798 if (to_skip != 0 && return_skip == kIgnoringReturn) { 798 if (to_skip != 0 && return_skip == kIgnoringReturn) {
799 sink_->Put(kSkip, "Skip"); 799 sink_->Put(kSkip, "Skip");
800 sink_->PutInt(to_skip, "SkipDistance"); 800 sink_->PutInt(to_skip, "SkipDistance");
801 to_skip = 0; 801 to_skip = 0;
802 } 802 }
803 return to_skip; 803 return to_skip;
804 } 804 }
805 805
806 } // namespace internal 806 } // namespace internal
807 } // namespace v8 807 } // namespace v8
OLDNEW
« no previous file with comments | « src/snapshot/serializer.h ('k') | src/snapshot/serializer-common.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698