31 zone_(thread->zone()),
32 register_function_(
Function::Handle(thread->zone())),
33 service_isolate_(thread->isolate()) {}
91 if (FLAG_trace_service) {
92 OS::PrintErr(
"vm-service: Booting dart:vmservice library.\n");
98 if (FLAG_trace_service) {
99 OS::PrintErr(
"vm-service: Registering running isolates.\n");
109 if (FLAG_trace_service) {
112 isolate->HasLivePorts() ?
"yes" :
"no");
121 if (address.IsNull()) {
134 arguments->NativeArgAt(1));
168 : rs_(bytes, bytes_length) {}
174 intptr_t data_length;
175 if (Next(&filename, &
data, &data_length)) {
176 filenames_.
Add(filename);
178 content_lengths_.
Add(data_length);
194 enum TarHeaderFields {
195 kTarHeaderFilenameOffset = 0,
196 kTarHeaderFilenameSize = 100,
197 kTarHeaderSizeOffset = 124,
198 kTarHeaderSizeSize = 12,
199 kTarHeaderTypeOffset = 156,
200 kTarHeaderTypeSize = 1,
201 kTarHeaderSize = 512,
218 bool HasNext()
const {
return !EndOfArchive(); }
220 bool Next(
char** filename, uint8_t**
data, intptr_t* data_length) {
221 intptr_t startOfBlock = rs_.
Position();
222 *filename = ReadFilename();
223 rs_.
SetPosition(startOfBlock + kTarHeaderSizeOffset);
224 intptr_t
size = ReadSize();
225 rs_.
SetPosition(startOfBlock + kTarHeaderTypeOffset);
226 TarType
type = ReadType();
227 SeekToNextBlock(kTarHeaderSize);
228 if ((
type != kTarRegType) && (
type != kTarAregType)) {
237 void SeekToNextBlock(intptr_t blockSize) {
238 intptr_t remainder = blockSize - (rs_.
Position() % blockSize);
242 uint8_t PeekByte(intptr_t
i)
const {
246 bool EndOfArchive()
const {
250 for (intptr_t
i = 0;
i < (kTarHeaderSize * 2);
i++) {
251 if (PeekByte(
i) != 0) {
262 void SkipContents(intptr_t
size) {
264 SeekToNextBlock(kTarHeaderSize);
267 intptr_t ReadCString(
char**
s, intptr_t
length) {
269 char*
result =
new char[to_read + 1];
279 intptr_t ReadSize() {
283 ReadCString(&octalSize, kTarHeaderSizeSize);
293 char* ReadFilename() {
295 intptr_t result_length = ReadCString(&
result, kTarHeaderFilenameSize);
299 char* fixed_result =
new char[result_length + 2];
300 fixed_result[0] =
'/';
301 strncpy(&fixed_result[1],
result, result_length);
302 fixed_result[result_length + 1] =
'\0';
307 void ReadContents(uint8_t**
data, intptr_t
size) {
310 SeekToNextBlock(kTarHeaderSize);
315 GrowableArray<char*> filenames_;
316 GrowableArray<uint8_t*> contents_;
317 GrowableArray<intptr_t> content_lengths_;
323 uint8_t*
data =
reinterpret_cast<uint8_t*
>(peer);
351 intptr_t archive_size = archive.
Length();
359 intptr_t filename_length = strlen(filename);
364 reinterpret_cast<uint8_t*
>(filename), filename_length);
377 return Api::UnwrapArrayHandle(thread->zone(), result_list).ptr();
391 user_tags_(user_tags),
392 set_streamable_(set_streamable) {}
401 for (intptr_t
i = 0;
i < user_tags_->
Length(); ++
i) {
402 label ^= user_tags_->
At(
i);
413 bool set_streamable_;
422 arguments->NativeArgAt(0));
425 for (intptr_t
i = 0;
i < user_tags.Length(); ++
i) {
426 obj = user_tags.At(
i);
438 arguments->NativeArgAt(0));
441 for (intptr_t
i = 0;
i < user_tags.Length(); ++
i) {
442 obj = user_tags.At(
i);
static Dart_Handle NewHandle(Thread *thread, ObjectPtr raw)
static const Bool & Get(bool value)
ObjectPtr At(intptr_t index) const
static bool IsVMInternalIsolate(const Isolate *isolate)
static void VisitIsolates(IsolateVisitor *visitor)
void set_is_service_registered(bool value)
Dart_Port main_port() const
const char * name() const
static void static void PrintErr(const char *format,...) PRINTF_ATTRIBUTE(1
virtual const char * ToCString() const
static bool PostMessage(std::unique_ptr< Message > message, bool before_events=false)
intptr_t Position() const
intptr_t PendingBytes() const
const uint8_t * AddressOfCurrentPosition() const
void Advance(intptr_t value)
void SetPosition(intptr_t value)
void ReadBytes(void *addr, intptr_t len)
virtual void VisitIsolate(Isolate *isolate)
RegisterRunningIsolatesVisitor(Thread *thread)
static void RegisterRunningIsolates(const GrowableArray< Dart_Port > &isolate_ports, const GrowableArray< const String * > &isolate_names)
static void SetServerAddress(const char *address)
static void BootVmServiceLibrary()
static ErrorPtr HandleRootMessage(const Array &message)
static void CancelStream(const char *stream_id)
static bool ListenStream(const char *stream_id, bool include_privates)
static ObjectPtr RequestAssets()
static ErrorPtr HandleObjectRootMessage(const Array &message)
static SmiPtr New(intptr_t value)
static StringPtr New(const char *cstr, Heap::Space space=Heap::kNew)
TarArchive(uint8_t *bytes, intptr_t bytes_length)
intptr_t NextContentLength()
virtual void VisitIsolate(Isolate *isolate)
UserTagIsolatesVisitor(Thread *thread, const GrowableObjectArray *user_tags, bool set_streamable)
void set_streamable(bool streamable)
static UserTagPtr FindTagInIsolate(Isolate *isolate, Thread *thread, const String &label)
static T Minimum(T x, T y)
struct _Dart_Handle * Dart_Handle
SK_API bool Read(SkStreamSeekable *src, SkDocumentPage *dstArray, int dstArrayCount, const SkDeserialProcs *=nullptr)
DART_EXPORT Dart_Handle Dart_NewExternalTypedDataWithFinalizer(Dart_TypedData_Type type, void *data, intptr_t length, void *peer, intptr_t external_allocation_size, Dart_HandleFinalizer callback)
DART_EXPORT Dart_Handle Dart_NewStringFromUTF8(const uint8_t *utf8_array, intptr_t length)
DART_EXPORT Dart_Handle Dart_TypedDataAcquireData(Dart_Handle object, Dart_TypedData_Type *type, void **data, intptr_t *len)
DART_EXPORT Dart_Handle Dart_ListSetAt(Dart_Handle list, intptr_t index, Dart_Handle value)
DART_EXPORT bool Dart_IsError(Dart_Handle handle)
static void ContentsFinalizer(void *isolate_callback_data, void *peer)
DART_EXPORT Dart_Handle Dart_TypedDataReleaseData(Dart_Handle object)
std::unique_ptr< Message > WriteMessage(bool same_group, const Object &obj, Dart_Port dest_port, Message::Priority priority)
DEFINE_NATIVE_ENTRY(List_allocate, 0, 2)
DART_EXPORT Dart_Handle Dart_NewList(intptr_t length)
static int8_t data[kExtLength]
DECLARE_FLAG(bool, show_invisible_frames)
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
#define GET_NATIVE_ARGUMENT(type, name, value)
#define GET_NON_NULL_NATIVE_ARGUMENT(type, name, value)