4#if !defined(DART_PRECOMPILED_RUNTIME)
26#define CASE(Name, value) \
38 const intptr_t start_offset =
offset();
41 intptr_t max_start = 0;
42 for (intptr_t
i = 0;
i < line_start_count; ++
i) {
47 const intptr_t
cid = (max_start <=
kMaxUint16) ? kTypedDataUint16ArrayCid
48 : kTypedDataUint32ArrayCid;
53 intptr_t current_start = 0;
54 for (intptr_t
i = 0;
i < line_start_count; ++
i) {
56 current_start +=
delta;
57 if (
cid == kTypedDataUint16ArrayCid) {
58 line_starts_data.SetUint16(
i << 1,
static_cast<uint16_t
>(current_start));
60 line_starts_data.SetUint32(
i << 2, current_start);
64 return line_starts_data.
ptr();
68 "File size is too small to be a valid kernel file";
71 "Invalid kernel binary format version";
73 "Invalid kernel binary: Indicated size is invalid";
89 if (reader->
size() < 70) {
105 if (
error !=
nullptr) {
113 if (
error !=
nullptr) {
119 const uint32_t format_version = reader->
ReadUInt32();
121 if (
error !=
nullptr) {
128 if (
error !=
nullptr) {
139 int subprogram_count = 0;
141 while (reader->
offset() > 0) {
145 if (
error !=
nullptr) {
151 if (subprogram_count > 1)
break;
154 program->single_program_ = subprogram_count == 1;
159 intptr_t count_from_first_library_offset =
164 count_from_first_library_offset,
166 program->constant_table_offset_ = reader->
ReadUInt32();
168 program->name_table_offset_ = reader->
ReadUInt32();
169 program->metadata_payloads_offset_ = reader->
ReadUInt32();
170 program->metadata_mappings_offset_ = reader->
ReadUInt32();
171 program->string_table_offset_ = reader->
ReadUInt32();
174 program->component_index_offset_ = reader->
ReadUInt32();
183 const char* script_uri,
184 const char**
error ) {
187 if (script_uri ==
nullptr) {
190 if (!isolate_group->HasTagHandler()) {
193 std::unique_ptr<kernel::Program> kernel_program;
198 if (ret.IsExternalTypedData()) {
199 const auto& typed_data = ExternalTypedData::Cast(ret);
201 return kernel_program;
202 }
else if (
error !=
nullptr) {
210 return kernel_program;
214 intptr_t buffer_length,
215 const char**
error) {
219 kExternalTypedDataUint8ArrayCid,
const_cast<uint8_t*
>(
buffer),
227 const char**
error) {
static Dart_Handle NewHandle(Thread *thread, ObjectPtr raw)
static ExternalTypedDataPtr New(intptr_t class_id, uint8_t *data, intptr_t len, Heap::Space space=Heap::kNew, bool perform_eager_msan_initialization_check=true)
static StringPtr New(const char *cstr, Heap::Space space=Heap::kNew)
static Thread * Current()
IsolateGroup * isolate_group() const
static TypedDataPtr New(intptr_t class_id, intptr_t len, Heap::Space space=Heap::kNew)
static const char * SdkHash()
static std::unique_ptr< Program > ReadFromBuffer(const uint8_t *buffer, intptr_t buffer_length, const char **error=nullptr)
const TypedDataBase & binary()
static std::unique_ptr< Program > ReadFrom(Reader *reader, const char **error=nullptr)
static std::unique_ptr< Program > ReadFromTypedData(const ExternalTypedData &typed_data, const char **error=nullptr)
static std::unique_ptr< Program > ReadFromFile(const char *script_uri, const char **error=nullptr)
const TypedDataBase * typed_data()
uint32_t ReadFromIndexNoReset(intptr_t end_offset, intptr_t fields_before, intptr_t list_size, intptr_t list_index)
void set_offset(intptr_t offset)
TypedDataPtr ReadLineStartsData(intptr_t line_start_count)
static const char * TagName(Tag tag)
const uint8_t * BufferAt(intptr_t offset)
struct _Dart_Handle * Dart_Handle
const uint8_t uint32_t uint32_t GError ** error
#define CASE(Name, value)
#define KERNEL_TAG_LIST(V)
bool IsValidSdkHash(const uint8_t *sdk_hash)
const char * kKernelInvalidMagicIdentifier
const char * kKernelInvalidSdkHash
const int kSdkHashSizeInBytes
const char * kKernelInvalidSizeIndicated
const char * kKernelInvalidBinaryFormatVersion
const char * kKernelInvalidFilesize
static const uint32_t kMagicProgramFile
static constexpr int SourceTableFieldCountFromFirstLibraryOffset
static constexpr int LibraryCountFieldCountFromEnd
static const uint32_t kSupportedKernelFormatVersion
const char * kSdkHashNull
DART_EXPORT const char * Dart_GetError(Dart_Handle handle)
constexpr uint16_t kMaxUint16
DEF_SWITCHES_START aot vmservice shared library Name of the *so containing AOT compiled Dart assets for launching the service isolate vm snapshot The VM snapshot data that will be memory mapped as read only SnapshotAssetPath must be present isolate snapshot The isolate snapshot data that will be memory mapped as read only SnapshotAssetPath must be present cache dir Path to the cache directory This is different from the persistent_cache_path in embedder which is used for Skia shader cache icu native lib Path to the library file that exports the ICU data vm service The hostname IP address on which the Dart VM Service should be served If not defaults to or::depending on whether ipv6 is specified vm service A custom Dart VM Service port The default is to pick a randomly available open port disable vm Disable the Dart VM Service The Dart VM Service is never available in release mode disable vm service Disable mDNS Dart VM Service publication Bind to the IPv6 localhost address for the Dart VM Service Ignored if vm service host is set endless trace buffer
it will be possible to load the file into Perfetto s trace viewer disable asset Prevents usage of any non test fonts unless they were explicitly Loaded via prefetched default font Indicates whether the embedding started a prefetch of the default font manager before creating the engine run In non interactive keep the shell running after the Dart script has completed enable serial On low power devices with low core running concurrent GC tasks on threads can cause them to contend with the UI thread which could potentially lead to jank This option turns off all concurrent GC activities domain network JSON encoded network policy per domain This overrides the DisallowInsecureConnections switch Embedder can specify whether to allow or disallow insecure connections at a domain level old gen heap size