Flutter Engine
The Flutter Engine
json_stream.cc
Go to the documentation of this file.
1// Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
2// for details. All rights reserved. Use of this source code is governed by a
3// BSD-style license that can be found in the LICENSE file.
4
5#include "platform/assert.h"
6
8#include "platform/unicode.h"
9#include "vm/dart_entry.h"
10#include "vm/debugger.h"
11#include "vm/heap/safepoint.h"
12#include "vm/json_stream.h"
13#include "vm/message.h"
14#include "vm/metrics.h"
15#include "vm/object.h"
16#include "vm/service.h"
17#include "vm/service_event.h"
18#include "vm/timeline.h"
19
20namespace dart {
21
22#ifndef PRODUCT
23
24DECLARE_FLAG(bool, trace_service);
25
26JSONStream::JSONStream(intptr_t buf_size)
27 : writer_(buf_size),
28 default_id_zone_(),
29 id_zone_(&default_id_zone_),
30 reply_port_(ILLEGAL_PORT),
31 seq_(nullptr),
32 parameter_keys_(nullptr),
33 parameter_values_(nullptr),
34 method_(""),
35 param_keys_(nullptr),
36 param_values_(nullptr),
37 num_params_(0),
38 offset_(0),
39 count_(-1),
40 include_private_members_(true),
41 ignore_object_depth_(0) {
42 ObjectIdRing* ring = nullptr;
43 Isolate* isolate = Isolate::Current();
44 if (isolate != nullptr) {
45 ring = isolate->EnsureObjectIdRing();
46 }
47 default_id_zone_.Init(ring, ObjectIdRing::kAllocateId);
48}
49
51 Dart_Port reply_port,
52 const Instance& seq,
53 const String& method,
54 const Array& param_keys,
55 const Array& param_values,
56 bool parameters_are_dart_objects) {
58 seq_ = &Instance::ZoneHandle(seq.ptr());
59 method_ = method.ToCString();
60
61 if (parameters_are_dart_objects) {
62 parameter_keys_ = &Array::ZoneHandle(param_keys.ptr());
63 parameter_values_ = &Array::ZoneHandle(param_values.ptr());
64 ASSERT(parameter_keys_->Length() == parameter_values_->Length());
65 } else if (param_keys.Length() > 0) {
66 String& string_iterator = String::Handle();
67 ASSERT(param_keys.Length() == param_values.Length());
68 const char** param_keys_native =
69 zone->Alloc<const char*>(param_keys.Length());
70 const char** param_values_native =
71 zone->Alloc<const char*>(param_keys.Length());
72 for (intptr_t i = 0; i < param_keys.Length(); i++) {
73 string_iterator ^= param_keys.At(i);
74 param_keys_native[i] =
75 zone->MakeCopyOfString(string_iterator.ToCString());
76 string_iterator ^= param_values.At(i);
77 param_values_native[i] =
78 zone->MakeCopyOfString(string_iterator.ToCString());
79 }
80 SetParams(param_keys_native, param_values_native, param_keys.Length());
81 }
82
83 if (FLAG_trace_service) {
84 Isolate* isolate = Isolate::Current();
85 ASSERT(isolate != nullptr);
86 int64_t main_port = static_cast<int64_t>(isolate->main_port());
87 const char* isolate_name = isolate->name();
88 setup_time_micros_ = OS::GetCurrentTimeMicros();
89 OS::PrintErr("[+%" Pd64 "ms] Isolate (%" Pd64
90 ") %s processing service "
91 "request %s\n",
92 Dart::UptimeMillis(), main_port, isolate_name, method_);
93 }
94 const char* kIncludePrivateMembersKey = "_includePrivateMembers";
95 if (HasParam(kIncludePrivateMembersKey)) {
96 include_private_members_ = ParamIs(kIncludePrivateMembersKey, "true");
97 }
98 buffer()->Printf("{\"jsonrpc\":\"2.0\", \"result\":");
99}
100
102 Clear();
103 buffer()->Printf("{\"jsonrpc\":\"2.0\", \"error\":");
104}
105
106static const char* GetJSONRpcErrorMessage(intptr_t code) {
107 switch (code) {
108 case kParseError:
109 return "Parse error";
110 case kInvalidRequest:
111 return "Invalid Request";
112 case kMethodNotFound:
113 return "Method not found";
114 case kInvalidParams:
115 return "Invalid params";
116 case kInternalError:
117 return "Internal error";
118 case kFeatureDisabled:
119 return "Feature is disabled";
121 return "Cannot add breakpoint";
123 return "Stream already subscribed";
125 return "Stream not subscribed";
127 return "Isolate must be runnable";
129 return "Isolate must be paused";
130 case kCannotResume:
131 return "Cannot resume execution";
133 return "Isolate is reloading";
135 return "Isolate cannot be reloaded";
137 return "Isolate must have reloaded";
139 return "File system already exists";
141 return "File system does not exist";
143 return "File does not exist";
145 return "The timeline related request could not be completed due to the "
146 "current configuration";
147 default:
148 return "Extension error";
149 }
150}
151
153 JSONObject jsobj(obj, "request");
154 jsobj.AddProperty("method", js->method());
155 {
156 JSONObject params(&jsobj, "params");
157 for (intptr_t i = 0; i < js->num_params(); i++) {
158 params.AddProperty(js->GetParamKey(i), js->GetParamValue(i));
159 }
160 }
161}
162
163void JSONStream::PrintError(intptr_t code, const char* details_format, ...) {
164 SetupError();
165 JSONObject jsobj(this);
166 jsobj.AddProperty("code", code);
167 jsobj.AddProperty("message", GetJSONRpcErrorMessage(code));
168 {
169 JSONObject data(&jsobj, "data");
170 PrintRequest(&data, this);
171 if (details_format != nullptr) {
172 va_list measure_args;
173 va_start(measure_args, details_format);
174 intptr_t len = Utils::VSNPrint(nullptr, 0, details_format, measure_args);
175 va_end(measure_args);
176
177 char* buffer = Thread::Current()->zone()->Alloc<char>(len + 1);
178 va_list print_args;
179 va_start(print_args, details_format);
180 Utils::VSNPrint(buffer, (len + 1), details_format, print_args);
181 va_end(print_args);
182 data.AddProperty("details", buffer);
183 }
184 }
185}
186
187void JSONStream::PostNullReply(Dart_Port port) {
190}
191
192static void Finalizer(void* isolate_callback_data, void* buffer) {
193 free(buffer);
194}
195
197 ASSERT(seq_ != nullptr);
199 set_reply_port(ILLEGAL_PORT); // Prevent double replies.
200 if (seq_->IsString()) {
201 const String& str = String::Cast(*seq_);
202 PrintProperty("id", str.ToCString());
203 } else if (seq_->IsInteger()) {
204 const Integer& integer = Integer::Cast(*seq_);
205 PrintProperty64("id", integer.AsInt64Value());
206 } else if (seq_->IsDouble()) {
207 const Double& dbl = Double::Cast(*seq_);
208 PrintProperty("id", dbl.value());
209 } else if (seq_->IsNull()) {
210 if (port == ILLEGAL_PORT) {
211 // This path is only used in tests.
212 buffer()->AddChar('}'); // Finish our message.
213 char* cstr;
214 intptr_t length;
215 Steal(&cstr, &length);
216 OS::PrintErr("-----\nDropping reply:\n%s\n-----\n", cstr);
217 free(cstr);
218 }
219 // JSON-RPC 2.0 says that a request with a null ID shouldn't get a reply.
220 PostNullReply(port);
221 return;
222 }
224
225 buffer()->AddChar('}'); // Finish our message.
226 char* cstr;
227 intptr_t length;
228 Steal(&cstr, &length);
229
230 bool result;
231 {
233 Dart_CObject bytes;
237 bytes.value.as_external_typed_data.data = reinterpret_cast<uint8_t*>(cstr);
238 bytes.value.as_external_typed_data.peer = cstr;
240 Dart_CObject* elements[1];
241 elements[0] = &bytes;
244 message.value.as_array.length = 1;
245 message.value.as_array.values = elements;
247 }
248
249 if (!result) {
250 free(cstr);
251 }
252
253 if (FLAG_trace_service) {
254 Isolate* isolate = Isolate::Current();
255 ASSERT(isolate != nullptr);
256 int64_t main_port = static_cast<int64_t>(isolate->main_port());
257 const char* isolate_name = isolate->name();
258 int64_t total_time = OS::GetCurrentTimeMicros() - setup_time_micros_;
259 if (result) {
260 OS::PrintErr("[+%" Pd64 "ms] Isolate (%" Pd64
261 ") %s processed service request %s (%" Pd64 "us)\n",
262 Dart::UptimeMillis(), main_port, isolate_name, method_,
263 total_time);
264 } else {
265 OS::PrintErr("[+%" Pd64 "ms] Isolate (%" Pd64
266 ") %s processed service request %s (%" Pd64 "us) FAILED\n",
267 Dart::UptimeMillis(), main_port, isolate_name, method_,
268 total_time);
269 }
270 }
271}
272
273const char* JSONStream::LookupParam(const char* key) const {
274 for (int i = 0; i < num_params(); i++) {
275 if (strcmp(key, param_keys_[i]) == 0) {
276 return param_values_[i];
277 }
278 }
279 return nullptr;
280}
281
282bool JSONStream::HasParam(const char* key) const {
283 ASSERT(key);
284 return LookupParam(key) != nullptr;
285}
286
287bool JSONStream::ParamIs(const char* key, const char* value) const {
288 ASSERT(key);
289 ASSERT(value);
290 const char* key_value = LookupParam(key);
291 return (key_value != nullptr) && (strcmp(key_value, value) == 0);
292}
293
295 intptr_t* offset,
296 intptr_t* count) {
297 // This function is written to avoid adding (count + offset) in case
298 // that triggers an integer overflow.
299 *offset = offset_;
300 if (*offset > length) {
301 *offset = length;
302 }
303 intptr_t remaining = length - *offset;
304 *count = count_;
305 if (*count < 0 || *count > remaining) {
306 *count = remaining;
307 }
308}
309void JSONStream::PrintfValue(const char* format, ...) {
310 va_list args;
312 VPrintfValue(format, args);
313 va_end(args);
314}
315
316void JSONStream::PrintValue(const Object& o, bool ref) {
318 o.PrintJSON(this, ref);
319}
320
321void JSONStream::PrintValue(Breakpoint* bpt) {
323 bpt->PrintJSON(this);
324}
325
326void JSONStream::PrintValue(TokenPosition tp) {
328 PrintValue(static_cast<intptr_t>(tp.Serialize()));
329}
330
331void JSONStream::PrintValue(const ServiceEvent* event) {
333 event->PrintJSON(this);
334}
335
336void JSONStream::PrintValue(Metric* metric) {
338 metric->PrintJSON(this);
339}
340
341void JSONStream::PrintValue(MessageQueue* queue) {
343 queue->PrintJSON(this);
344}
345
346void JSONStream::PrintValue(Isolate* isolate, bool ref) {
348 isolate->PrintJSON(this, ref);
349}
350
351void JSONStream::PrintValue(IsolateGroup* isolate_group, bool ref) {
353 isolate_group->PrintJSON(this, ref);
354}
355
356void JSONStream::PrintValue(const TimelineEvent* timeline_event) {
358 timeline_event->PrintJSON(this);
359}
360
361void JSONStream::PrintValue(const TimelineEventBlock* timeline_event_block) {
363 timeline_event_block->PrintJSON(this);
364}
365
366void JSONStream::PrintValueVM(bool ref) {
368 Service::PrintJSONForVM(this, ref);
369}
370
371void JSONStream::PrintServiceId(const Object& o) {
372 ASSERT(id_zone_ != nullptr);
373 PrintProperty("id", id_zone_->GetServiceId(o));
374}
375
376#define PRIVATE_NAME_CHECK() \
377 if (!IsAllowableKey(name) || ignore_object_depth_ > 0) return
378
379void JSONStream::PrintProperty(const char* name, const ServiceEvent* event) {
381 PrintPropertyName(name);
382 PrintValue(event);
383}
384
385void JSONStream::PrintProperty(const char* name, Breakpoint* bpt) {
387 PrintPropertyName(name);
388 PrintValue(bpt);
389}
390
391void JSONStream::PrintProperty(const char* name, TokenPosition tp) {
393 PrintPropertyName(name);
394 PrintValue(tp);
395}
396
397void JSONStream::PrintProperty(const char* name, Metric* metric) {
399 PrintPropertyName(name);
400 PrintValue(metric);
401}
402
403void JSONStream::PrintProperty(const char* name, MessageQueue* queue) {
405 PrintPropertyName(name);
406 PrintValue(queue);
407}
408
409void JSONStream::PrintProperty(const char* name, Isolate* isolate) {
411 PrintPropertyName(name);
412 PrintValue(isolate);
413}
414
415void JSONStream::PrintProperty(const char* name, IsolateGroup* isolate_group) {
417 PrintPropertyName(name);
418 PrintValue(isolate_group);
419}
420
421void JSONStream::PrintProperty(const char* name,
422 const TimelineEvent* timeline_event) {
424 PrintPropertyName(name);
425 PrintValue(timeline_event);
426}
427
428void JSONStream::PrintProperty(const char* name,
429 const TimelineEventBlock* timeline_event_block) {
431 PrintPropertyName(name);
432 PrintValue(timeline_event_block);
433}
434
435void JSONStream::PrintfProperty(const char* name, const char* format, ...) {
437 va_list args;
439 writer_.VPrintfProperty(name, format, args);
440 va_end(args);
441}
442
444 reply_port_ = port;
445}
446
448 if (parameter_keys_ == nullptr) {
449 return 0;
450 }
451 ASSERT(parameter_keys_ != nullptr);
452 ASSERT(parameter_values_ != nullptr);
453 return parameter_keys_->Length();
454}
455
457 ASSERT((i >= 0) && (i < NumObjectParameters()));
458 return parameter_keys_->At(i);
459}
460
462 ASSERT((i >= 0) && (i < NumObjectParameters()));
463 return parameter_values_->At(i);
464}
465
466ObjectPtr JSONStream::LookupObjectParam(const char* c_key) const {
467 const String& key = String::Handle(String::New(c_key));
469 const intptr_t num_object_parameters = NumObjectParameters();
470 for (intptr_t i = 0; i < num_object_parameters; i++) {
472 if (test.IsString() && String::Cast(test).Equals(key)) {
474 }
475 }
476 return Object::null();
477}
478
479void JSONStream::SetParams(const char** param_keys,
480 const char** param_values,
481 intptr_t num_params) {
482 param_keys_ = param_keys;
483 param_values_ = param_values;
484 num_params_ = num_params;
485}
486
487void JSONStream::PrintProperty(const char* name, const Object& o, bool ref) {
489 PrintPropertyName(name);
490 PrintValue(o, ref);
491}
492
493void JSONStream::PrintPropertyVM(const char* name, bool ref) {
495 PrintPropertyName(name);
496 PrintValueVM(ref);
497}
498
499JSONObject::JSONObject(const JSONArray* arr) : stream_(arr->stream_) {
500 stream_->OpenObject();
501}
502
503void JSONObject::AddFixedServiceId(const char* format, ...) const {
504 // Mark that this id is fixed.
505 AddProperty("fixedId", true);
506 // Add the id property.
507 va_list args;
509 stream_->VPrintfProperty("id", format, args);
510 va_end(args);
511}
512
513void JSONObject::AddServiceId(const char* format, ...) const {
514 // Add the id property.
515 va_list args;
517 stream_->VPrintfProperty("id", format, args);
518 va_end(args);
519}
520
522 TokenPosition token_pos,
523 TokenPosition end_token_pos) const {
524 JSONObject location(this, "location");
525 location.AddProperty("type", "SourceLocation");
526 location.AddProperty("script", script);
527 location.AddProperty("tokenPos", token_pos);
528 if (end_token_pos.IsReal()) {
529 location.AddProperty("endTokenPos", end_token_pos);
530 }
531 intptr_t line = -1;
532 intptr_t column = -1;
533 // Add line and column information if token_pos is real.
534 if (script.GetTokenLocation(token_pos, &line, &column)) {
535 location.AddProperty("line", line);
536 location.AddProperty("column", column);
537 }
538}
539
540void JSONObject::AddLocation(const BreakpointLocation* bpt_loc) const {
541 ASSERT(bpt_loc->IsResolved());
542
543 Zone* zone = Thread::Current()->zone();
545 TokenPosition token_pos = TokenPosition::kNoSource;
546 bpt_loc->GetCodeLocation(&script, &token_pos);
547 AddLocation(script, token_pos);
548}
549
550void JSONObject::AddLocationLine(const Script& script, intptr_t line) const {
551 JSONObject location(this, "location");
552 location.AddProperty("type", "SourceLocation");
553 location.AddProperty("script", script);
554 location.AddProperty("tokenPos", TokenPosition::kNoSource);
555 if (line > 0) {
556 location.AddProperty("line", line);
557 }
558}
559
561 const BreakpointLocation* bpt_loc) const {
562 ASSERT(!bpt_loc->IsResolved());
563
564 Zone* zone = Thread::Current()->zone();
566 TokenPosition token_pos = TokenPosition::kNoSource;
567 bpt_loc->GetCodeLocation(&script, &token_pos);
568
569 JSONObject location(this, "location");
570 location.AddProperty("type", "UnresolvedSourceLocation");
571 if (!script.IsNull()) {
572 location.AddProperty("script", script);
573 } else {
574 const String& scriptUri = String::Handle(zone, bpt_loc->url());
575 location.AddPropertyStr("scriptUri", scriptUri);
576 }
577 if (bpt_loc->requested_line_number() >= 0) {
578 // This unresolved breakpoint was specified at a particular line.
579 location.AddProperty("line", bpt_loc->requested_line_number());
580 if (bpt_loc->requested_column_number() >= 0) {
581 location.AddProperty("column", bpt_loc->requested_column_number());
582 }
583 } else {
584 // This unresolved breakpoint was requested at some function entry.
585 location.AddProperty("tokenPos", token_pos);
586 }
587}
588
589void JSONObject::AddPropertyF(const char* name, const char* format, ...) const {
590 va_list args;
592 stream_->VPrintfProperty(name, format, args);
593 va_end(args);
594}
595
596void JSONArray::AddValueF(const char* format, ...) const {
597 va_list args;
599 stream_->VPrintfValue(format, args);
600 va_end(args);
601}
602
603void JSONBase64String::AppendBytes(const uint8_t* bytes, intptr_t length) {
604 ASSERT(bytes != nullptr);
605
606 if (num_queued_bytes_ > 0) {
607 while (length > 0) {
608 queued_bytes_[num_queued_bytes_++] = bytes[0];
609 bytes++;
610 length--;
611 if (num_queued_bytes_ == 3) {
612 break;
613 }
614 }
615 if (num_queued_bytes_ < 3) {
616 return;
617 }
618 stream_->AppendBytesInBase64(queued_bytes_, 3);
619 num_queued_bytes_ = 0;
620 }
621
622 intptr_t length_mod_3 = length % 3;
623 intptr_t largest_multiple_of_3_less_than_or_equal_to_length =
624 length - length_mod_3;
625 if (largest_multiple_of_3_less_than_or_equal_to_length > 0) {
626 stream_->AppendBytesInBase64(
627 bytes, largest_multiple_of_3_less_than_or_equal_to_length);
628 }
629
630 for (intptr_t i = 0; i < length_mod_3; ++i) {
631 queued_bytes_[i] =
632 bytes[largest_multiple_of_3_less_than_or_equal_to_length + i];
633 }
634 num_queued_bytes_ = length_mod_3;
635}
636
637#endif // !PRODUCT
638
639} // namespace dart
int count
Definition: FontMgrTest.cpp:50
ObjectPtr At(intptr_t index) const
Definition: object.h:10875
intptr_t Length() const
Definition: object.h:10829
intptr_t Printf(const char *format,...) PRINTF_ATTRIBUTE(2
Definition: text_buffer.cc:14
void AddChar(char ch)
Definition: text_buffer.cc:49
intptr_t requested_column_number() const
Definition: debugger.h:141
StringPtr url() const
Definition: debugger.h:138
bool IsResolved() const
Definition: debugger.h:152
void GetCodeLocation(Script *script, TokenPosition *token_pos) const
Definition: debugger.cc:142
intptr_t requested_line_number() const
Definition: debugger.h:140
static int64_t UptimeMillis()
Definition: dart.h:76
double value() const
Definition: object.h:10115
virtual int64_t AsInt64Value() const
Definition: object.cc:23058
static Isolate * Current()
Definition: isolate.h:986
ObjectIdRing * EnsureObjectIdRing()
Definition: isolate.cc:3014
Dart_Port main_port() const
Definition: isolate.h:1048
const char * name() const
Definition: isolate.h:1043
void AddValueF(const char *format,...) const PRINTF_ATTRIBUTE(2
Definition: json_stream.cc:596
void AppendBytes(const uint8_t *bytes, intptr_t length)
Definition: json_stream.cc:603
void void void AddLocation(const Script &script, TokenPosition token_pos, TokenPosition end_token_pos=TokenPosition::kNoSource) const
Definition: json_stream.cc:521
void AddProperty(const char *name, bool b) const
Definition: json_stream.h:395
void AddServiceId(const Object &o) const
Definition: json_stream.h:380
void AddUnresolvedLocation(const BreakpointLocation *bpt_loc) const
Definition: json_stream.cc:560
bool AddPropertyStr(const char *name, const String &s, intptr_t offset=0, intptr_t count=-1) const
Definition: json_stream.h:421
void AddFixedServiceId(const char *format,...) const PRINTF_ATTRIBUTE(2
Definition: json_stream.cc:503
JSONObject(JSONStream *stream)
Definition: json_stream.h:370
void AddPropertyF(const char *name, const char *format,...) const PRINTF_ATTRIBUTE(3
Definition: json_stream.cc:589
void AddLocationLine(const Script &script, intptr_t line) const
Definition: json_stream.cc:550
void Setup(Zone *zone, Dart_Port reply_port, const Instance &seq, const String &method, const Array &param_keys, const Array &param_values, bool parameters_are_dart_objects=false)
Definition: json_stream.cc:50
void PrintCommaIfNeeded()
Definition: json_stream.h:175
intptr_t num_params() const
Definition: json_stream.h:129
ObjectPtr GetObjectParameterKey(intptr_t i) const
Definition: json_stream.cc:456
ObjectPtr LookupObjectParam(const char *key) const
Definition: json_stream.cc:466
bool ParamIs(const char *key, const char *value) const
Definition: json_stream.cc:287
void ComputeOffsetAndCount(intptr_t length, intptr_t *offset, intptr_t *count)
Definition: json_stream.cc:294
Dart_Port reply_port() const
Definition: json_stream.h:122
bool HasParam(const char *key) const
Definition: json_stream.cc:282
const char ** param_values() const
Definition: json_stream.h:143
void void PostReply()
Definition: json_stream.cc:196
void set_reply_port(Dart_Port port)
Definition: json_stream.cc:443
const char ** param_keys() const
Definition: json_stream.h:142
JSONStream(intptr_t buf_size=256)
Definition: json_stream.cc:26
intptr_t NumObjectParameters() const
Definition: json_stream.cc:447
TextBuffer * buffer()
Definition: json_stream.h:97
void PrintError(intptr_t code, const char *details_format,...) PRINTF_ATTRIBUTE(3
Definition: json_stream.cc:163
ObjectPtr GetObjectParameterValue(intptr_t i) const
Definition: json_stream.cc:461
void Steal(char **buffer, intptr_t *buffer_length)
Definition: json_stream.h:100
const char * LookupParam(const char *key) const
Definition: json_stream.cc:273
const char * method() const
Definition: json_stream.h:141
void SetParams(const char **param_keys, const char **param_values, intptr_t num_params)
Definition: json_stream.cc:479
void void VPrintfProperty(const char *name, const char *format, va_list args)
Definition: json_writer.cc:276
static std::unique_ptr< Message > New(Args &&... args)
Definition: message.h:72
@ kNormalPriority
Definition: message.h:28
static void static void PrintErr(const char *format,...) PRINTF_ATTRIBUTE(1
static int64_t GetCurrentTimeMicros()
static ObjectPtr null()
Definition: object.h:433
ObjectPtr ptr() const
Definition: object.h:332
bool IsNull() const
Definition: object.h:363
static Object & Handle()
Definition: object.h:407
static Object & ZoneHandle()
Definition: object.h:419
static bool PostMessage(std::unique_ptr< Message > message, bool before_events=false)
Definition: port.cc:152
void Init(ObjectIdRing *ring, ObjectIdRing::IdPolicy policy)
Definition: service.cc:374
virtual char * GetServiceId(const Object &obj)=0
static void PrintJSONForVM(JSONStream *js, bool ref)
Definition: service.cc:5274
static StringPtr New(const char *cstr, Heap::Space space=Heap::kNew)
Definition: object.cc:23698
static const char * ToCString(Thread *thread, StringPtr ptr)
Definition: object.cc:24126
Zone * zone() const
Definition: thread_state.h:37
static Thread * Current()
Definition: thread.h:362
static int static int VSNPrint(char *str, size_t size, const char *format, va_list args)
char * MakeCopyOfString(const char *str)
Definition: zone.cc:270
ElementType * Alloc(intptr_t length)
#define ILLEGAL_PORT
Definition: dart_api.h:1535
int64_t Dart_Port
Definition: dart_api.h:1525
@ Dart_TypedData_kUint8
Definition: dart_api.h:2615
@ Dart_CObject_kArray
@ Dart_CObject_kExternalTypedData
const EmbeddedViewParams * params
#define ASSERT(E)
VkQueue queue
Definition: main.cc:55
G_BEGIN_DECLS G_MODULE_EXPORT FlValue * args
FlKeyEvent * event
uint8_t value
GAsyncResult * result
uint32_t uint32_t * format
#define PRIVATE_NAME_CHECK()
Definition: json_stream.cc:376
size_t length
Win32Message message
va_start(args, format)
va_end(args)
Definition: dart_vm.cc:33
const char *const name
static void Finalizer(void *isolate_callback_data, void *buffer)
Definition: json_stream.cc:192
static const char * GetJSONRpcErrorMessage(intptr_t code)
Definition: json_stream.cc:106
DART_EXPORT bool Dart_PostCObject(Dart_Port port_id, Dart_CObject *message)
static int8_t data[kExtLength]
static void PrintRequest(JSONObject *obj, JSONStream *js)
Definition: json_stream.cc:152
DECLARE_FLAG(bool, show_invisible_frames)
@ kParseError
Definition: json_stream.h:45
@ kCannotAddBreakpoint
Definition: json_stream.h:54
@ kFileDoesNotExist
Definition: json_stream.h:71
@ kStreamNotSubscribed
Definition: json_stream.h:56
@ kCannotResume
Definition: json_stream.h:59
@ kInternalError
Definition: json_stream.h:49
@ kMethodNotFound
Definition: json_stream.h:47
@ kFeatureDisabled
Definition: json_stream.h:53
@ kIsolateMustHaveReloaded
Definition: json_stream.h:62
@ kIsolateIsReloading
Definition: json_stream.h:60
@ kStreamAlreadySubscribed
Definition: json_stream.h:55
@ kFileSystemDoesNotExist
Definition: json_stream.h:70
@ kIsolateMustBePaused
Definition: json_stream.h:58
@ kInvalidRequest
Definition: json_stream.h:46
@ kIsolateMustBeRunnable
Definition: json_stream.h:57
@ kFileSystemAlreadyExists
Definition: json_stream.h:69
@ kInvalidTimelineRequest
Definition: json_stream.h:66
@ kInvalidParams
Definition: json_stream.h:48
@ kIsolateReloadBarred
Definition: json_stream.h:61
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 port
Definition: switches.h:87
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
Definition: switches.h:126
#define Pd64
Definition: globals.h:416
SeparatedVector2 offset
Dart_HandleFinalizer callback
union _Dart_CObject::@86 value
Dart_CObject_Type type
uint8_t * data
struct _Dart_CObject::@86::@91 as_external_typed_data