Flutter Engine
The Flutter Engine
Namespaces | Macros | Enumerations | Functions | Variables
gen_snapshot.cc File Reference
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <cstdarg>
#include <memory>
#include "bin/builtin.h"
#include "bin/console.h"
#include "bin/dartutils.h"
#include "bin/error_exit.h"
#include "bin/eventhandler.h"
#include "bin/exe_utils.h"
#include "bin/file.h"
#include "bin/loader.h"
#include "bin/options.h"
#include "bin/platform.h"
#include "bin/snapshot_utils.h"
#include "bin/thread.h"
#include "bin/utils.h"
#include "bin/vmservice_impl.h"
#include "include/dart_api.h"
#include "include/dart_tools_api.h"
#include "platform/globals.h"
#include "platform/growable_array.h"
#include "platform/hashmap.h"
#include "platform/syslog.h"
#include "platform/text_buffer.h"

Go to the source code of this file.

Namespaces

namespace  dart
 
namespace  dart::bin
 

Macros

#define CHECK_RESULT(result)
 
#define STRING_OPTIONS_LIST(V)
 
#define BOOL_OPTIONS_LIST(V)
 
#define STRING_OPTION_DEFINITION(flag, variable)
 
#define BOOL_OPTION_DEFINITION(flag, variable)
 

Enumerations

enum  dart::bin::SnapshotKind {
  dart::bin::kCore , dart::bin::kApp , dart::bin::kAppJIT , dart::bin::kAppAOTAssembly ,
  dart::bin::kAppAOTElf , dart::bin::kVMAOTAssembly , dart::bin::kNone , dart::bin::kKernel ,
  dart::bin::kAppJIT
}
 

Functions

static bool dart::bin::ProcessEnvironmentOption (const char *arg, CommandLineOptions *vm_options)
 
 dart::bin::DEFINE_ENUM_OPTION (snapshot_kind, SnapshotKind, snapshot_kind)
 
 dart::bin::DEFINE_CB_OPTION (ProcessEnvironmentOption)
 
static bool dart::bin::IsSnapshottingForPrecompilation ()
 
static void dart::bin::PrintUsage ()
 
static int dart::bin::ParseArguments (int argc, char **argv, CommandLineOptions *vm_options, CommandLineOptions *inputs)
 
 dart::bin::PRINTF_ATTRIBUTE (1, 2) static void PrintErrAndExit(const char *format
 
 dart::bin::va_start (args, format)
 
 dart::bin::va_end (args)
 
 dart::bin::Dart_ExitScope ()
 
 dart::bin::Dart_ShutdownIsolate ()
 
 dart::bin::exit (kErrorExitCode)
 
static File * dart::bin::OpenFile (const char *filename)
 
static void dart::bin::WriteFile (const char *filename, const uint8_t *buffer, const intptr_t size)
 
static void dart::bin::ReadFile (const char *filename, uint8_t **buffer, intptr_t *size)
 
static void dart::bin::MallocFinalizer (void *isolate_callback_data, void *peer)
 
static void dart::bin::MaybeLoadExtraInputs (const CommandLineOptions &inputs)
 
static void dart::bin::MaybeLoadCode ()
 
static void dart::bin::CreateAndWriteCoreSnapshot ()
 
static std::unique_ptr< MappedMemory > dart::bin::MapFile (const char *filename, File::MapType type, const uint8_t **buffer)
 
static void dart::bin::CreateAndWriteAppSnapshot ()
 
static void dart::bin::CreateAndWriteAppJITSnapshot ()
 
static void dart::bin::StreamingWriteCallback (void *callback_data, const uint8_t *buffer, intptr_t size)
 
static void dart::bin::StreamingCloseCallback (void *callback_data)
 
static File * dart::bin::OpenLoadingUnitManifest ()
 
static void dart::bin::WriteLoadingUnitManifest (File *manifest_file, intptr_t id, const char *path, const char *debug_path=nullptr)
 
static void dart::bin::CloseLoadingUnitManifest (File *manifest_file)
 
static void dart::bin::NextLoadingUnit (void *callback_data, intptr_t loading_unit_id, void **write_callback_data, void **write_debug_callback_data, const char *main_filename, const char *suffix)
 
static void dart::bin::NextAsmCallback (void *callback_data, intptr_t loading_unit_id, void **write_callback_data, void **write_debug_callback_data)
 
static void dart::bin::NextElfCallback (void *callback_data, intptr_t loading_unit_id, void **write_callback_data, void **write_debug_callback_data)
 
static void dart::bin::CreateAndWritePrecompiledSnapshot ()
 
static int dart::bin::CreateIsolateAndSnapshot (const CommandLineOptions &inputs)
 
int dart::bin::main (int argc, char **argv)
 
int main (int argc, char **argv)
 

Variables

static dart::SimpleHashMapdart::bin::environment = nullptr
 
const uint8_t * dart::bin::isolate_snapshot_data = nullptr
 
const uint8_t * dart::bin::isolate_snapshot_instructions = nullptr
 
static SnapshotKind dart::bin::snapshot_kind = kCore
 
static const char *const dart::bin::kSnapshotKindNames []
 

Macro Definition Documentation

◆ BOOL_OPTION_DEFINITION

#define BOOL_OPTION_DEFINITION (   flag,
  variable 
)
Value:
static bool variable = false; \
DEFINE_BOOL_OPTION(flag, variable)
FlutterSemanticsFlag flag

