v8  3.25.30(node0.11.13)
V8 is Google's open source JavaScript engine
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
heap-snapshot-generator.h
Go to the documentation of this file.
1 // Copyright 2013 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are
4 // met:
5 //
6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided
11 // with the distribution.
12 // * Neither the name of Google Inc. nor the names of its
13 // contributors may be used to endorse or promote products derived
14 // from this software without specific prior written permission.
15 //
16 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
17 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
18 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
19 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
20 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
21 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
22 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
23 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
24 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
26 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 
28 #ifndef V8_HEAP_SNAPSHOT_GENERATOR_H_
29 #define V8_HEAP_SNAPSHOT_GENERATOR_H_
30 
31 #include "profile-generator-inl.h"
32 
33 namespace v8 {
34 namespace internal {
35 
36 class AllocationTracker;
37 class AllocationTraceNode;
38 class HeapEntry;
39 class HeapSnapshot;
40 class SnapshotFiller;
41 
42 class HeapGraphEdge BASE_EMBEDDED {
43  public:
44  enum Type {
52  };
53 
55  HeapGraphEdge(Type type, const char* name, int from, int to);
56  HeapGraphEdge(Type type, int index, int from, int to);
57  void ReplaceToIndexWithEntry(HeapSnapshot* snapshot);
58 
59  Type type() const { return static_cast<Type>(type_); }
60  int index() const {
61  ASSERT(type_ == kElement || type_ == kHidden);
62  return index_;
63  }
64  const char* name() const {
65  ASSERT(type_ == kContextVariable
66  || type_ == kProperty
67  || type_ == kInternal
68  || type_ == kShortcut
69  || type_ == kWeak);
70  return name_;
71  }
72  INLINE(HeapEntry* from() const);
73  HeapEntry* to() const { return to_entry_; }
74 
75  private:
76  INLINE(HeapSnapshot* snapshot() const);
77 
78  unsigned type_ : 3;
79  int from_index_ : 29;
80  union {
81  // During entries population |to_index_| is used for storing the index,
82  // afterwards it is replaced with a pointer to the entry.
83  int to_index_;
84  HeapEntry* to_entry_;
85  };
86  union {
87  int index_;
88  const char* name_;
89  };
90 };
91 
92 
93 // HeapEntry instances represent an entity from the heap (or a special
94 // virtual node, e.g. root).
95 class HeapEntry BASE_EMBEDDED {
96  public:
97  enum Type {
110  };
111  static const int kNoEntry;
112 
113  HeapEntry() { }
114  HeapEntry(HeapSnapshot* snapshot,
115  Type type,
116  const char* name,
117  SnapshotObjectId id,
118  size_t self_size,
119  unsigned trace_node_id);
120 
121  HeapSnapshot* snapshot() { return snapshot_; }
122  Type type() { return static_cast<Type>(type_); }
123  const char* name() { return name_; }
124  void set_name(const char* name) { name_ = name; }
125  inline SnapshotObjectId id() { return id_; }
126  size_t self_size() { return self_size_; }
127  unsigned trace_node_id() const { return trace_node_id_; }
128  INLINE(int index() const);
129  int children_count() const { return children_count_; }
130  INLINE(int set_children_index(int index));
131  void add_child(HeapGraphEdge* edge) {
132  children_arr()[children_count_++] = edge;
133  }
135  return Vector<HeapGraphEdge*>(children_arr(), children_count_); }
136 
137  void SetIndexedReference(
138  HeapGraphEdge::Type type, int index, HeapEntry* entry);
139  void SetNamedReference(
140  HeapGraphEdge::Type type, const char* name, HeapEntry* entry);
141 
142  void Print(
143  const char* prefix, const char* edge_name, int max_depth, int indent);
144 
145  private:
146  INLINE(HeapGraphEdge** children_arr());
147  const char* TypeAsString();
148 
149  unsigned type_: 4;
150  int children_count_: 28;
151  int children_index_;
152  size_t self_size_;
153  HeapSnapshot* snapshot_;
154  const char* name_;
155  SnapshotObjectId id_;
156  // id of allocation stack trace top node
157  unsigned trace_node_id_;
158 };
159 
160 
161 // HeapSnapshot represents a single heap snapshot. It is stored in
162 // HeapProfiler, which is also a factory for
163 // HeapSnapshots. All HeapSnapshots share strings copied from JS heap
164 // to be able to return them even if they were collected.
165 // HeapSnapshotGenerator fills in a HeapSnapshot.
167  public:
169  const char* title,
170  unsigned uid);
171  void Delete();
172 
173  HeapProfiler* profiler() { return profiler_; }
174  const char* title() { return title_; }
175  unsigned uid() { return uid_; }
176  size_t RawSnapshotSize() const;
177  HeapEntry* root() { return &entries_[root_index_]; }
178  HeapEntry* gc_roots() { return &entries_[gc_roots_index_]; }
179  HeapEntry* natives_root() { return &entries_[natives_root_index_]; }
180  HeapEntry* gc_subroot(int index) {
181  return &entries_[gc_subroot_indexes_[index]];
182  }
183  List<HeapEntry>& entries() { return entries_; }
184  List<HeapGraphEdge>& edges() { return edges_; }
185  List<HeapGraphEdge*>& children() { return children_; }
186  void RememberLastJSObjectId();
188  return max_snapshot_js_object_id_;
189  }
190 
191  HeapEntry* AddEntry(HeapEntry::Type type,
192  const char* name,
193  SnapshotObjectId id,
194  size_t size,
195  unsigned trace_node_id);
196  HeapEntry* AddRootEntry();
197  HeapEntry* AddGcRootsEntry();
198  HeapEntry* AddGcSubrootEntry(int tag);
199  HeapEntry* AddNativesRootEntry();
200  HeapEntry* GetEntryById(SnapshotObjectId id);
202  void FillChildren();
203 
204  void Print(int max_depth);
205  void PrintEntriesSize();
206 
207  private:
208  HeapProfiler* profiler_;
209  const char* title_;
210  unsigned uid_;
211  int root_index_;
212  int gc_roots_index_;
213  int natives_root_index_;
214  int gc_subroot_indexes_[VisitorSynchronization::kNumberOfSyncTags];
215  List<HeapEntry> entries_;
216  List<HeapGraphEdge> edges_;
217  List<HeapGraphEdge*> children_;
218  List<HeapEntry*> sorted_entries_;
219  SnapshotObjectId max_snapshot_js_object_id_;
220 
221  friend class HeapSnapshotTester;
222 
224 };
225 
226 
228  public:
229  explicit HeapObjectsMap(Heap* heap);
230 
231  Heap* heap() const { return heap_; }
232 
235  unsigned int size,
236  bool accessed = true);
237  bool MoveObject(Address from, Address to, int size);
238  void UpdateObjectSize(Address addr, int size);
240  return next_id_ - kObjectIdStep;
241  }
242 
245  size_t GetUsedMemorySize() const;
246 
248  static inline SnapshotObjectId GetNthGcSubrootId(int delta);
249 
250  static const int kObjectIdStep = 2;
256 
257  int FindUntrackedObjects();
258 
259  void UpdateHeapObjectsMap();
260  void RemoveDeadEntries();
261 
262  private:
263  struct EntryInfo {
264  EntryInfo(SnapshotObjectId id, Address addr, unsigned int size)
265  : id(id), addr(addr), size(size), accessed(true) { }
266  EntryInfo(SnapshotObjectId id, Address addr, unsigned int size, bool accessed)
267  : id(id), addr(addr), size(size), accessed(accessed) { }
268  SnapshotObjectId id;
269  Address addr;
270  unsigned int size;
271  bool accessed;
272  };
273  struct TimeInterval {
274  explicit TimeInterval(SnapshotObjectId id) : id(id), size(0), count(0) { }
275  SnapshotObjectId id;
276  uint32_t size;
277  uint32_t count;
278  };
279 
280  SnapshotObjectId next_id_;
281  HashMap entries_map_;
282  List<EntryInfo> entries_;
283  List<TimeInterval> time_intervals_;
284  Heap* heap_;
285 
286  DISALLOW_COPY_AND_ASSIGN(HeapObjectsMap);
287 };
288 
289 
290 // A typedef for referencing anything that can be snapshotted living
291 // in any kind of heap memory.
292 typedef void* HeapThing;
293 
294 
295 // An interface that creates HeapEntries by HeapThings.
297  public:
298  virtual ~HeapEntriesAllocator() { }
299  virtual HeapEntry* AllocateEntry(HeapThing ptr) = 0;
300 };
301 
302 
303 // The HeapEntriesMap instance is used to track a mapping between
304 // real heap objects and their representations in heap snapshots.
306  public:
307  HeapEntriesMap();
308 
309  int Map(HeapThing thing);
310  void Pair(HeapThing thing, int entry);
311 
312  private:
313  static uint32_t Hash(HeapThing thing) {
314  return ComputeIntegerHash(
315  static_cast<uint32_t>(reinterpret_cast<uintptr_t>(thing)),
316  v8::internal::kZeroHashSeed);
317  }
318  static bool HeapThingsMatch(HeapThing key1, HeapThing key2) {
319  return key1 == key2;
320  }
321 
322  HashMap entries_;
323 
324  friend class HeapObjectsSet;
325 
327 };
328 
329 
331  public:
332  HeapObjectsSet();
333  void Clear();
334  bool Contains(Object* object);
335  void Insert(Object* obj);
336  const char* GetTag(Object* obj);
337  void SetTag(Object* obj, const char* tag);
338  bool is_empty() const { return entries_.occupancy() == 0; }
339 
340  private:
341  HashMap entries_;
342 
343  DISALLOW_COPY_AND_ASSIGN(HeapObjectsSet);
344 };
345 
346 
348  public:
350  virtual void ProgressStep() = 0;
351  virtual bool ProgressReport(bool force) = 0;
352 };
353 
354 
355 // An implementation of V8 heap graph extractor.
357  public:
358  V8HeapExplorer(HeapSnapshot* snapshot,
361  virtual ~V8HeapExplorer();
362  virtual HeapEntry* AllocateEntry(HeapThing ptr);
363  void AddRootEntries(SnapshotFiller* filler);
364  int EstimateObjectsCount(HeapIterator* iterator);
366  void TagGlobalObjects();
367  void TagCodeObject(Code* code);
368  void TagBuiltinCodeObject(Code* code, const char* name);
369  HeapEntry* AddEntry(Address address,
370  HeapEntry::Type type,
371  const char* name,
372  size_t size);
373 
374  static String* GetConstructorName(JSObject* object);
375 
377 
378  private:
379  HeapEntry* AddEntry(HeapObject* object);
380  HeapEntry* AddEntry(HeapObject* object,
381  HeapEntry::Type type,
382  const char* name);
383 
384  const char* GetSystemEntryName(HeapObject* object);
385 
386  void ExtractReferences(HeapObject* obj);
387  void ExtractJSGlobalProxyReferences(int entry, JSGlobalProxy* proxy);
388  void ExtractJSObjectReferences(int entry, JSObject* js_obj);
389  void ExtractStringReferences(int entry, String* obj);
390  void ExtractContextReferences(int entry, Context* context);
391  void ExtractMapReferences(int entry, Map* map);
392  void ExtractSharedFunctionInfoReferences(int entry,
393  SharedFunctionInfo* shared);
394  void ExtractScriptReferences(int entry, Script* script);
395  void ExtractAccessorPairReferences(int entry, AccessorPair* accessors);
396  void ExtractCodeCacheReferences(int entry, CodeCache* code_cache);
397  void ExtractCodeReferences(int entry, Code* code);
398  void ExtractBoxReferences(int entry, Box* box);
399  void ExtractCellReferences(int entry, Cell* cell);
400  void ExtractPropertyCellReferences(int entry, PropertyCell* cell);
401  void ExtractAllocationSiteReferences(int entry, AllocationSite* site);
402  void ExtractJSArrayBufferReferences(int entry, JSArrayBuffer* buffer);
403  void ExtractClosureReferences(JSObject* js_obj, int entry);
404  void ExtractPropertyReferences(JSObject* js_obj, int entry);
405  bool ExtractAccessorPairProperty(JSObject* js_obj, int entry,
406  Object* key, Object* callback_obj);
407  void ExtractElementReferences(JSObject* js_obj, int entry);
408  void ExtractInternalReferences(JSObject* js_obj, int entry);
409  bool IsEssentialObject(Object* object);
410  void SetContextReference(HeapObject* parent_obj,
411  int parent,
412  String* reference_name,
413  Object* child,
414  int field_offset);
415  void SetNativeBindReference(HeapObject* parent_obj,
416  int parent,
417  const char* reference_name,
418  Object* child);
419  void SetElementReference(HeapObject* parent_obj,
420  int parent,
421  int index,
422  Object* child);
423  void SetInternalReference(HeapObject* parent_obj,
424  int parent,
425  const char* reference_name,
426  Object* child,
427  int field_offset = -1);
428  void SetInternalReference(HeapObject* parent_obj,
429  int parent,
430  int index,
431  Object* child,
432  int field_offset = -1);
433  void SetHiddenReference(HeapObject* parent_obj,
434  int parent,
435  int index,
436  Object* child);
437  void SetWeakReference(HeapObject* parent_obj,
438  int parent,
439  const char* reference_name,
440  Object* child_obj,
441  int field_offset);
442  void SetPropertyReference(HeapObject* parent_obj,
443  int parent,
444  Name* reference_name,
445  Object* child,
446  const char* name_format_string = NULL,
447  int field_offset = -1);
448  void SetUserGlobalReference(Object* user_global);
449  void SetRootGcRootsReference();
450  void SetGcRootsReference(VisitorSynchronization::SyncTag tag);
451  void SetGcSubrootReference(
452  VisitorSynchronization::SyncTag tag, bool is_weak, Object* child);
453  const char* GetStrongGcSubrootName(Object* object);
454  void TagObject(Object* obj, const char* tag);
455 
456  HeapEntry* GetEntry(Object* obj);
457 
458  static inline HeapObject* GetNthGcSubrootObject(int delta);
459  static inline int GetGcSubrootOrder(HeapObject* subroot);
460 
461  Heap* heap_;
462  HeapSnapshot* snapshot_;
463  StringsStorage* names_;
464  HeapObjectsMap* heap_object_map_;
466  SnapshotFiller* filler_;
467  HeapObjectsSet objects_tags_;
468  HeapObjectsSet strong_gc_subroot_names_;
469  HeapObjectsSet user_roots_;
470  v8::HeapProfiler::ObjectNameResolver* global_object_name_resolver_;
471 
472  static HeapObject* const kGcRootsObject;
473  static HeapObject* const kFirstGcSubrootObject;
474  static HeapObject* const kLastGcSubrootObject;
475 
477  friend class GcSubrootsEnumerator;
479 
481 };
482 
483 
485 
486 
487 // An implementation of retained native objects extractor.
489  public:
492  virtual ~NativeObjectsExplorer();
493  void AddRootEntries(SnapshotFiller* filler);
494  int EstimateObjectsCount();
496 
497  private:
498  void FillRetainedObjects();
499  void FillImplicitReferences();
500  List<HeapObject*>* GetListMaybeDisposeInfo(v8::RetainedObjectInfo* info);
501  void SetNativeRootReference(v8::RetainedObjectInfo* info);
502  void SetRootNativeRootsReference();
503  void SetWrapperNativeReferences(HeapObject* wrapper,
504  v8::RetainedObjectInfo* info);
505  void VisitSubtreeWrapper(Object** p, uint16_t class_id);
506 
507  static uint32_t InfoHash(v8::RetainedObjectInfo* info) {
508  return ComputeIntegerHash(static_cast<uint32_t>(info->GetHash()),
509  v8::internal::kZeroHashSeed);
510  }
511  static bool RetainedInfosMatch(void* key1, void* key2) {
512  return key1 == key2 ||
513  (reinterpret_cast<v8::RetainedObjectInfo*>(key1))->IsEquivalent(
514  reinterpret_cast<v8::RetainedObjectInfo*>(key2));
515  }
516  INLINE(static bool StringsMatch(void* key1, void* key2)) {
517  return strcmp(reinterpret_cast<char*>(key1),
518  reinterpret_cast<char*>(key2)) == 0;
519  }
520 
521  NativeGroupRetainedObjectInfo* FindOrAddGroupInfo(const char* label);
522 
523  Isolate* isolate_;
524  HeapSnapshot* snapshot_;
525  StringsStorage* names_;
527  bool embedder_queried_;
528  HeapObjectsSet in_groups_;
529  // RetainedObjectInfo* -> List<HeapObject*>*
530  HashMap objects_by_info_;
531  HashMap native_groups_;
532  HeapEntriesAllocator* synthetic_entries_allocator_;
533  HeapEntriesAllocator* native_entries_allocator_;
534  // Used during references extraction.
535  SnapshotFiller* filler_;
536 
537  static HeapThing const kNativesRootObject;
538 
540 
542 };
543 
544 
546  public:
548  v8::ActivityControl* control,
550  Heap* heap);
551  bool GenerateSnapshot();
552 
553  private:
554  bool FillReferences();
555  void ProgressStep();
556  bool ProgressReport(bool force = false);
557  void SetProgressTotal(int iterations_count);
558 
559  HeapSnapshot* snapshot_;
560  v8::ActivityControl* control_;
561  V8HeapExplorer v8_heap_explorer_;
562  NativeObjectsExplorer dom_explorer_;
563  // Mapping from HeapThing pointers to HeapEntry* pointers.
564  HeapEntriesMap entries_;
565  // Used during snapshot generation.
566  int progress_counter_;
567  int progress_total_;
568  Heap* heap_;
569 
570  DISALLOW_COPY_AND_ASSIGN(HeapSnapshotGenerator);
571 };
572 
573 class OutputStreamWriter;
574 
576  public:
578  : snapshot_(snapshot),
579  strings_(StringsMatch),
580  next_node_id_(1),
581  next_string_id_(1),
582  writer_(NULL) {
583  }
584  void Serialize(v8::OutputStream* stream);
585 
586  private:
587  INLINE(static bool StringsMatch(void* key1, void* key2)) {
588  return strcmp(reinterpret_cast<char*>(key1),
589  reinterpret_cast<char*>(key2)) == 0;
590  }
591 
592  INLINE(static uint32_t StringHash(const void* string)) {
593  const char* s = reinterpret_cast<const char*>(string);
594  int len = static_cast<int>(strlen(s));
596  s, len, v8::internal::kZeroHashSeed);
597  }
598 
599  int GetStringId(const char* s);
600  int entry_index(HeapEntry* e) { return e->index() * kNodeFieldsCount; }
601  void SerializeEdge(HeapGraphEdge* edge, bool first_edge);
602  void SerializeEdges();
603  void SerializeImpl();
604  void SerializeNode(HeapEntry* entry);
605  void SerializeNodes();
606  void SerializeSnapshot();
607  void SerializeTraceTree();
608  void SerializeTraceNode(AllocationTraceNode* node);
609  void SerializeTraceNodeInfos();
610  void SerializeString(const unsigned char* s);
611  void SerializeStrings();
612 
613  static const int kEdgeFieldsCount;
614  static const int kNodeFieldsCount;
615 
616  HeapSnapshot* snapshot_;
617  HashMap strings_;
618  int next_node_id_;
619  int next_string_id_;
620  OutputStreamWriter* writer_;
621 
624 
626 };
627 
628 
629 } } // namespace v8::internal
630 
631 #endif // V8_HEAP_SNAPSHOT_GENERATOR_H_
byte * Address
Definition: globals.h:186
enable upcoming ES6 features enable harmony block scoping enable harmony enable harmony proxies enable harmony generators enable harmony numeric enable harmony string enable harmony math functions harmony_scoping harmony_symbols harmony_collections harmony_iteration harmony_strings harmony_scoping harmony_maths tracks arrays with only smi values Optimize object Array DOM strings and string pretenure call new trace pretenuring decisions of HAllocate instructions track fields with only smi values track fields with heap values track_fields track_fields Enables optimizations which favor memory size over execution speed use string slices optimization filter maximum number of GVN fix point iterations use function inlining use allocation folding eliminate write barriers targeting allocations in optimized code maximum source size in bytes considered for a single inlining maximum cumulative number of AST nodes considered for inlining crankshaft harvests type feedback from stub cache trace check elimination phase hydrogen tracing filter NULL
Definition: flags.cc:269
virtual HeapEntry * AllocateEntry(HeapThing ptr)=0
void TagBuiltinCodeObject(Code *code, const char *name)
static const SnapshotObjectId kGcRootsFirstSubrootId
enable upcoming ES6 features enable harmony block scoping enable harmony enable harmony proxies enable harmony generators enable harmony numeric enable harmony string enable harmony math functions harmony_scoping harmony_symbols harmony_collections harmony_iteration harmony_strings harmony_scoping harmony_maths true
Definition: flags.cc:208
virtual HeapEntry * AllocateEntry(HeapThing ptr)
virtual intptr_t GetHash()=0
enable upcoming ES6 features enable harmony block scoping enable harmony enable harmony proxies enable harmony generators enable harmony numeric enable harmony string enable harmony math functions harmony_scoping harmony_symbols harmony_collections harmony_iteration harmony_strings harmony_scoping harmony_maths tracks arrays with only smi values Optimize object Array DOM strings and string pretenure call new trace pretenuring decisions of HAllocate instructions track fields with only smi values track fields with heap values track_fields track_fields Enables optimizations which favor memory size over execution speed use string slices optimization filter maximum number of GVN fix point iterations use function inlining use allocation folding eliminate write barriers targeting allocations in optimized code maximum source size in bytes considered for a single inlining maximum cumulative number of AST nodes considered for inlining crankshaft harvests type feedback from stub cache trace check elimination phase hydrogen tracing filter trace hydrogen to given file name trace inlining decisions trace store elimination trace all use positions trace global value numbering trace hydrogen escape analysis trace the tracking of allocation sites trace map generalization environment for every instruction deoptimize every n garbage collections put a break point before deoptimizing deoptimize uncommon cases use on stack replacement trace array bounds check elimination perform array index dehoisting use load elimination use store elimination use constant folding eliminate unreachable code number of stress runs when picking a function to watch for shared function not JSFunction itself flushes the cache of optimized code for closures on every GC functions with arguments object maximum number of escape analysis fix point iterations allow uint32 values on optimize frames if they are used only in safe operations track concurrent recompilation artificial compilation delay in ms concurrent on stack replacement do not emit check maps for constant values that have a leaf map
Definition: flags.cc:350
HeapEntry * AddEntry(Address address, HeapEntry::Type type, const char *name, size_t size)
void AddRootEntries(SnapshotFiller *filler)
static SnapshotObjectId GetNthGcSubrootId(int delta)
static const SnapshotObjectId kNativesRootObjectId
SnapshotObjectId FindOrAddEntry(Address addr, unsigned int size, bool accessed=true)
TypeImpl< ZoneTypeConfig > Type
void UpdateObjectSize(Address addr, int size)
bool IterateAndExtractReferences(SnapshotFiller *filler)
#define ASSERT(condition)
Definition: checks.h:329
SnapshotObjectId PushHeapObjectsStats(OutputStream *stream)
V8HeapExplorer(HeapSnapshot *snapshot, SnapshottingProgressReportingInterface *progress, v8::HeapProfiler::ObjectNameResolver *resolver)
unsigned short uint16_t
Definition: unicode.cc:46
void SetTag(Object *obj, const char *tag)
HeapEntry * AddNativesRootEntry()
static const SnapshotObjectId kGcRootsObjectId
SnapshotObjectId GenerateId(v8::RetainedObjectInfo *info)
SnapshotObjectId last_assigned_id() const
enable upcoming ES6 features enable harmony block scoping enable harmony enable harmony proxies enable harmony generators enable harmony numeric enable harmony string enable harmony math functions harmony_scoping harmony_symbols harmony_collections harmony_iteration harmony_strings harmony_scoping harmony_maths tracks arrays with only smi values Optimize object size
Definition: flags.cc:211
bool MoveObject(Address from, Address to, int size)
NativeObjectsExplorer(HeapSnapshot *snapshot, SnapshottingProgressReportingInterface *progress)
const char * GetTag(Object *obj)
HeapSnapshotGenerator(HeapSnapshot *snapshot, v8::ActivityControl *control, v8::HeapProfiler::ObjectNameResolver *resolver, Heap *heap)
static String * GetConstructorName(JSObject *object)
HeapEntry * gc_subroot(int index)
uint32_t occupancy() const
Definition: hashmap.h:83
static HeapObject *const kInternalRootObject
bool IterateAndExtractReferences(SnapshotFiller *filler)
enable upcoming ES6 features enable harmony block scoping enable harmony enable harmony proxies enable harmony generators enable harmony numeric enable harmony string enable harmony math functions harmony_scoping harmony_symbols harmony_collections harmony_iteration harmony_strings harmony_scoping harmony_maths tracks arrays with only smi values Optimize object Array DOM strings and string pretenure call new trace pretenuring decisions of HAllocate instructions track fields with only smi values track fields with heap values track_fields track_fields Enables optimizations which favor memory size over execution speed use string slices optimization filter maximum number of GVN fix point iterations use function inlining use allocation folding eliminate write barriers targeting allocations in optimized code maximum source size in bytes considered for a single inlining maximum cumulative number of AST nodes considered for inlining crankshaft harvests type feedback from stub cache trace check elimination phase hydrogen tracing filter trace hydrogen to given file name trace inlining decisions trace store elimination trace all use positions trace global value numbering trace hydrogen escape analysis trace the tracking of allocation sites trace map generalization environment for every instruction deoptimize every n garbage collections put a break point before deoptimizing deoptimize uncommon cases use on stack replacement trace array bounds check elimination perform array index dehoisting use load elimination use store elimination use constant folding eliminate unreachable code number of stress runs when picking a function to watch for shared function not JSFunction itself flushes the cache of optimized code for closures on every GC functions with arguments object maximum number of escape analysis fix point iterations allow uint32 values on optimize frames if they are used only in safe operations track concurrent recompilation artificial compilation delay in ms concurrent on stack replacement do not emit check maps for constant values that have a leaf deoptimize the optimized code if the layout of the maps changes number of stack frames inspected by the profiler percentage of ICs that must have type info to allow optimization extra verbose compilation tracing generate extra code(assertions) for debugging") DEFINE_bool(code_comments
#define DISALLOW_COPY_AND_ASSIGN(TypeName)
Definition: globals.h:359
static const SnapshotObjectId kFirstAvailableObjectId
List< HeapGraphEdge > & edges()
SnapshotObjectId FindEntry(Address addr)
#define BASE_EMBEDDED
Definition: allocation.h:68
HeapSnapshot(HeapProfiler *profiler, const char *title, unsigned uid)
HeapEntry * GetEntryById(SnapshotObjectId id)
void AddRootEntries(SnapshotFiller *filler)
HeapEntry * AddEntry(HeapEntry::Type type, const char *name, SnapshotObjectId id, size_t size, unsigned trace_node_id)
static uint32_t HashSequentialString(const schar *chars, int length, uint32_t seed)
Definition: objects-inl.h:6258
uint32_t ComputeIntegerHash(uint32_t key, uint32_t seed)
Definition: utils.h:322
enable upcoming ES6 features enable harmony block scoping enable harmony enable harmony proxies enable harmony generators enable harmony numeric enable harmony string enable harmony math functions harmony_scoping harmony_symbols harmony_collections harmony_iteration harmony_strings harmony_scoping harmony_maths tracks arrays with only smi values Optimize object Array DOM strings and string pretenure call new trace pretenuring decisions of HAllocate instructions track fields with only smi values track fields with heap values track_fields track_fields Enables optimizations which favor memory size over execution speed use string slices optimization filter maximum number of GVN fix point iterations use function inlining use allocation folding eliminate write barriers targeting allocations in optimized code maximum source size in bytes considered for a single inlining maximum cumulative number of AST nodes considered for inlining crankshaft harvests type feedback from stub cache trace check elimination phase hydrogen tracing filter trace hydrogen to given file name trace inlining decisions trace store elimination trace all use positions trace global value numbering trace hydrogen escape analysis trace the tracking of allocation sites trace map generalization environment for every instruction deoptimize every n garbage collections put a break point before deoptimizing deoptimize uncommon cases use on stack replacement trace array bounds check elimination perform array index dehoisting use load elimination use store elimination use constant folding eliminate unreachable code number of stress runs when picking a function to watch for shared function info
Definition: flags.cc:317
static const SnapshotObjectId kInternalRootObjectId
INLINE(static HeapObject *EnsureDoubleAligned(Heap *heap, HeapObject *object, int size))
List< HeapEntry * > * GetSortedEntriesList()
uint32_t SnapshotObjectId
Definition: v8-profiler.h:39
void Pair(HeapThing thing, int entry)
HeapEntry * AddGcSubrootEntry(int tag)
TemplateHashMapImpl< FreeStoreAllocationPolicy > HashMap
Definition: hashmap.h:113
void Print(const v8::FunctionCallbackInfo< v8::Value > &args)
List< HeapGraphEdge * > & children()
HeapObject * obj
int EstimateObjectsCount(HeapIterator *iterator)
SnapshotObjectId max_snapshot_js_object_id() const
enable upcoming ES6 features enable harmony block scoping enable harmony enable harmony proxies enable harmony generators enable harmony numeric enable harmony string enable harmony math functions harmony_scoping harmony_symbols harmony_collections harmony_iteration harmony_strings harmony_scoping harmony_maths tracks arrays with only smi values Optimize object Array DOM strings and string pretenure call new trace pretenuring decisions of HAllocate instructions track fields with only smi values track fields with heap values track_fields track_fields Enables optimizations which favor memory size over execution speed use string slices optimization filter maximum number of GVN fix point iterations use function inlining use allocation folding eliminate write barriers targeting allocations in optimized code maximum source size in bytes considered for a single inlining maximum cumulative number of AST nodes considered for inlining crankshaft harvests type feedback from stub cache trace check elimination phase hydrogen tracing filter trace hydrogen to given file name trace inlining decisions trace store elimination trace all use positions trace global value numbering trace hydrogen escape analysis trace the tracking of allocation sites trace map generalization environment for every instruction deoptimize every n garbage collections put a break point before deoptimizing deoptimize uncommon cases use on stack replacement trace array bounds check elimination perform array index dehoisting use load elimination use store elimination use constant folding eliminate unreachable code number of stress runs when picking a function to watch for shared function not JSFunction itself flushes the cache of optimized code for closures on every GC functions with arguments object maximum number of escape analysis fix point iterations allow uint32 values on optimize frames if they are used only in safe operations track concurrent recompilation artificial compilation delay in ms concurrent on stack replacement do not emit check maps for constant values that have a leaf deoptimize the optimized code if the layout of the maps changes number of stack frames inspected by the profiler percentage of ICs that must have type info to allow optimization extra verbose compilation tracing generate extra emit comments in code disassembly enable use of SSE3 instructions if available enable use of CMOV instruction if available enable use of VFP3 instructions if available enable use of NEON instructions if enable use of SDIV and UDIV instructions if enable loading bit constant by means of movw movt instruction enable unaligned accesses for enable use of d16 d31 registers on ARM this requires VFP3 force all emitted branches to be in long expose natives in global object expose freeBuffer extension expose gc extension under the specified name expose externalize string extension number of stack frames to capture disable builtin natives files print name of functions for which code is generated use random jit cookie to mask large constants trace lazy optimization use adaptive optimizations always try to OSR functions trace optimize function deoptimization minimum length for automatic enable preparsing maximum number of optimization attempts before giving up cache prototype transitions trace debugging JSON request response trace out of bounds accesses to external arrays trace_js_array_abuse automatically set the debug break flag when debugger commands are in the queue abort by crashing maximum length of function source code printed in a stack trace max size of the new max size of the old max size of executable always perform global GCs print one trace line following each garbage collection do not print trace line after scavenger collection print statistics of the maximum memory committed for the heap in name
Definition: flags.cc:505
void add_child(HeapGraphEdge *edge)
Vector< HeapGraphEdge * > children()