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

Side by Side Diff: src/context-measure.cc

Issue 1992723002: [serializer] prepare attached references for general use. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: address comments 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/context-measure.h ('k') | src/snapshot/code-serializer.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 2015 the V8 project authors. All rights reserved. 1 // Copyright 2015 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/context-measure.h" 5 #include "src/context-measure.h"
6 6
7 #include "src/base/logging.h" 7 #include "src/base/logging.h"
8 #include "src/contexts.h" 8 #include "src/contexts.h"
9 #include "src/objects-inl.h" 9 #include "src/objects-inl.h"
10 10
(...skipping 19 matching lines...) Expand all
30 if (object->IsSharedFunctionInfo()) return true; 30 if (object->IsSharedFunctionInfo()) return true;
31 if (object->IsScopeInfo()) return true; 31 if (object->IsScopeInfo()) return true;
32 if (object->IsCode() && !Code::cast(object)->is_optimized_code()) return true; 32 if (object->IsCode() && !Code::cast(object)->is_optimized_code()) return true;
33 if (object->IsAccessorInfo()) return true; 33 if (object->IsAccessorInfo()) return true;
34 if (object->IsWeakCell()) return true; 34 if (object->IsWeakCell()) return true;
35 return false; 35 return false;
36 } 36 }
37 37
38 38
39 void ContextMeasure::MeasureObject(HeapObject* object) { 39 void ContextMeasure::MeasureObject(HeapObject* object) {
40 if (back_reference_map_.Lookup(object).is_valid()) return; 40 if (reference_map_.Lookup(object).is_valid()) return;
41 if (root_index_map_.Lookup(object) != RootIndexMap::kInvalidRootIndex) return; 41 if (root_index_map_.Lookup(object) != RootIndexMap::kInvalidRootIndex) return;
42 if (IsShared(object)) return; 42 if (IsShared(object)) return;
43 back_reference_map_.Add(object, BackReference::DummyReference()); 43 reference_map_.Add(object, SerializerReference::DummyReference());
44 recursion_depth_++; 44 recursion_depth_++;
45 if (recursion_depth_ > kMaxRecursion) { 45 if (recursion_depth_ > kMaxRecursion) {
46 deferred_objects_.Add(object); 46 deferred_objects_.Add(object);
47 } else { 47 } else {
48 MeasureAndRecurse(object); 48 MeasureAndRecurse(object);
49 } 49 }
50 recursion_depth_--; 50 recursion_depth_--;
51 } 51 }
52 52
53 53
(...skipping 15 matching lines...) Expand all
69 69
70 70
71 void ContextMeasure::VisitPointers(Object** start, Object** end) { 71 void ContextMeasure::VisitPointers(Object** start, Object** end) {
72 for (Object** current = start; current < end; current++) { 72 for (Object** current = start; current < end; current++) {
73 if ((*current)->IsSmi()) continue; 73 if ((*current)->IsSmi()) continue;
74 MeasureObject(HeapObject::cast(*current)); 74 MeasureObject(HeapObject::cast(*current));
75 } 75 }
76 } 76 }
77 } // namespace internal 77 } // namespace internal
78 } // namespace v8 78 } // namespace v8
OLDNEW
« no previous file with comments | « src/context-measure.h ('k') | src/snapshot/code-serializer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698