Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
Public Member Functions | List of all members
dart::snapshot_analyzer::SnapshotAnalyzer Class Reference

Public Member Functions

 SnapshotAnalyzer (const Dart_SnapshotAnalyzerInformation &info)
 
void DumpSnapshotInformation (char **buffer, intptr_t *buffer_length)
 

Detailed Description

Definition at line 50 of file analyze_snapshot_api_impl.cc.

Constructor & Destructor Documentation

◆ SnapshotAnalyzer()

dart::snapshot_analyzer::SnapshotAnalyzer::SnapshotAnalyzer ( const Dart_SnapshotAnalyzerInformation info)
inlineexplicit

Definition at line 52 of file analyze_snapshot_api_impl.cc.

53 : info_(info) {}
static void info(const char *fmt,...) SK_PRINTF_LIKE(1
Definition DM.cpp:213

Member Function Documentation

◆ DumpSnapshotInformation()

void dart::snapshot_analyzer::SnapshotAnalyzer::DumpSnapshotInformation ( char **  buffer,
intptr_t *  buffer_length 
)

Definition at line 359 of file analyze_snapshot_api_impl.cc.

360 {
361 thread_ = Thread::Current();
362 heap_ = thread_->isolate_group()->heap();
363 DARTSCOPE(thread_);
364
365 // Open empty object so output is valid/parsable JSON.
366 js_.OpenObject();
367 js_.OpenObject("snapshot_data");
368 // Base addresses of the snapshot data, useful to calculate relative offsets.
369 js_.PrintfProperty("vm_data", "%p", info_.vm_snapshot_data);
370 js_.PrintfProperty("vm_instructions", "%p", info_.vm_snapshot_instructions);
371 js_.PrintfProperty("isolate_data", "%p", info_.vm_isolate_data);
372 js_.PrintfProperty("isolate_instructions", "%p",
374 js_.CloseObject();
375
376 {
377 // Debug builds assert that our thread has a lock before accessing
378 // vm internal fields.
379 SafepointReadRwLocker ml(thread_, thread_->isolate_group()->program_lock());
380 DumpInterestingObjects();
381 DumpMetadata();
382 }
383
384 // Close our empty object.
385 js_.CloseObject();
386
387 // Give ownership to caller.
388 js_.Steal(buffer, buffer_length);
389}
Heap * heap() const
Definition isolate.h:295
SafepointRwLock * program_lock()
Definition isolate.h:532
void Steal(char **buffer, intptr_t *buffer_length)
void PrintfProperty(const char *name, const char *format,...) PRINTF_ATTRIBUTE(3
void OpenObject(const char *property_name=nullptr)
static Thread * Current()
Definition thread.h:361
IsolateGroup * isolate_group() const
Definition thread.h:540
#define DARTSCOPE(thread)
static const uint8_t buffer[]

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