V8 Project
v8::internal::HeapSnapshotGenerator Class Reference

#include <heap-snapshot-generator.h>

+ Inheritance diagram for v8::internal::HeapSnapshotGenerator:
+ Collaboration diagram for v8::internal::HeapSnapshotGenerator:

Public Member Functions

 HeapSnapshotGenerator (HeapSnapshot *snapshot, v8::ActivityControl *control, v8::HeapProfiler::ObjectNameResolver *resolver, Heap *heap)
 
bool GenerateSnapshot ()
 
- Public Member Functions inherited from v8::internal::SnapshottingProgressReportingInterface
virtual ~SnapshottingProgressReportingInterface ()
 

Private Member Functions

bool FillReferences ()
 
void ProgressStep ()
 
bool ProgressReport (bool force=false)
 
void SetProgressTotal (int iterations_count)
 
 DISALLOW_COPY_AND_ASSIGN (HeapSnapshotGenerator)
 

Private Attributes

HeapSnapshotsnapshot_
 
v8::ActivityControlcontrol_
 
V8HeapExplorer v8_heap_explorer_
 
NativeObjectsExplorer dom_explorer_
 
HeapEntriesMap entries_
 
int progress_counter_
 
int progress_total_
 
Heapheap_
 

Detailed Description

Definition at line 528 of file heap-snapshot-generator.h.

Constructor & Destructor Documentation

◆ HeapSnapshotGenerator()

v8::internal::HeapSnapshotGenerator::HeapSnapshotGenerator ( HeapSnapshot snapshot,
v8::ActivityControl control,
v8::HeapProfiler::ObjectNameResolver resolver,
Heap heap 
)

Definition at line 2535 of file heap-snapshot-generator.cc.

2540  : snapshot_(snapshot),
2541  control_(control),
2542  v8_heap_explorer_(snapshot_, this, resolver),
2543  dom_explorer_(snapshot_, this),
2544  heap_(heap) {
2545 }
enable harmony numeric enable harmony object literal extensions Optimize object Array DOM strings and string trace pretenuring decisions of HAllocate instructions Enables optimizations which favor memory size over execution speed maximum source size in bytes considered for a single inlining maximum cumulative number of AST nodes considered for inlining trace the tracking of allocation sites deoptimize every n garbage collections perform array bounds checks elimination analyze liveness of environment slots and zap dead values flushes the cache of optimized code for closures on every GC allow uint32 values on optimize frames if they are used only in safe operations track concurrent recompilation artificial compilation delay in ms do not emit check maps for constant values that have a leaf deoptimize the optimized code if the layout of the maps changes enable context specialization in TurboFan execution budget before interrupt is triggered max percentage of megamorphic generic ICs to allow optimization enable use of SAHF instruction if enable use of VFP3 instructions if available enable use of NEON instructions if enable use of SDIV and UDIV instructions if enable use of MLS 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 enable alignment of csp to bytes on platforms which prefer the register to always be expose gc extension under the specified name show built in functions in stack traces use random jit cookie to mask large constants minimum length for automatic enable preparsing CPU profiler sampling interval in microseconds trace out of bounds accesses to external arrays default size of stack region v8 is allowed to maximum length of function source code printed in a stack trace min size of a semi the new space consists of two semi spaces print one trace line following each garbage collection do not print trace line after scavenger collection print cumulative GC statistics in only print modified registers Trace simulator debug messages Implied by trace sim abort randomize hashes to avoid predictable hash Fixed seed to use to hash property Print the time it takes to deserialize the snapshot A filename with extra code to be included in the snapshot(mksnapshot only)") DEFINE_STRING(raw_file

Member Function Documentation

◆ DISALLOW_COPY_AND_ASSIGN()

v8::internal::HeapSnapshotGenerator::DISALLOW_COPY_AND_ASSIGN ( HeapSnapshotGenerator  )
private

◆ FillReferences()

bool v8::internal::HeapSnapshotGenerator::FillReferences ( )
private

Definition at line 2613 of file heap-snapshot-generator.cc.

2613  {
2614  SnapshotFiller filler(snapshot_, &entries_);
2617 }
bool IterateAndExtractReferences(SnapshotFiller *filler)
bool IterateAndExtractReferences(SnapshotFiller *filler)

References dom_explorer_, entries_, v8::internal::V8HeapExplorer::IterateAndExtractReferences(), v8::internal::NativeObjectsExplorer::IterateAndExtractReferences(), snapshot_, and v8_heap_explorer_.

Referenced by GenerateSnapshot().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ GenerateSnapshot()

bool v8::internal::HeapSnapshotGenerator::GenerateSnapshot ( )

Definition at line 2548 of file heap-snapshot-generator.cc.

2548  {
2550 
2551  // TODO(1562) Profiler assumes that any object that is in the heap after
2552  // full GC is reachable from the root when computing dominators.
2553  // This is not true for weakly reachable objects.
2554  // As a temporary solution we call GC twice.
2557  "HeapSnapshotGenerator::GenerateSnapshot");
2560  "HeapSnapshotGenerator::GenerateSnapshot");
2561 
2562 #ifdef VERIFY_HEAP
2563  Heap* debug_heap = heap_;
2564  debug_heap->Verify();
2565 #endif
2566 
2567  SetProgressTotal(2); // 2 passes.
2568 
2569 #ifdef VERIFY_HEAP
2570  debug_heap->Verify();
2571 #endif
2572 
2574 
2575  if (!FillReferences()) return false;
2576 
2579 
2581  if (!ProgressReport(true)) return false;
2582  return true;
2583 }
static const int kMakeHeapIterableMask
Definition: heap.h:721
void CollectAllGarbage(int flags, const char *gc_reason=NULL, const GCCallbackFlags gc_callback_flags=kNoGCCallbackFlags)
Definition: heap.cc:724