Definition at line 129 of file gen_snapshot.cc.

◆ BOOL_OPTIONS_LIST

#define BOOL_OPTIONS_LIST (   V)
Value:
V(compile_all, compile_all) \
V(help, help) \
V(obfuscate, obfuscate) \
V(strip, strip) \
help
Definition: zip.py:79
#define V(name)
Definition: raw_object.h:125

Definition at line 115 of file gen_snapshot.cc.

◆ CHECK_RESULT

#define CHECK_RESULT (   result)
Value:
if (Dart_IsError(result)) { \
intptr_t exit_code = 0; \
Syslog::PrintErr("Error: %s\n", Dart_GetError(result)); \
} else if (Dart_IsApiError(result)) { \
exit_code = kApiErrorExitCode; \
} else { \
exit_code = kErrorExitCode; \
} \
Dart_ExitScope(); \
Dart_ShutdownIsolate(); \
exit(exit_code); \
}
DART_EXPORT bool Dart_IsApiError(Dart_Handle handle)
DART_EXPORT bool Dart_IsError(Dart_Handle handle)
DART_EXPORT const char * Dart_GetError(Dart_Handle handle)
DART_EXPORT bool Dart_IsCompilationError(Dart_Handle handle)
GAsyncResult * result
constexpr int kCompilationErrorExitCode
Definition: error_exit.h:16
constexpr int kErrorExitCode
Definition: error_exit.h:18
constexpr int kApiErrorExitCode
Definition: error_exit.h:14

Definition at line 42 of file gen_snapshot.cc.

◆ STRING_OPTION_DEFINITION

#define STRING_OPTION_DEFINITION (   flag,
  variable 
)
Value:
static const char* variable = nullptr; \
DEFINE_STRING_OPTION(flag, variable)

Definition at line 123 of file gen_snapshot.cc.

◆ STRING_OPTIONS_LIST

#define STRING_OPTIONS_LIST (   V)
Value:
V(load_vm_snapshot_data, load_vm_snapshot_data_filename) \
V(load_vm_snapshot_instructions, load_vm_snapshot_instructions_filename) \
V(load_isolate_snapshot_data, load_isolate_snapshot_data_filename) \
V(load_isolate_snapshot_instructions, \
load_isolate_snapshot_instructions_filename) \
V(vm_snapshot_data, vm_snapshot_data_filename) \
V(vm_snapshot_instructions, vm_snapshot_instructions_filename) \
V(isolate_snapshot_data, isolate_snapshot_data_filename) \
V(isolate_snapshot_instructions, isolate_snapshot_instructions_filename) \
V(blobs_container_filename, blobs_container_filename) \
V(assembly, assembly_filename) \
V(elf, elf_filename) \
V(loading_unit_manifest, loading_unit_manifest_filename) \
V(save_debugging_info, debugging_info_filename) \
V(save_obfuscation_map, obfuscation_map_filename)
const uint8_t * isolate_snapshot_data
Definition: gen_snapshot.cc:69
const uint8_t * vm_snapshot_data
Definition: main_impl.cc:52
const uint8_t * vm_snapshot_instructions
Definition: main_impl.cc:53
const uint8_t * isolate_snapshot_instructions
Definition: gen_snapshot.cc:70

Definition at line 98 of file gen_snapshot.cc.

Function Documentation

◆ main()

int main ( int  argc,
char **  argv 
)

Definition at line 913 of file gen_snapshot.cc.

913 {
914 return dart::bin::main(argc, argv);
915}
char ** argv
Definition: library.h:9
int main(int argc, char **argv)