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

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

Issue 1268333004: Introduce object visitor to estimate the size of a native context. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: fix compare Created 5 years, 4 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/api.cc ('k') | src/context-measure.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #ifndef V8_CONTEXT_MEASURE_H_
6 #define V8_CONTEXT_MEASURE_H_
7
8 #include "src/snapshot/serialize.h"
9
10 namespace v8 {
11 namespace internal {
12
13 class ContextMeasure : public ObjectVisitor {
14 public:
15 explicit ContextMeasure(Context* context);
16
17 int Size() { return size_; }
18 int Count() { return count_; }
19
20 void VisitPointers(Object** start, Object** end);
21
22 private:
23 void MeasureObject(HeapObject* object);
24 void MeasureDeferredObjects();
25 void MeasureAndRecurse(HeapObject* object);
26 bool IsShared(HeapObject* object);
27
28 Context* context_;
29
30 BackReferenceMap back_reference_map_;
31 RootIndexMap root_index_map_;
32
33 static const int kMaxRecursion = 16;
34 int recursion_depth_;
35 List<HeapObject*> deferred_objects_;
36
37 int count_;
38 int size_;
39
40 DisallowHeapAllocation no_gc_;
41
42 DISALLOW_COPY_AND_ASSIGN(ContextMeasure);
43 };
44 }
45 } // namespace v8::internal
46
47 #endif // V8_CONTEXT_MEASURE_H_
OLDNEW
« no previous file with comments | « src/api.cc ('k') | src/context-measure.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698