References v8::internal::HeapSnapshot::AddSyntheticRootEntries(), v8::internal::Heap::CollectAllGarbage(), v8::internal::HeapSnapshot::FillChildren(), FillReferences(), heap_, v8::internal::Heap::kMakeHeapIterableMask, progress_counter_, progress_total_, ProgressReport(), v8::internal::HeapSnapshot::RememberLastJSObjectId(), SetProgressTotal(), snapshot_, v8::internal::V8HeapExplorer::TagGlobalObjects(), and v8_heap_explorer_.

Referenced by v8::internal::HeapProfiler::TakeSnapshot().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ProgressReport()

bool v8::internal::HeapSnapshotGenerator::ProgressReport ( bool  force = false)
privatevirtual

Implements v8::internal::SnapshottingProgressReportingInterface.

Definition at line 2591 of file heap-snapshot-generator.cc.

2591  {
2592  const int kProgressReportGranularity = 10000;
2593  if (control_ != NULL
2594  && (force || progress_counter_ % kProgressReportGranularity == 0)) {
2595  return
2598  }
2599  return true;
2600 }
virtual ControlOption ReportProgressValue(int done, int total)=0
Notify about current progress.
enable harmony numeric enable harmony object literal extensions Optimize object Array DOM strings and string trace pretenuring decisions of HAllocate instructions Enables optimizations which favor memory size over execution speed maximum source size in bytes considered for a single inlining maximum cumulative number of AST nodes considered for inlining trace the tracking of allocation sites deoptimize every n garbage collections perform array bounds checks elimination analyze liveness of environment slots and zap dead values flushes the cache of optimized code for closures on every GC allow uint32 values on optimize frames if they are used only in safe operations track concurrent recompilation artificial compilation delay in ms do not emit check maps for constant values that have a leaf deoptimize the optimized code if the layout of the maps changes enable context specialization in TurboFan execution budget before interrupt is triggered max percentage of megamorphic generic ICs to allow optimization enable use of SAHF instruction if enable use of VFP3 instructions if available enable use of NEON instructions if enable use of SDIV and UDIV instructions if enable use of MLS 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 enable alignment of csp to bytes on platforms which prefer the register to always be NULL

References control_, v8::ActivityControl::kContinue, NULL, progress_counter_, progress_total_, and v8::ActivityControl::ReportProgressValue().

Referenced by GenerateSnapshot().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ProgressStep()

void v8::internal::HeapSnapshotGenerator::ProgressStep ( )
privatevirtual

Implements v8::internal::SnapshottingProgressReportingInterface.

Definition at line 2586 of file heap-snapshot-generator.cc.

2586  {
2588 }

References progress_counter_.

◆ SetProgressTotal()

void v8::internal::HeapSnapshotGenerator::SetProgressTotal ( int  iterations_count)
private

Definition at line 2603 of file heap-snapshot-generator.cc.

2603  {
2604  if (control_ == NULL) return;
2605  HeapIterator iterator(heap_, HeapIterator::kFilterUnreachable);
2606  progress_total_ = iterations_count * (
2609  progress_counter_ = 0;
2610 }
int EstimateObjectsCount(HeapIterator *iterator)

References control_, dom_explorer_, v8::internal::NativeObjectsExplorer::EstimateObjectsCount(), v8::internal::V8HeapExplorer::EstimateObjectsCount(), heap_, NULL, progress_counter_, progress_total_, and v8_heap_explorer_.

Referenced by GenerateSnapshot().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Member Data Documentation

◆ control_

v8::ActivityControl* v8::internal::HeapSnapshotGenerator::control_
private

Definition at line 543 of file heap-snapshot-generator.h.

Referenced by ProgressReport(), and SetProgressTotal().

◆ dom_explorer_

NativeObjectsExplorer v8::internal::HeapSnapshotGenerator::dom_explorer_
private

Definition at line 545 of file heap-snapshot-generator.h.

Referenced by FillReferences(), and SetProgressTotal().

◆ entries_

HeapEntriesMap v8::internal::HeapSnapshotGenerator::entries_
private

Definition at line 547 of file heap-snapshot-generator.h.

Referenced by FillReferences().

◆ heap_

Heap* v8::internal::HeapSnapshotGenerator::heap_
private

Definition at line 551 of file heap-snapshot-generator.h.

Referenced by GenerateSnapshot(), and SetProgressTotal().

◆ progress_counter_

int v8::internal::HeapSnapshotGenerator::progress_counter_
private

◆ progress_total_

int v8::internal::HeapSnapshotGenerator::progress_total_
private

Definition at line 550 of file heap-snapshot-generator.h.

Referenced by GenerateSnapshot(), ProgressReport(), and SetProgressTotal().

◆ snapshot_

HeapSnapshot* v8::internal::HeapSnapshotGenerator::snapshot_
private

Definition at line 542 of file heap-snapshot-generator.h.

Referenced by FillReferences(), and GenerateSnapshot().

◆ v8_heap_explorer_

V8HeapExplorer v8::internal::HeapSnapshotGenerator::v8_heap_explorer_
private

Definition at line 544 of file heap-snapshot-generator.h.

Referenced by FillReferences(), GenerateSnapshot(), and SetProgressTotal().


The documentation for this class was generated from the following files: