| Index: runtime/vm/object.cc
|
| diff --git a/runtime/vm/object.cc b/runtime/vm/object.cc
|
| index b7d6ead2191b67f513dcabb2e155638b8725aced..6fb26aa9a2d044f54ca8f68aa49222d6adac2e08 100644
|
| --- a/runtime/vm/object.cc
|
| +++ b/runtime/vm/object.cc
|
| @@ -1724,67 +1724,6 @@ void Object::Print() const {
|
| }
|
|
|
|
|
| -static void AddNameProperties(JSONObject* jsobj,
|
| - const String& name,
|
| - const String& vm_name) {
|
| - jsobj->AddProperty("name", name.ToCString());
|
| - if (!name.Equals(vm_name)) {
|
| - jsobj->AddProperty("_vmName", vm_name.ToCString());
|
| - }
|
| -}
|
| -
|
| -
|
| -void Object::AddCommonObjectProperties(JSONObject* jsobj,
|
| - const char* protocol_type,
|
| - bool ref) const {
|
| - const char* vm_type = JSONType();
|
| - bool same_type = (strcmp(protocol_type, vm_type) == 0);
|
| - if (ref) {
|
| - jsobj->AddPropertyF("type", "@%s", protocol_type);
|
| - } else {
|
| - jsobj->AddProperty("type", protocol_type);
|
| - }
|
| - if (!same_type) {
|
| - jsobj->AddProperty("_vmType", vm_type);
|
| - }
|
| - if (!ref || IsInstance() || IsNull()) {
|
| - // TODO(turnidge): Provide the type arguments here too?
|
| - const Class& cls = Class::Handle(this->clazz());
|
| - jsobj->AddProperty("class", cls);
|
| - }
|
| - if (!ref) {
|
| - if (raw()->IsHeapObject()) {
|
| - jsobj->AddProperty("size", raw()->Size());
|
| - } else {
|
| - jsobj->AddProperty("size", (intptr_t)0);
|
| - }
|
| - }
|
| -}
|
| -
|
| -
|
| -void Object::PrintJSON(JSONStream* stream, bool ref) const {
|
| - if (IsNull()) {
|
| - JSONObject jsobj(stream);
|
| - AddCommonObjectProperties(&jsobj, "Instance", ref);
|
| - jsobj.AddProperty("kind", "Null");
|
| - jsobj.AddFixedServiceId("objects/null");
|
| - jsobj.AddProperty("valueAsString", "null");
|
| - } else {
|
| - PrintJSONImpl(stream, ref);
|
| - }
|
| -}
|
| -
|
| -
|
| -void Object::PrintJSONImpl(JSONStream* stream, bool ref) const {
|
| - JSONObject jsobj(stream);
|
| - AddCommonObjectProperties(&jsobj, "Object", ref);
|
| - jsobj.AddServiceId(*this);
|
| - if (ref) {
|
| - return;
|
| - }
|
| -}
|
| -
|
| -
|
| RawString* Object::DictionaryName() const {
|
| return String::null();
|
| }
|
| @@ -4134,100 +4073,6 @@ const char* Class::ToCString() const {
|
| }
|
|
|
|
|
| -void Class::PrintJSONImpl(JSONStream* stream, bool ref) const {
|
| - Isolate* isolate = Isolate::Current();
|
| - JSONObject jsobj(stream);
|
| - if ((raw() == Class::null()) || (id() == kFreeListElement)) {
|
| - // TODO(turnidge): This is weird and needs to be changed.
|
| - jsobj.AddProperty("type", "null");
|
| - return;
|
| - }
|
| - AddCommonObjectProperties(&jsobj, "Class", ref);
|
| - jsobj.AddFixedServiceId("classes/%" Pd "", id());
|
| - const String& user_name = String::Handle(PrettyName());
|
| - const String& vm_name = String::Handle(Name());
|
| - AddNameProperties(&jsobj, user_name, vm_name);
|
| - if (ref) {
|
| - return;
|
| - }
|
| -
|
| - const Error& err = Error::Handle(EnsureIsFinalized(Thread::Current()));
|
| - if (!err.IsNull()) {
|
| - jsobj.AddProperty("error", err);
|
| - }
|
| - jsobj.AddProperty("abstract", is_abstract());
|
| - jsobj.AddProperty("const", is_const());
|
| - jsobj.AddProperty("_finalized", is_finalized());
|
| - jsobj.AddProperty("_implemented", is_implemented());
|
| - jsobj.AddProperty("_patch", is_patch());
|
| - jsobj.AddProperty("_traceAllocations", TraceAllocation(isolate));
|
| - const Class& superClass = Class::Handle(SuperClass());
|
| - if (!superClass.IsNull()) {
|
| - jsobj.AddProperty("super", superClass);
|
| - }
|
| - jsobj.AddProperty("library", Object::Handle(library()));
|
| - const Script& script = Script::Handle(this->script());
|
| - if (!script.IsNull()) {
|
| - jsobj.AddLocation(script, token_pos(), ComputeEndTokenPos());
|
| - }
|
| - {
|
| - JSONArray interfaces_array(&jsobj, "interfaces");
|
| - const Array& interface_array = Array::Handle(interfaces());
|
| - Type& interface_type = Type::Handle();
|
| - if (!interface_array.IsNull()) {
|
| - for (intptr_t i = 0; i < interface_array.Length(); ++i) {
|
| - interface_type ^= interface_array.At(i);
|
| - interfaces_array.AddValue(interface_type);
|
| - }
|
| - }
|
| - }
|
| - {
|
| - JSONArray fields_array(&jsobj, "fields");
|
| - const Array& field_array = Array::Handle(fields());
|
| - Field& field = Field::Handle();
|
| - if (!field_array.IsNull()) {
|
| - for (intptr_t i = 0; i < field_array.Length(); ++i) {
|
| - field ^= field_array.At(i);
|
| - fields_array.AddValue(field);
|
| - }
|
| - }
|
| - }
|
| - {
|
| - JSONArray functions_array(&jsobj, "functions");
|
| - const Array& function_array = Array::Handle(functions());
|
| - Function& function = Function::Handle();
|
| - if (!function_array.IsNull()) {
|
| - for (intptr_t i = 0; i < function_array.Length(); i++) {
|
| - function ^= function_array.At(i);
|
| - functions_array.AddValue(function);
|
| - }
|
| - }
|
| - }
|
| - {
|
| - JSONArray subclasses_array(&jsobj, "subclasses");
|
| - const GrowableObjectArray& subclasses =
|
| - GrowableObjectArray::Handle(direct_subclasses());
|
| - if (!subclasses.IsNull()) {
|
| - Class& subclass = Class::Handle();
|
| - for (intptr_t i = 0; i < subclasses.Length(); ++i) {
|
| - // TODO(turnidge): Use the Type directly once regis has added
|
| - // types to the vmservice.
|
| - subclass ^= subclasses.At(i);
|
| - subclasses_array.AddValue(subclass);
|
| - }
|
| - }
|
| - }
|
| - {
|
| - ClassTable* class_table = Isolate::Current()->class_table();
|
| - const ClassHeapStats* stats = class_table->StatsWithUpdatedSize(id());
|
| - if (stats != NULL) {
|
| - JSONObject allocation_stats(&jsobj, "_allocationStats");
|
| - stats->PrintToJSONObject(*this, &allocation_stats);
|
| - }
|
| - }
|
| -}
|
| -
|
| -
|
| void Class::InsertCanonicalConstant(intptr_t index,
|
| const Instance& constant) const {
|
| // The constant needs to be added to the list. Grow the list if it is full.
|
| @@ -4306,11 +4151,6 @@ const char* UnresolvedClass::ToCString() const {
|
| }
|
|
|
|
|
| -void UnresolvedClass::PrintJSONImpl(JSONStream* stream, bool ref) const {
|
| - Object::PrintJSONImpl(stream, ref);
|
| -}
|
| -
|
| -
|
| static uint32_t CombineHashes(uint32_t hash, uint32_t other_hash) {
|
| hash += other_hash;
|
| hash += hash << 10;
|
| @@ -4461,52 +4301,6 @@ bool TypeArguments::TypeTest(TypeTestKind test_kind,
|
| }
|
|
|
|
|
| -void TypeArguments::PrintJSONImpl(JSONStream* stream, bool ref) const {
|
| - JSONObject jsobj(stream);
|
| - // The index in the canonical_type_arguments table cannot be used as part of
|
| - // the object id (as in typearguments/id), because the indices are not
|
| - // preserved when the table grows and the entries get rehashed. Use the ring.
|
| - Isolate* isolate = Isolate::Current();
|
| - ObjectStore* object_store = isolate->object_store();
|
| - const Array& table = Array::Handle(object_store->canonical_type_arguments());
|
| - ASSERT(table.Length() > 0);
|
| - AddCommonObjectProperties(&jsobj, "TypeArguments", ref);
|
| - jsobj.AddServiceId(*this);
|
| - const String& user_name = String::Handle(PrettyName());
|
| - const String& vm_name = String::Handle(Name());
|
| - AddNameProperties(&jsobj, user_name, vm_name);
|
| - if (ref) {
|
| - return;
|
| - }
|
| - {
|
| - JSONArray jsarr(&jsobj, "types");
|
| - AbstractType& type_arg = AbstractType::Handle();
|
| - for (intptr_t i = 0; i < Length(); i++) {
|
| - type_arg = TypeAt(i);
|
| - jsarr.AddValue(type_arg);
|
| - }
|
| - }
|
| - if (!IsInstantiated()) {
|
| - JSONArray jsarr(&jsobj, "_instantiations");
|
| - Array& prior_instantiations = Array::Handle(instantiations());
|
| - ASSERT(prior_instantiations.Length() > 0); // Always at least a sentinel.
|
| - TypeArguments& type_args = TypeArguments::Handle();
|
| - intptr_t i = 0;
|
| - while (true) {
|
| - if (prior_instantiations.At(i) == Smi::New(StubCode::kNoInstantiator)) {
|
| - break;
|
| - }
|
| - JSONObject instantiation(&jsarr);
|
| - type_args ^= prior_instantiations.At(i);
|
| - instantiation.AddProperty("instantiator", type_args, true);
|
| - type_args ^= prior_instantiations.At(i + 1);
|
| - instantiation.AddProperty("instantiated", type_args, true);
|
| - i += 2;
|
| - }
|
| - }
|
| -}
|
| -
|
| -
|
| bool TypeArguments::HasInstantiations() const {
|
| const Array& prior_instantiations = Array::Handle(instantiations());
|
| ASSERT(prior_instantiations.Length() > 0); // Always at least a sentinel.
|
| @@ -5074,11 +4868,6 @@ const char* PatchClass::ToCString() const {
|
| }
|
|
|
|
|
| -void PatchClass::PrintJSONImpl(JSONStream* stream, bool ref) const {
|
| - Object::PrintJSONImpl(stream, ref);
|
| -}
|
| -
|
| -
|
| RawPatchClass* PatchClass::New(const Class& patched_class,
|
| const Class& origin_class) {
|
| const PatchClass& result = PatchClass::Handle(PatchClass::New());
|
| @@ -5124,6 +4913,9 @@ void PatchClass::set_script(const Script& value) const {
|
|
|
|
|
| bool Function::HasBreakpoint() const {
|
| + if (!FLAG_support_debugger) {
|
| + return false;
|
| + }
|
| Thread* thread = Thread::Current();
|
| return thread->isolate()->debugger()->HasBreakpoint(*this, thread->zone());
|
| }
|
| @@ -5784,7 +5576,8 @@ bool Function::CanBeInlined() const {
|
| Thread* thread = Thread::Current();
|
| return is_inlinable() &&
|
| !is_generated_body() &&
|
| - !thread->isolate()->debugger()->HasBreakpoint(*this, thread->zone());
|
| + (!FLAG_support_debugger ||
|
| + !thread->isolate()->debugger()->HasBreakpoint(*this, thread->zone()));
|
| }
|
|
|
|
|
| @@ -7062,109 +6855,6 @@ const char* Function::ToCString() const {
|
| }
|
|
|
|
|
| -static void AddFunctionServiceId(const JSONObject& jsobj,
|
| - const Function& f,
|
| - const Class& cls) {
|
| - // Special kinds of functions use indices in their respective lists.
|
| - intptr_t id = -1;
|
| - const char* selector = NULL;
|
| - if (f.IsNonImplicitClosureFunction()) {
|
| - id = Isolate::Current()->FindClosureIndex(f);
|
| - selector = "closures";
|
| - } else if (f.IsImplicitClosureFunction()) {
|
| - id = cls.FindImplicitClosureFunctionIndex(f);
|
| - selector = "implicit_closures";
|
| - } else if (f.IsNoSuchMethodDispatcher() || f.IsInvokeFieldDispatcher()) {
|
| - id = cls.FindInvocationDispatcherFunctionIndex(f);
|
| - selector = "dispatchers";
|
| - }
|
| - if (id != -1) {
|
| - ASSERT(selector != NULL);
|
| - jsobj.AddFixedServiceId("classes/%" Pd "/%s/%" Pd "",
|
| - cls.id(), selector, id);
|
| - return;
|
| - }
|
| - // Regular functions known to their owner use their name (percent-encoded).
|
| - String& name = String::Handle(f.name());
|
| - if (cls.LookupFunction(name) == f.raw()) {
|
| - name = String::EncodeIRI(name);
|
| - jsobj.AddFixedServiceId("classes/%" Pd "/functions/%s",
|
| - cls.id(), name.ToCString());
|
| - return;
|
| - }
|
| - // Oddball functions (not known to their owner) fall back to use the object
|
| - // id ring. Current known examples are signature functions of closures
|
| - // and stubs like 'megamorphic_miss'.
|
| - jsobj.AddServiceId(f);
|
| -}
|
| -
|
| -
|
| -void Function::PrintJSONImpl(JSONStream* stream, bool ref) const {
|
| - Class& cls = Class::Handle(Owner());
|
| - ASSERT(!cls.IsNull());
|
| - Error& err = Error::Handle();
|
| - err ^= cls.EnsureIsFinalized(Thread::Current());
|
| - ASSERT(err.IsNull());
|
| - JSONObject jsobj(stream);
|
| - AddCommonObjectProperties(&jsobj, "Function", ref);
|
| - AddFunctionServiceId(jsobj, *this, cls);
|
| - const String& user_name = String::Handle(PrettyName());
|
| - const String& vm_name = String::Handle(name());
|
| - AddNameProperties(&jsobj, user_name, vm_name);
|
| - const Function& parent = Function::Handle(parent_function());
|
| - if (!parent.IsNull()) {
|
| - jsobj.AddProperty("owner", parent);
|
| - } else if (cls.IsTopLevel()) {
|
| - const Library& library = Library::Handle(cls.library());
|
| - jsobj.AddProperty("owner", library);
|
| - } else {
|
| - jsobj.AddProperty("owner", cls);
|
| - }
|
| -
|
| - const char* kind_string = Function::KindToCString(kind());
|
| - jsobj.AddProperty("_kind", kind_string);
|
| - jsobj.AddProperty("static", is_static());
|
| - jsobj.AddProperty("const", is_const());
|
| - jsobj.AddProperty("_intrinsic", is_intrinsic());
|
| - jsobj.AddProperty("_native", is_native());
|
| - if (ref) {
|
| - return;
|
| - }
|
| - Code& code = Code::Handle(CurrentCode());
|
| - if (!code.IsNull()) {
|
| - jsobj.AddProperty("code", code);
|
| - }
|
| - Array& ics = Array::Handle(ic_data_array());
|
| - if (!ics.IsNull()) {
|
| - jsobj.AddProperty("_icDataArray", ics);
|
| - }
|
| - jsobj.AddProperty("_optimizable", is_optimizable());
|
| - jsobj.AddProperty("_inlinable", is_inlinable());
|
| - jsobj.AddProperty("_recognized", IsRecognized());
|
| - code = unoptimized_code();
|
| - if (!code.IsNull()) {
|
| - jsobj.AddProperty("_unoptimizedCode", code);
|
| - }
|
| - jsobj.AddProperty("_usageCounter", usage_counter());
|
| - jsobj.AddProperty("_optimizedCallSiteCount", optimized_call_site_count());
|
| - jsobj.AddProperty("_deoptimizations",
|
| - static_cast<intptr_t>(deoptimization_counter()));
|
| - if ((kind() == RawFunction::kImplicitGetter) ||
|
| - (kind() == RawFunction::kImplicitSetter) ||
|
| - (kind() == RawFunction::kImplicitStaticFinalGetter)) {
|
| - const Field& field = Field::Handle(LookupImplicitGetterSetterField());
|
| - if (!field.IsNull()) {
|
| - jsobj.AddProperty("_field", field);
|
| - }
|
| - }
|
| -
|
| - const Script& script = Script::Handle(this->script());
|
| - if (!script.IsNull()) {
|
| - jsobj.AddLocation(script, token_pos(), end_token_pos());
|
| - }
|
| -}
|
| -
|
| -
|
| void ClosureData::set_context_scope(const ContextScope& value) const {
|
| StorePointer(&raw_ptr()->context_scope_, value.raw());
|
| }
|
| @@ -7201,11 +6891,6 @@ const char* ClosureData::ToCString() const {
|
| }
|
|
|
|
|
| -void ClosureData::PrintJSONImpl(JSONStream* stream, bool ref) const {
|
| - Object::PrintJSONImpl(stream, ref);
|
| -}
|
| -
|
| -
|
| void RedirectionData::set_type(const Type& value) const {
|
| ASSERT(!value.IsNull());
|
| StorePointer(&raw_ptr()->type_, value.raw());
|
| @@ -7236,11 +6921,6 @@ const char* RedirectionData::ToCString() const {
|
| }
|
|
|
|
|
| -void RedirectionData::PrintJSONImpl(JSONStream* stream, bool ref) const {
|
| - Object::PrintJSONImpl(stream, ref);
|
| -}
|
| -
|
| -
|
| RawString* Field::GetterName(const String& field_name) {
|
| return String::Concat(Symbols::GetterPrefix(), field_name);
|
| }
|
| @@ -7486,64 +7166,6 @@ const char* Field::ToCString() const {
|
| }
|
|
|
|
|
| -void Field::PrintJSONImpl(JSONStream* stream, bool ref) const {
|
| - JSONObject jsobj(stream);
|
| - Class& cls = Class::Handle(owner());
|
| - String& field_name = String::Handle(name());
|
| - field_name = String::EncodeIRI(field_name);
|
| - AddCommonObjectProperties(&jsobj, "Field", ref);
|
| - jsobj.AddFixedServiceId("classes/%" Pd "/fields/%s",
|
| - cls.id(), field_name.ToCString());
|
| -
|
| - const String& user_name = String::Handle(PrettyName());
|
| - const String& vm_name = String::Handle(name());
|
| - AddNameProperties(&jsobj, user_name, vm_name);
|
| - if (cls.IsTopLevel()) {
|
| - const Library& library = Library::Handle(cls.library());
|
| - jsobj.AddProperty("owner", library);
|
| - } else {
|
| - jsobj.AddProperty("owner", cls);
|
| - }
|
| -
|
| - AbstractType& declared_type = AbstractType::Handle(type());
|
| - jsobj.AddProperty("declaredType", declared_type);
|
| - jsobj.AddProperty("static", is_static());
|
| - jsobj.AddProperty("final", is_final());
|
| - jsobj.AddProperty("const", is_const());
|
| - if (ref) {
|
| - return;
|
| - }
|
| - if (is_static()) {
|
| - const Instance& valueObj = Instance::Handle(StaticValue());
|
| - jsobj.AddProperty("staticValue", valueObj);
|
| - }
|
| -
|
| - jsobj.AddProperty("_guardNullable", is_nullable());
|
| - if (guarded_cid() == kIllegalCid) {
|
| - jsobj.AddProperty("_guardClass", "unknown");
|
| - } else if (guarded_cid() == kDynamicCid) {
|
| - jsobj.AddProperty("_guardClass", "dynamic");
|
| - } else {
|
| - ClassTable* table = Isolate::Current()->class_table();
|
| - ASSERT(table->IsValidIndex(guarded_cid()));
|
| - cls ^= table->At(guarded_cid());
|
| - jsobj.AddProperty("_guardClass", cls);
|
| - }
|
| - if (guarded_list_length() == kUnknownFixedLength) {
|
| - jsobj.AddProperty("_guardLength", "unknown");
|
| - } else if (guarded_list_length() == kNoFixedLength) {
|
| - jsobj.AddProperty("_guardLength", "variable");
|
| - } else {
|
| - jsobj.AddProperty("_guardLength", guarded_list_length());
|
| - }
|
| - const Class& origin_cls = Class::Handle(origin());
|
| - const Script& script = Script::Handle(origin_cls.script());
|
| - if (!script.IsNull()) {
|
| - jsobj.AddLocation(script, token_pos());
|
| - }
|
| -}
|
| -
|
| -
|
| // Build a closure object that gets (or sets) the contents of a static
|
| // field f and cache the closure in a newly created static field
|
| // named #f (or #f= in case of a setter).
|
| @@ -7945,11 +7567,6 @@ const char* LiteralToken::ToCString() const {
|
| }
|
|
|
|
|
| -void LiteralToken::PrintJSONImpl(JSONStream* stream, bool ref) const {
|
| - Object::PrintJSONImpl(stream, ref);
|
| -}
|
| -
|
| -
|
| RawGrowableObjectArray* TokenStream::TokenObjects() const {
|
| return raw_ptr()->token_objects_;
|
| }
|
| @@ -8440,23 +8057,6 @@ const char* TokenStream::ToCString() const {
|
| }
|
|
|
|
|
| -void TokenStream::PrintJSONImpl(JSONStream* stream, bool ref) const {
|
| - JSONObject jsobj(stream);
|
| - AddCommonObjectProperties(&jsobj, "Object", ref);
|
| - // TODO(johnmccutchan): Generate a stable id. TokenStreams hang off
|
| - // a Script object but do not have a back reference to generate a stable id.
|
| - jsobj.AddServiceId(*this);
|
| - if (ref) {
|
| - return;
|
| - }
|
| - const String& private_key = String::Handle(PrivateKey());
|
| - jsobj.AddProperty("privateKey", private_key);
|
| - // TODO(johnmccutchan): Add support for printing LiteralTokens and add
|
| - // them to members array.
|
| - JSONArray members(&jsobj, "members");
|
| -}
|
| -
|
| -
|
| TokenStream::Iterator::Iterator(const TokenStream& tokens,
|
| TokenPosition token_pos,
|
| Iterator::StreamType stream_type)
|
| @@ -9015,68 +8615,6 @@ RawLibrary* Script::FindLibrary() const {
|
| }
|
|
|
|
|
| -// See also Dart_ScriptGetTokenInfo.
|
| -void Script::PrintJSONImpl(JSONStream* stream, bool ref) const {
|
| - JSONObject jsobj(stream);
|
| - AddCommonObjectProperties(&jsobj, "Script", ref);
|
| - const String& uri = String::Handle(url());
|
| - ASSERT(!uri.IsNull());
|
| - const String& encoded_uri = String::Handle(String::EncodeIRI(uri));
|
| - ASSERT(!encoded_uri.IsNull());
|
| - const Library& lib = Library::Handle(FindLibrary());
|
| - if (kind() == RawScript::kEvaluateTag) {
|
| - jsobj.AddServiceId(*this);
|
| - } else {
|
| - ASSERT(!lib.IsNull());
|
| - jsobj.AddFixedServiceId("libraries/%" Pd "/scripts/%s",
|
| - lib.index(), encoded_uri.ToCString());
|
| - }
|
| - jsobj.AddPropertyStr("uri", uri);
|
| - jsobj.AddProperty("_kind", GetKindAsCString());
|
| - if (ref) {
|
| - return;
|
| - }
|
| - if (!lib.IsNull()) {
|
| - jsobj.AddProperty("library", lib);
|
| - }
|
| - const String& source = String::Handle(Source());
|
| - jsobj.AddProperty("lineOffset", line_offset());
|
| - jsobj.AddProperty("columnOffset", col_offset());
|
| - if (!source.IsNull()) {
|
| - jsobj.AddPropertyStr("source", source);
|
| - }
|
| -
|
| - // Print the line number table
|
| - if (!source.IsNull()) {
|
| - JSONArray tokenPosTable(&jsobj, "tokenPosTable");
|
| -
|
| - const GrowableObjectArray& lineNumberArray =
|
| - GrowableObjectArray::Handle(GenerateLineNumberArray());
|
| - Object& value = Object::Handle();
|
| - intptr_t pos = 0;
|
| -
|
| - // Skip leading null.
|
| - ASSERT(lineNumberArray.Length() > 0);
|
| - value = lineNumberArray.At(pos);
|
| - ASSERT(value.IsNull());
|
| - pos++;
|
| -
|
| - while (pos < lineNumberArray.Length()) {
|
| - JSONArray lineInfo(&tokenPosTable);
|
| - while (pos < lineNumberArray.Length()) {
|
| - value = lineNumberArray.At(pos);
|
| - pos++;
|
| - if (value.IsNull()) {
|
| - break;
|
| - }
|
| - const Smi& smi = Smi::Cast(value);
|
| - lineInfo.AddValue(smi.Value());
|
| - }
|
| - }
|
| - }
|
| -}
|
| -
|
| -
|
| DictionaryIterator::DictionaryIterator(const Library& library)
|
| : array_(Array::Handle(library.dictionary())),
|
| // Last element in array is a Smi indicating the number of entries used.
|
| @@ -10476,134 +10014,6 @@ const char* Library::ToCString() const {
|
| }
|
|
|
|
|
| -void Library::PrintJSONImpl(JSONStream* stream, bool ref) const {
|
| - intptr_t id = index();
|
| - ASSERT(id >= 0);
|
| - JSONObject jsobj(stream);
|
| - AddCommonObjectProperties(&jsobj, "Library", ref);
|
| - jsobj.AddFixedServiceId("libraries/%" Pd "", id);
|
| - const String& vm_name = String::Handle(name());
|
| - const String& user_name =
|
| - String::Handle(String::IdentifierPrettyName(vm_name));
|
| - AddNameProperties(&jsobj, user_name, vm_name);
|
| - const String& library_url = String::Handle(url());
|
| - jsobj.AddPropertyStr("uri", library_url);
|
| - if (ref) {
|
| - return;
|
| - }
|
| - jsobj.AddProperty("debuggable", IsDebuggable());
|
| - {
|
| - JSONArray jsarr(&jsobj, "classes");
|
| - ClassDictionaryIterator class_iter(*this);
|
| - Class& klass = Class::Handle();
|
| - while (class_iter.HasNext()) {
|
| - klass = class_iter.GetNextClass();
|
| - if (!klass.IsMixinApplication()) {
|
| - jsarr.AddValue(klass);
|
| - }
|
| - }
|
| - }
|
| - {
|
| - JSONArray jsarr(&jsobj, "dependencies");
|
| -
|
| - Array& ports = Array::Handle();
|
| - Namespace& ns = Namespace::Handle();
|
| - Library& target = Library::Handle();
|
| -
|
| - // Unprefixed imports.
|
| - ports = imports();
|
| - for (intptr_t i = 0; i < ports.Length(); i++) {
|
| - ns ^= ports.At(i);
|
| - if (ns.IsNull()) continue;
|
| -
|
| - JSONObject jsdep(&jsarr);
|
| - jsdep.AddProperty("isDeferred", false);
|
| - jsdep.AddProperty("isExport", false);
|
| - jsdep.AddProperty("isImport", true);
|
| - target = ns.library();
|
| - jsdep.AddProperty("target", target);
|
| - }
|
| -
|
| - // Exports.
|
| - ports = exports();
|
| - for (intptr_t i = 0; i < ports.Length(); i++) {
|
| - ns ^= ports.At(i);
|
| - if (ns.IsNull()) continue;
|
| -
|
| - JSONObject jsdep(&jsarr);
|
| - jsdep.AddProperty("isDeferred", false);
|
| - jsdep.AddProperty("isExport", true);
|
| - jsdep.AddProperty("isImport", false);
|
| - target = ns.library();
|
| - jsdep.AddProperty("target", target);
|
| - }
|
| -
|
| - // Prefixed imports.
|
| - DictionaryIterator entries(*this);
|
| - Object& entry = Object::Handle();
|
| - LibraryPrefix& prefix = LibraryPrefix::Handle();
|
| - String& prefixName = String::Handle();
|
| - while (entries.HasNext()) {
|
| - entry = entries.GetNext();
|
| - if (entry.IsLibraryPrefix()) {
|
| - prefix ^= entry.raw();
|
| - ports = prefix.imports();
|
| - for (intptr_t i = 0; i < ports.Length(); i++) {
|
| - ns ^= ports.At(i);
|
| - if (ns.IsNull()) continue;
|
| -
|
| - JSONObject jsdep(&jsarr);
|
| - jsdep.AddProperty("isDeferred", prefix.is_deferred_load());
|
| - jsdep.AddProperty("isExport", false);
|
| - jsdep.AddProperty("isImport", true);
|
| - prefixName = prefix.name();
|
| - ASSERT(!prefixName.IsNull());
|
| - jsdep.AddProperty("prefix", prefixName.ToCString());
|
| - target = ns.library();
|
| - jsdep.AddProperty("target", target);
|
| - }
|
| - }
|
| - }
|
| - }
|
| - {
|
| - JSONArray jsarr(&jsobj, "variables");
|
| - DictionaryIterator entries(*this);
|
| - Object& entry = Object::Handle();
|
| - while (entries.HasNext()) {
|
| - entry = entries.GetNext();
|
| - if (entry.IsField()) {
|
| - jsarr.AddValue(entry);
|
| - }
|
| - }
|
| - }
|
| - {
|
| - JSONArray jsarr(&jsobj, "functions");
|
| - DictionaryIterator entries(*this);
|
| - Object& entry = Object::Handle();
|
| - while (entries.HasNext()) {
|
| - entry = entries.GetNext();
|
| - if (entry.IsFunction()) {
|
| - const Function& func = Function::Cast(entry);
|
| - if (func.kind() == RawFunction::kRegularFunction ||
|
| - func.kind() == RawFunction::kGetterFunction ||
|
| - func.kind() == RawFunction::kSetterFunction) {
|
| - jsarr.AddValue(func);
|
| - }
|
| - }
|
| - }
|
| - }
|
| - {
|
| - JSONArray jsarr(&jsobj, "scripts");
|
| - Array& scripts = Array::Handle(LoadedScripts());
|
| - Script& script = Script::Handle();
|
| - for (intptr_t i = 0; i < scripts.Length(); i++) {
|
| - script ^= scripts.At(i);
|
| - jsarr.AddValue(script);
|
| - }
|
| - }
|
| -}
|
| -
|
| -
|
| RawLibrary* LibraryPrefix::GetLibrary(int index) const {
|
| if ((index >= 0) || (index < num_imports())) {
|
| const Array& imports = Array::Handle(this->imports());
|
| @@ -10898,11 +10308,6 @@ const char* LibraryPrefix::ToCString() const {
|
| }
|
|
|
|
|
| -void LibraryPrefix::PrintJSONImpl(JSONStream* stream, bool ref) const {
|
| - Object::PrintJSONImpl(stream, ref);
|
| -}
|
| -
|
| -
|
| void Namespace::set_metadata_field(const Field& value) const {
|
| StorePointer(&raw_ptr()->metadata_field_, value.raw());
|
| }
|
| @@ -10948,11 +10353,6 @@ const char* Namespace::ToCString() const {
|
| }
|
|
|
|
|
| -void Namespace::PrintJSONImpl(JSONStream* stream, bool ref) const {
|
| - Object::PrintJSONImpl(stream, ref);
|
| -}
|
| -
|
| -
|
| bool Namespace::HidesName(const String& name) const {
|
| // Quick check for common case with no combinators.
|
| if (hide_names() == show_names()) {
|
| @@ -11224,16 +10624,6 @@ const char* Instructions::ToCString() const {
|
| }
|
|
|
|
|
| -void Instructions::PrintJSONImpl(JSONStream* stream, bool ref) const {
|
| - JSONObject jsobj(stream);
|
| - AddCommonObjectProperties(&jsobj, "Object", ref);
|
| - jsobj.AddServiceId(*this);
|
| - if (ref) {
|
| - return;
|
| - }
|
| -}
|
| -
|
| -
|
| // Encode integer |value| in SLEB128 format and store into |data|.
|
| static void EncodeSLEB128(GrowableArray<uint8_t>* data,
|
| intptr_t value) {
|
| @@ -11331,46 +10721,6 @@ const char* ObjectPool::ToCString() const {
|
| }
|
|
|
|
|
| -void ObjectPool::PrintJSONImpl(JSONStream* stream, bool ref) const {
|
| - JSONObject jsobj(stream);
|
| - AddCommonObjectProperties(&jsobj, "Object", ref);
|
| - jsobj.AddServiceId(*this);
|
| - jsobj.AddProperty("length", Length());
|
| - if (ref) {
|
| - return;
|
| - }
|
| -
|
| - {
|
| - JSONArray jsarr(&jsobj, "_entries");
|
| - uword imm;
|
| - Object& obj = Object::Handle();
|
| - for (intptr_t i = 0; i < Length(); i++) {
|
| - JSONObject jsentry(stream);
|
| - jsentry.AddProperty("offset", OffsetFromIndex(i));
|
| - switch (InfoAt(i)) {
|
| - case ObjectPool::kTaggedObject:
|
| - obj = ObjectAt(i);
|
| - jsentry.AddProperty("kind", "Object");
|
| - jsentry.AddProperty("value", obj);
|
| - break;
|
| - case ObjectPool::kImmediate:
|
| - imm = RawValueAt(i);
|
| - jsentry.AddProperty("kind", "Immediate");
|
| - jsentry.AddProperty64("value", imm);
|
| - break;
|
| - case ObjectPool::kNativeEntry:
|
| - imm = RawValueAt(i);
|
| - jsentry.AddProperty("kind", "NativeEntry");
|
| - jsentry.AddProperty64("value", imm);
|
| - break;
|
| - default:
|
| - UNREACHABLE();
|
| - }
|
| - }
|
| - }
|
| -}
|
| -
|
| -
|
| void ObjectPool::DebugPrint() const {
|
| THR_Print("Object Pool: {\n");
|
| for (intptr_t i = 0; i < Length(); i++) {
|
| @@ -11514,34 +10864,6 @@ const char* PcDescriptors::ToCString() const {
|
| }
|
|
|
|
|
| -void PcDescriptors::PrintToJSONObject(JSONObject* jsobj, bool ref) const {
|
| - AddCommonObjectProperties(jsobj, "Object", ref);
|
| - // TODO(johnmccutchan): Generate a stable id. PcDescriptors hang off a Code
|
| - // object but do not have a back reference to generate an ID.
|
| - jsobj->AddServiceId(*this);
|
| - if (ref) {
|
| - return;
|
| - }
|
| - JSONArray members(jsobj, "members");
|
| - Iterator iter(*this, RawPcDescriptors::kAnyKind);
|
| - while (iter.MoveNext()) {
|
| - JSONObject descriptor(&members);
|
| - descriptor.AddPropertyF("pcOffset", "%" Px "", iter.PcOffset());
|
| - descriptor.AddProperty("kind", KindAsStr(iter.Kind()));
|
| - descriptor.AddProperty("deoptId", iter.DeoptId());
|
| - // TODO(turnidge): Use AddLocation instead.
|
| - descriptor.AddProperty("tokenPos", iter.TokenPos());
|
| - descriptor.AddProperty("tryIndex", iter.TryIndex());
|
| - }
|
| -}
|
| -
|
| -
|
| -void PcDescriptors::PrintJSONImpl(JSONStream* stream, bool ref) const {
|
| - JSONObject jsobj(stream);
|
| - PrintToJSONObject(&jsobj, ref);
|
| -}
|
| -
|
| -
|
| // Verify assumptions (in debug mode only).
|
| // - No two deopt descriptors have the same deoptimization id.
|
| // - No two ic-call descriptors have the same deoptimization id (type feedback).
|
| @@ -11640,11 +10962,6 @@ RawCodeSourceMap* CodeSourceMap::New(intptr_t length) {
|
| }
|
|
|
|
|
| -void CodeSourceMap::PrintJSONImpl(JSONStream* stream, bool ref) const {
|
| - Object::PrintJSONImpl(stream, ref);
|
| -}
|
| -
|
| -
|
| const char* CodeSourceMap::ToCString() const {
|
| // "*" in a printf format specifier tells it to read the field width from
|
| // the printf argument list.
|
| @@ -11819,11 +11136,6 @@ const char* Stackmap::ToCString() const {
|
| }
|
|
|
|
|
| -void Stackmap::PrintJSONImpl(JSONStream* stream, bool ref) const {
|
| - Object::PrintJSONImpl(stream, ref);
|
| -}
|
| -
|
| -
|
| RawString* LocalVarDescriptors::GetName(intptr_t var_index) const {
|
| ASSERT(var_index < Length());
|
| ASSERT(Object::Handle(*raw()->nameAddrAt(var_index)).IsString());
|
| @@ -11920,33 +11232,6 @@ const char* LocalVarDescriptors::ToCString() const {
|
| }
|
|
|
|
|
| -void LocalVarDescriptors::PrintJSONImpl(JSONStream* stream,
|
| - bool ref) const {
|
| - JSONObject jsobj(stream);
|
| - AddCommonObjectProperties(&jsobj, "Object", ref);
|
| - // TODO(johnmccutchan): Generate a stable id. LocalVarDescriptors hang off
|
| - // a Code object but do not have a back reference to generate an ID.
|
| - jsobj.AddServiceId(*this);
|
| - if (ref) {
|
| - return;
|
| - }
|
| - JSONArray members(&jsobj, "members");
|
| - String& var_name = String::Handle();
|
| - for (intptr_t i = 0; i < Length(); i++) {
|
| - RawLocalVarDescriptors::VarInfo info;
|
| - var_name = GetName(i);
|
| - GetInfo(i, &info);
|
| - JSONObject var(&members);
|
| - var.AddProperty("name", var_name.ToCString());
|
| - var.AddProperty("index", static_cast<intptr_t>(info.index()));
|
| - var.AddProperty("beginPos", info.begin_pos);
|
| - var.AddProperty("endPos", info.end_pos);
|
| - var.AddProperty("scopeId", static_cast<intptr_t>(info.scope_id));
|
| - var.AddProperty("kind", KindToCString(info.kind()));
|
| - }
|
| -}
|
| -
|
| -
|
| const char* LocalVarDescriptors::KindToCString(
|
| RawLocalVarDescriptors::VarInfoKind kind) {
|
| switch (kind) {
|
| @@ -12176,12 +11461,6 @@ const char* ExceptionHandlers::ToCString() const {
|
| }
|
|
|
|
|
| -void ExceptionHandlers::PrintJSONImpl(JSONStream* stream,
|
| - bool ref) const {
|
| - Object::PrintJSONImpl(stream, ref);
|
| -}
|
| -
|
| -
|
| intptr_t DeoptInfo::FrameSize(const TypedData& packed) {
|
| NoSafepointScope no_safepoint;
|
| typedef ReadStream::Raw<sizeof(intptr_t), intptr_t> Reader;
|
| @@ -13001,86 +12280,6 @@ RawICData* ICData::CloneDescriptor(const ICData& from) {
|
| }
|
|
|
|
|
| -void ICData::PrintJSONImpl(JSONStream* stream, bool ref) const {
|
| - JSONObject jsobj(stream);
|
| - AddCommonObjectProperties(&jsobj, "Object", ref);
|
| - jsobj.AddServiceId(*this);
|
| - jsobj.AddProperty("_owner", Object::Handle(Owner()));
|
| - jsobj.AddProperty("_selector", String::Handle(target_name()).ToCString());
|
| - if (ref) {
|
| - return;
|
| - }
|
| - jsobj.AddProperty("_argumentsDescriptor",
|
| - Object::Handle(arguments_descriptor()));
|
| - jsobj.AddProperty("_entries", Object::Handle(ic_data()));
|
| -}
|
| -
|
| -
|
| -void ICData::PrintToJSONArray(const JSONArray& jsarray,
|
| - TokenPosition token_pos,
|
| - bool is_static_call) const {
|
| - Isolate* isolate = Isolate::Current();
|
| - Class& cls = Class::Handle();
|
| - Function& func = Function::Handle();
|
| -
|
| - JSONObject jsobj(&jsarray);
|
| - jsobj.AddProperty("name", String::Handle(target_name()).ToCString());
|
| - jsobj.AddProperty("tokenPos", token_pos);
|
| - // TODO(rmacnak): Figure out how to stringify DeoptReasons().
|
| - // jsobj.AddProperty("deoptReasons", ...);
|
| -
|
| - JSONArray cache_entries(&jsobj, "cacheEntries");
|
| - for (intptr_t i = 0; i < NumberOfChecks(); i++) {
|
| - func = GetTargetAt(i);
|
| - if (is_static_call) {
|
| - cls ^= func.Owner();
|
| - } else {
|
| - intptr_t cid = GetReceiverClassIdAt(i);
|
| - cls ^= isolate->class_table()->At(cid);
|
| - }
|
| - intptr_t count = GetCountAt(i);
|
| - JSONObject cache_entry(&cache_entries);
|
| - if (cls.IsTopLevel()) {
|
| - cache_entry.AddProperty("receiverContainer",
|
| - Library::Handle(cls.library()));
|
| - } else {
|
| - cache_entry.AddProperty("receiverContainer", cls);
|
| - }
|
| - cache_entry.AddProperty("count", count);
|
| - cache_entry.AddProperty("target", func);
|
| - }
|
| -}
|
| -
|
| -
|
| -void ICData::PrintToJSONArrayNew(const JSONArray& jsarray,
|
| - TokenPosition token_pos,
|
| - bool is_static_call) const {
|
| - Isolate* isolate = Isolate::Current();
|
| - Class& cls = Class::Handle();
|
| - Function& func = Function::Handle();
|
| -
|
| - JSONObject jsobj(&jsarray);
|
| - jsobj.AddProperty("name", String::Handle(target_name()).ToCString());
|
| - jsobj.AddProperty("tokenPos", token_pos.value());
|
| - // TODO(rmacnak): Figure out how to stringify DeoptReasons().
|
| - // jsobj.AddProperty("deoptReasons", ...);
|
| -
|
| - JSONArray cache_entries(&jsobj, "cacheEntries");
|
| - for (intptr_t i = 0; i < NumberOfChecks(); i++) {
|
| - JSONObject cache_entry(&cache_entries);
|
| - func = GetTargetAt(i);
|
| - intptr_t count = GetCountAt(i);
|
| - if (!is_static_call) {
|
| - intptr_t cid = GetReceiverClassIdAt(i);
|
| - cls ^= isolate->class_table()->At(cid);
|
| - cache_entry.AddProperty("receiver", cls);
|
| - }
|
| - cache_entry.AddProperty("target", func);
|
| - cache_entry.AddProperty("count", count);
|
| - }
|
| -}
|
| -
|
| -
|
| static Token::Kind RecognizeArithmeticOp(const String& name) {
|
| ASSERT(name.IsSymbol());
|
| if (name.raw() == Symbols::Plus().raw()) {
|
| @@ -13282,6 +12481,9 @@ void Code::set_static_calls_target_table(const Array& value) const {
|
|
|
|
|
| bool Code::HasBreakpoint() const {
|
| + if (!FLAG_support_debugger) {
|
| + return false;
|
| + }
|
| return Isolate::Current()->debugger()->HasBreakpoint(*this);
|
| }
|
|
|
| @@ -13828,106 +13030,6 @@ void Code::SetActiveInstructions(RawInstructions* instructions) const {
|
| }
|
|
|
|
|
| -void Code::PrintJSONImpl(JSONStream* stream, bool ref) const {
|
| - JSONObject jsobj(stream);
|
| - AddCommonObjectProperties(&jsobj, "Code", ref);
|
| - jsobj.AddFixedServiceId("code/%" Px64"-%" Px "",
|
| - compile_timestamp(),
|
| - EntryPoint());
|
| - const String& user_name = String::Handle(PrettyName());
|
| - const String& vm_name = String::Handle(Name());
|
| - AddNameProperties(&jsobj, user_name, vm_name);
|
| - const bool is_stub = IsStubCode() || IsAllocationStubCode();
|
| - if (is_stub) {
|
| - jsobj.AddProperty("kind", "Stub");
|
| - } else {
|
| - jsobj.AddProperty("kind", "Dart");
|
| - }
|
| - jsobj.AddProperty("_optimized", is_optimized());
|
| - const Object& obj = Object::Handle(owner());
|
| - if (obj.IsFunction()) {
|
| - const Function& func = Function::Cast(obj);
|
| - jsobj.AddProperty("_intrinsic", func.is_intrinsic());
|
| - jsobj.AddProperty("_native", func.is_native());
|
| - } else {
|
| - jsobj.AddProperty("_intrinsic", false);
|
| - jsobj.AddProperty("_native", false);
|
| - }
|
| - if (ref) {
|
| - return;
|
| - }
|
| - if (obj.IsFunction()) {
|
| - jsobj.AddProperty("function", obj);
|
| - } else {
|
| - // Generate a fake function reference.
|
| - JSONObject func(&jsobj, "function");
|
| - func.AddProperty("type", "@Function");
|
| - func.AddProperty("_kind", "Stub");
|
| - func.AddProperty("name", user_name.ToCString());
|
| - AddNameProperties(&func, user_name, vm_name);
|
| - }
|
| - jsobj.AddPropertyF("_startAddress", "%" Px "", EntryPoint());
|
| - jsobj.AddPropertyF("_endAddress", "%" Px "", EntryPoint() + Size());
|
| - jsobj.AddProperty("_alive", is_alive());
|
| - const ObjectPool& object_pool = ObjectPool::Handle(GetObjectPool());
|
| - jsobj.AddProperty("_objectPool", object_pool);
|
| - {
|
| - JSONArray jsarr(&jsobj, "_disassembly");
|
| - if (is_alive()) {
|
| - // Only disassemble alive code objects.
|
| - DisassembleToJSONStream formatter(jsarr);
|
| - Disassemble(&formatter);
|
| - }
|
| - }
|
| - const PcDescriptors& descriptors = PcDescriptors::Handle(pc_descriptors());
|
| - if (!descriptors.IsNull()) {
|
| - JSONObject desc(&jsobj, "_descriptors");
|
| - descriptors.PrintToJSONObject(&desc, false);
|
| - }
|
| - const Array& inlined_function_table = Array::Handle(GetInlinedIdToFunction());
|
| - if (!inlined_function_table.IsNull() &&
|
| - (inlined_function_table.Length() > 0)) {
|
| - JSONArray inlined_functions(&jsobj, "_inlinedFunctions");
|
| - Function& function = Function::Handle();
|
| - for (intptr_t i = 0; i < inlined_function_table.Length(); i++) {
|
| - function ^= inlined_function_table.At(i);
|
| - ASSERT(!function.IsNull());
|
| - inlined_functions.AddValue(function);
|
| - }
|
| - }
|
| - const Array& intervals = Array::Handle(GetInlinedIntervals());
|
| - if (!intervals.IsNull() && (intervals.Length() > 0)) {
|
| - Smi& start = Smi::Handle();
|
| - Smi& end = Smi::Handle();
|
| - Smi& temp_smi = Smi::Handle();
|
| - JSONArray inline_intervals(&jsobj, "_inlinedIntervals");
|
| - for (intptr_t i = 0; i < intervals.Length() - Code::kInlIntNumEntries;
|
| - i += Code::kInlIntNumEntries) {
|
| - start ^= intervals.At(i + Code::kInlIntStart);
|
| - if (start.IsNull()) {
|
| - continue;
|
| - }
|
| - end ^= intervals.At(i + Code::kInlIntNumEntries + Code::kInlIntStart);
|
| -
|
| - // Format: [start, end, inline functions...]
|
| - JSONArray inline_interval(&inline_intervals);
|
| - inline_interval.AddValue(start.Value());
|
| - inline_interval.AddValue(end.Value());
|
| -
|
| - temp_smi ^= intervals.At(i + Code::kInlIntInliningId);
|
| - intptr_t inlining_id = temp_smi.Value();
|
| - ASSERT(inlining_id >= 0);
|
| - intptr_t caller_id = GetCallerId(inlining_id);
|
| - while (inlining_id >= 0) {
|
| - inline_interval.AddValue(inlining_id);
|
| - inlining_id = caller_id;
|
| - caller_id = GetCallerId(inlining_id);
|
| - }
|
| - }
|
| - }
|
| -}
|
| -
|
| -
|
| uword Code::GetLazyDeoptPc() const {
|
| return (lazy_deopt_pc_offset() != kInvalidPc)
|
| ? EntryPoint() + lazy_deopt_pc_offset() : 0;
|
| @@ -14138,34 +13240,6 @@ void Context::Dump(int indent) const {
|
| }
|
|
|
|
|
| -void Context::PrintJSONImpl(JSONStream* stream, bool ref) const {
|
| - JSONObject jsobj(stream);
|
| - // TODO(turnidge): Should the user level type for Context be Context
|
| - // or Object?
|
| - AddCommonObjectProperties(&jsobj, "Context", ref);
|
| - jsobj.AddServiceId(*this);
|
| -
|
| - jsobj.AddProperty("length", num_variables());
|
| -
|
| - if (ref) {
|
| - return;
|
| - }
|
| -
|
| - const Context& parent_context = Context::Handle(parent());
|
| - if (!parent_context.IsNull()) {
|
| - jsobj.AddProperty("parent", parent_context);
|
| - }
|
| -
|
| - JSONArray jsarr(&jsobj, "variables");
|
| - Object& var = Object::Handle();
|
| - for (intptr_t index = 0; index < num_variables(); index++) {
|
| - var = At(index);
|
| - JSONObject jselement(&jsarr);
|
| - jselement.AddProperty("value", var);
|
| - }
|
| -}
|
| -
|
| -
|
| RawContextScope* ContextScope::New(intptr_t num_variables, bool is_implicit) {
|
| ASSERT(Object::context_scope_class() != Class::null());
|
| if (num_variables < 0 || num_variables > kMaxElements) {
|
| @@ -14299,11 +13373,6 @@ const char* ContextScope::ToCString() const {
|
| }
|
|
|
|
|
| -void ContextScope::PrintJSONImpl(JSONStream* stream, bool ref) const {
|
| - Object::PrintJSONImpl(stream, ref);
|
| -}
|
| -
|
| -
|
| RawArray* MegamorphicCache::buckets() const {
|
| return raw_ptr()->buckets_;
|
| }
|
| @@ -14444,21 +13513,6 @@ const char* MegamorphicCache::ToCString() const {
|
| }
|
|
|
|
|
| -void MegamorphicCache::PrintJSONImpl(JSONStream* stream, bool ref) const {
|
| - JSONObject jsobj(stream);
|
| - AddCommonObjectProperties(&jsobj, "Object", ref);
|
| - jsobj.AddServiceId(*this);
|
| - jsobj.AddProperty("_selector", String::Handle(target_name()).ToCString());
|
| - if (ref) {
|
| - return;
|
| - }
|
| - jsobj.AddProperty("_buckets", Object::Handle(buckets()));
|
| - jsobj.AddProperty("_mask", mask());
|
| - jsobj.AddProperty("_argumentsDescriptor",
|
| - Object::Handle(arguments_descriptor()));
|
| -}
|
| -
|
| -
|
| RawSubtypeTestCache* SubtypeTestCache::New() {
|
| ASSERT(Object::subtypetestcache_class() != Class::null());
|
| SubtypeTestCache& result = SubtypeTestCache::Handle();
|
| @@ -14530,11 +13584,6 @@ const char* SubtypeTestCache::ToCString() const {
|
| }
|
|
|
|
|
| -void SubtypeTestCache::PrintJSONImpl(JSONStream* stream, bool ref) const {
|
| - Object::PrintJSONImpl(stream, ref);
|
| -}
|
| -
|
| -
|
| const char* Error::ToErrorCString() const {
|
| UNREACHABLE();
|
| return "Internal Error";
|
| @@ -14548,11 +13597,6 @@ const char* Error::ToCString() const {
|
| }
|
|
|
|
|
| -void Error::PrintJSONImpl(JSONStream* stream, bool ref) const {
|
| - UNREACHABLE();
|
| -}
|
| -
|
| -
|
| RawApiError* ApiError::New() {
|
| ASSERT(Object::api_error_class() != Class::null());
|
| RawObject* raw = Object::Allocate(ApiError::kClassId,
|
| @@ -14593,15 +13637,6 @@ const char* ApiError::ToCString() const {
|
| }
|
|
|
|
|
| -void ApiError::PrintJSONImpl(JSONStream* stream, bool ref) const {
|
| - JSONObject jsobj(stream);
|
| - AddCommonObjectProperties(&jsobj, "Error", ref);
|
| - jsobj.AddProperty("kind", "InternalError");
|
| - jsobj.AddServiceId(*this);
|
| - jsobj.AddProperty("message", ToErrorCString());
|
| -}
|
| -
|
| -
|
| RawLanguageError* LanguageError::New() {
|
| ASSERT(Object::language_error_class() != Class::null());
|
| RawObject* raw = Object::Allocate(LanguageError::kClassId,
|
| @@ -14743,15 +13778,6 @@ const char* LanguageError::ToCString() const {
|
| }
|
|
|
|
|
| -void LanguageError::PrintJSONImpl(JSONStream* stream, bool ref) const {
|
| - JSONObject jsobj(stream);
|
| - AddCommonObjectProperties(&jsobj, "Error", ref);
|
| - jsobj.AddProperty("kind", "LanguageError");
|
| - jsobj.AddServiceId(*this);
|
| - jsobj.AddProperty("message", ToErrorCString());
|
| -}
|
| -
|
| -
|
| RawUnhandledException* UnhandledException::New(const Instance& exception,
|
| const Instance& stacktrace,
|
| Heap::Space space) {
|
| @@ -14832,25 +13858,6 @@ const char* UnhandledException::ToCString() const {
|
| }
|
|
|
|
|
| -
|
| -void UnhandledException::PrintJSONImpl(JSONStream* stream,
|
| - bool ref) const {
|
| - JSONObject jsobj(stream);
|
| - AddCommonObjectProperties(&jsobj, "Error", ref);
|
| - jsobj.AddProperty("kind", "UnhandledException");
|
| - jsobj.AddServiceId(*this);
|
| - jsobj.AddProperty("message", ToErrorCString());
|
| - if (ref) {
|
| - return;
|
| - }
|
| - Instance& instance = Instance::Handle();
|
| - instance = exception();
|
| - jsobj.AddProperty("exception", instance);
|
| - instance = stacktrace();
|
| - jsobj.AddProperty("stacktrace", instance);
|
| -}
|
| -
|
| -
|
| RawUnwindError* UnwindError::New(const String& message, Heap::Space space) {
|
| ASSERT(Object::unwind_error_class() != Class::null());
|
| UnwindError& result = UnwindError::Handle();
|
| @@ -14894,17 +13901,6 @@ const char* UnwindError::ToCString() const {
|
| }
|
|
|
|
|
| -void UnwindError::PrintJSONImpl(JSONStream* stream, bool ref) const {
|
| - JSONObject jsobj(stream);
|
| - AddCommonObjectProperties(&jsobj, "Error", ref);
|
| - jsobj.AddProperty("kind", "TerminationError");
|
| - jsobj.AddServiceId(*this);
|
| - jsobj.AddProperty("message", ToErrorCString());
|
| - jsobj.AddProperty("_is_user_initiated", is_user_initiated());
|
| - jsobj.AddProperty("_is_vm_restart", is_vm_restart());
|
| -}
|
| -
|
| -
|
| RawObject* Instance::Evaluate(const String& expr,
|
| const Array& param_names,
|
| const Array& param_values) const {
|
| @@ -15447,91 +14443,6 @@ const char* Instance::ToCString() const {
|
| }
|
|
|
|
|
| -void Instance::PrintSharedInstanceJSON(JSONObject* jsobj,
|
| - bool ref) const {
|
| - AddCommonObjectProperties(jsobj, "Instance", ref);
|
| - if (ref) {
|
| - return;
|
| - }
|
| -
|
| - // Walk the superclass chain, adding all instance fields.
|
| - Class& cls = Class::Handle(this->clazz());
|
| - {
|
| - Instance& fieldValue = Instance::Handle();
|
| - JSONArray jsarr(jsobj, "fields");
|
| - while (!cls.IsNull()) {
|
| - const Array& field_array = Array::Handle(cls.fields());
|
| - Field& field = Field::Handle();
|
| - if (!field_array.IsNull()) {
|
| - for (intptr_t i = 0; i < field_array.Length(); i++) {
|
| - field ^= field_array.At(i);
|
| - if (!field.is_static()) {
|
| - fieldValue ^= GetField(field);
|
| - JSONObject jsfield(&jsarr);
|
| - jsfield.AddProperty("type", "BoundField");
|
| - jsfield.AddProperty("decl", field);
|
| - jsfield.AddProperty("value", fieldValue);
|
| - }
|
| - }
|
| - }
|
| - cls = cls.SuperClass();
|
| - }
|
| - }
|
| -
|
| - if (NumNativeFields() > 0) {
|
| - JSONArray jsarr(jsobj, "_nativeFields");
|
| - for (intptr_t i = 0; i < NumNativeFields(); i++) {
|
| - intptr_t value = GetNativeField(i);
|
| - JSONObject jsfield(&jsarr);
|
| - jsfield.AddProperty("index", i);
|
| - jsfield.AddProperty("value", value);
|
| - }
|
| - }
|
| -}
|
| -
|
| -
|
| -void Instance::PrintJSONImpl(JSONStream* stream, bool ref) const {
|
| - JSONObject jsobj(stream);
|
| -
|
| - // Handle certain special instance values.
|
| - if (raw() == Object::sentinel().raw()) {
|
| - jsobj.AddProperty("type", "Sentinel");
|
| - jsobj.AddProperty("kind", "NotInitialized");
|
| - jsobj.AddProperty("valueAsString", "<not initialized>");
|
| - return;
|
| - } else if (raw() == Object::transition_sentinel().raw()) {
|
| - jsobj.AddProperty("type", "Sentinel");
|
| - jsobj.AddProperty("kind", "BeingInitialized");
|
| - jsobj.AddProperty("valueAsString", "<being initialized>");
|
| - return;
|
| - }
|
| -
|
| - PrintSharedInstanceJSON(&jsobj, ref);
|
| - if (IsClosure()) {
|
| - jsobj.AddProperty("kind", "Closure");
|
| - } else {
|
| - jsobj.AddProperty("kind", "PlainInstance");
|
| - }
|
| - jsobj.AddServiceId(*this);
|
| - if (IsClosure()) {
|
| - jsobj.AddProperty("closureFunction",
|
| - Function::Handle(Closure::Cast(*this).function()));
|
| - jsobj.AddProperty("closureContext",
|
| - Context::Handle(Closure::Cast(*this).context()));
|
| - }
|
| - if (ref) {
|
| - return;
|
| - }
|
| - if (IsClosure()) {
|
| - Debugger* debugger = Isolate::Current()->debugger();
|
| - Breakpoint* bpt = debugger->BreakpointAtActivation(*this);
|
| - if (bpt != NULL) {
|
| - jsobj.AddProperty("_activationBreakpoint", bpt);
|
| - }
|
| - }
|
| -}
|
| -
|
| -
|
| bool AbstractType::IsResolved() const {
|
| // AbstractType is an abstract class.
|
| UNREACHABLE();
|
| @@ -16083,11 +14994,6 @@ const char* AbstractType::ToCString() const {
|
| }
|
|
|
|
|
| -void AbstractType::PrintJSONImpl(JSONStream* stream, bool ref) const {
|
| - UNREACHABLE();
|
| -}
|
| -
|
| -
|
| RawType* Type::NullType() {
|
| return Isolate::Current()->object_store()->null_type();
|
| }
|
| @@ -16684,33 +15590,6 @@ const char* Type::ToCString() const {
|
| }
|
|
|
|
|
| -void Type::PrintJSONImpl(JSONStream* stream, bool ref) const {
|
| - JSONObject jsobj(stream);
|
| - PrintSharedInstanceJSON(&jsobj, ref);
|
| - jsobj.AddProperty("kind", "Type");
|
| - if (IsCanonical()) {
|
| - const Class& type_cls = Class::Handle(type_class());
|
| - intptr_t id = type_cls.FindCanonicalTypeIndex(*this);
|
| - ASSERT(id >= 0);
|
| - intptr_t cid = type_cls.id();
|
| - jsobj.AddFixedServiceId("classes/%" Pd "/types/%" Pd "", cid, id);
|
| - jsobj.AddProperty("typeClass", type_cls);
|
| - } else {
|
| - jsobj.AddServiceId(*this);
|
| - }
|
| - const String& user_name = String::Handle(PrettyName());
|
| - const String& vm_name = String::Handle(Name());
|
| - AddNameProperties(&jsobj, user_name, vm_name);
|
| - if (ref) {
|
| - return;
|
| - }
|
| - const TypeArguments& typeArgs = TypeArguments::Handle(arguments());
|
| - if (!typeArgs.IsNull()) {
|
| - jsobj.AddProperty("typeArguments", typeArgs);
|
| - }
|
| -}
|
| -
|
| -
|
| void FunctionType::SetIsFinalized() const {
|
| ASSERT(!IsFinalized());
|
| if (IsInstantiated()) {
|
| @@ -17230,33 +16109,6 @@ const char* FunctionType::ToCString() const {
|
| }
|
|
|
|
|
| -void FunctionType::PrintJSONImpl(JSONStream* stream, bool ref) const {
|
| - JSONObject jsobj(stream);
|
| - PrintSharedInstanceJSON(&jsobj, ref);
|
| - jsobj.AddProperty("kind", "FunctionType");
|
| - if (IsCanonical()) {
|
| - const Class& scope_cls = Class::Handle(scope_class());
|
| - intptr_t id = scope_cls.FindCanonicalTypeIndex(*this);
|
| - ASSERT(id >= 0);
|
| - intptr_t cid = scope_cls.id();
|
| - jsobj.AddFixedServiceId("classes/%" Pd "/types/%" Pd "", cid, id);
|
| - jsobj.AddProperty("scopeClass", scope_cls);
|
| - } else {
|
| - jsobj.AddServiceId(*this);
|
| - }
|
| - const String& user_name = String::Handle(PrettyName());
|
| - const String& vm_name = String::Handle(Name());
|
| - AddNameProperties(&jsobj, user_name, vm_name);
|
| - if (ref) {
|
| - return;
|
| - }
|
| - const TypeArguments& typeArgs = TypeArguments::Handle(arguments());
|
| - if (!typeArgs.IsNull()) {
|
| - jsobj.AddProperty("typeArguments", typeArgs);
|
| - }
|
| -}
|
| -
|
| -
|
| bool TypeRef::IsInstantiated(TrailPtr trail) const {
|
| if (TestAndAddToTrail(&trail)) {
|
| return true;
|
| @@ -17417,21 +16269,6 @@ const char* TypeRef::ToCString() const {
|
| }
|
|
|
|
|
| -void TypeRef::PrintJSONImpl(JSONStream* stream, bool ref) const {
|
| - JSONObject jsobj(stream);
|
| - PrintSharedInstanceJSON(&jsobj, ref);
|
| - jsobj.AddProperty("kind", "TypeRef");
|
| - jsobj.AddServiceId(*this);
|
| - const String& user_name = String::Handle(PrettyName());
|
| - const String& vm_name = String::Handle(Name());
|
| - AddNameProperties(&jsobj, user_name, vm_name);
|
| - if (ref) {
|
| - return;
|
| - }
|
| - jsobj.AddProperty("targetType", AbstractType::Handle(type()));
|
| -}
|
| -
|
| -
|
| void TypeParameter::SetIsFinalized() const {
|
| ASSERT(!IsFinalized());
|
| set_type_state(RawTypeParameter::kFinalizedUninstantiated);
|
| @@ -17653,25 +16490,6 @@ const char* TypeParameter::ToCString() const {
|
| }
|
|
|
|
|
| -void TypeParameter::PrintJSONImpl(JSONStream* stream, bool ref) const {
|
| - JSONObject jsobj(stream);
|
| - PrintSharedInstanceJSON(&jsobj, ref);
|
| - jsobj.AddProperty("kind", "TypeParameter");
|
| - jsobj.AddServiceId(*this);
|
| - const String& user_name = String::Handle(PrettyName());
|
| - const String& vm_name = String::Handle(Name());
|
| - AddNameProperties(&jsobj, user_name, vm_name);
|
| - const Class& param_cls = Class::Handle(parameterized_class());
|
| - jsobj.AddProperty("parameterizedClass", param_cls);
|
| - if (ref) {
|
| - return;
|
| - }
|
| - jsobj.AddProperty("parameterIndex", index());
|
| - const AbstractType& upper_bound = AbstractType::Handle(bound());
|
| - jsobj.AddProperty("bound", upper_bound);
|
| -}
|
| -
|
| -
|
| bool BoundedType::IsMalformed() const {
|
| return AbstractType::Handle(type()).IsMalformed();
|
| }
|
| @@ -17884,22 +16702,6 @@ const char* BoundedType::ToCString() const {
|
| }
|
|
|
|
|
| -void BoundedType::PrintJSONImpl(JSONStream* stream, bool ref) const {
|
| - JSONObject jsobj(stream);
|
| - PrintSharedInstanceJSON(&jsobj, ref);
|
| - jsobj.AddProperty("kind", "BoundedType");
|
| - jsobj.AddServiceId(*this);
|
| - const String& user_name = String::Handle(PrettyName());
|
| - const String& vm_name = String::Handle(Name());
|
| - AddNameProperties(&jsobj, user_name, vm_name);
|
| - if (ref) {
|
| - return;
|
| - }
|
| - jsobj.AddProperty("targetType", AbstractType::Handle(type()));
|
| - jsobj.AddProperty("bound", AbstractType::Handle(bound()));
|
| -}
|
| -
|
| -
|
| TokenPosition MixinAppType::token_pos() const {
|
| return AbstractType::Handle(MixinTypeAt(0)).token_pos();
|
| }
|
| @@ -17929,11 +16731,6 @@ const char* MixinAppType::ToCString() const {
|
| }
|
|
|
|
|
| -void MixinAppType::PrintJSONImpl(JSONStream* stream, bool ref) const {
|
| - UNREACHABLE();
|
| -}
|
| -
|
| -
|
| RawAbstractType* MixinAppType::MixinTypeAt(intptr_t depth) const {
|
| return AbstractType::RawCast(Array::Handle(mixin_types()).At(depth));
|
| }
|
| @@ -17975,11 +16772,6 @@ const char* Number::ToCString() const {
|
| }
|
|
|
|
|
| -void Number::PrintJSONImpl(JSONStream* stream, bool ref) const {
|
| - UNREACHABLE();
|
| -}
|
| -
|
| -
|
| const char* Integer::ToCString() const {
|
| // Integer is an interface. No instances of Integer should exist except null.
|
| ASSERT(IsNull());
|
| @@ -17987,15 +16779,6 @@ const char* Integer::ToCString() const {
|
| }
|
|
|
|
|
| -void Integer::PrintJSONImpl(JSONStream* stream, bool ref) const {
|
| - JSONObject jsobj(stream);
|
| - PrintSharedInstanceJSON(&jsobj, ref);
|
| - jsobj.AddProperty("kind", "Int");
|
| - jsobj.AddServiceId(*this);
|
| - jsobj.AddProperty("valueAsString", ToCString());
|
| -}
|
| -
|
| -
|
| // Throw JavascriptIntegerOverflow exception.
|
| static void ThrowJavascriptIntegerOverflow(const Integer& i) {
|
| const Array& exc_args = Array::Handle(Array::New(1));
|
| @@ -18415,15 +17198,6 @@ const char* Smi::ToCString() const {
|
| }
|
|
|
|
|
| -void Smi::PrintJSONImpl(JSONStream* stream, bool ref) const {
|
| - JSONObject jsobj(stream);
|
| - PrintSharedInstanceJSON(&jsobj, ref);
|
| - jsobj.AddProperty("kind", "Int");
|
| - jsobj.AddFixedServiceId("objects/int-%" Pd "", Value());
|
| - jsobj.AddPropertyF("valueAsString", "%" Pd "", Value());
|
| -}
|
| -
|
| -
|
| RawClass* Smi::Class() {
|
| return Isolate::Current()->object_store()->smi_class();
|
| }
|
| @@ -18541,11 +17315,6 @@ const char* Mint::ToCString() const {
|
| }
|
|
|
|
|
| -void Mint::PrintJSONImpl(JSONStream* stream, bool ref) const {
|
| - Integer::PrintJSONImpl(stream, ref);
|
| -}
|
| -
|
| -
|
| void Double::set_value(double value) const {
|
| StoreNonPointer(&raw_ptr()->value_, value);
|
| }
|
| @@ -18673,15 +17442,6 @@ const char* Double::ToCString() const {
|
| }
|
|
|
|
|
| -void Double::PrintJSONImpl(JSONStream* stream, bool ref) const {
|
| - JSONObject jsobj(stream);
|
| - PrintSharedInstanceJSON(&jsobj, ref);
|
| - jsobj.AddProperty("kind", "Double");
|
| - jsobj.AddServiceId(*this);
|
| - jsobj.AddProperty("valueAsString", ToCString());
|
| -}
|
| -
|
| -
|
| bool Bigint::Neg() const {
|
| return Bool::Handle(neg()).value();
|
| }
|
| @@ -19429,11 +18189,6 @@ const char* Bigint::ToCString() const {
|
| }
|
|
|
|
|
| -void Bigint::PrintJSONImpl(JSONStream* stream, bool ref) const {
|
| - Integer::PrintJSONImpl(stream, ref);
|
| -}
|
| -
|
| -
|
| // Synchronize with implementation in compiler (intrinsifier).
|
| class StringHasher : ValueObject {
|
| public:
|
| @@ -20264,44 +19019,6 @@ const char* String::ToCString() const {
|
| }
|
|
|
|
|
| -void String::PrintJSONImpl(JSONStream* stream, bool ref) const {
|
| - JSONObject jsobj(stream);
|
| - if (raw() == Symbols::OptimizedOut().raw()) {
|
| - // TODO(turnidge): This is a hack. The user could have this
|
| - // special string in their program. Fixing this involves updating
|
| - // the debugging api a bit.
|
| - jsobj.AddProperty("type", "Sentinel");
|
| - jsobj.AddProperty("kind", "OptimizedOut");
|
| - jsobj.AddProperty("valueAsString", "<optimized out>");
|
| - return;
|
| - }
|
| - PrintSharedInstanceJSON(&jsobj, ref);
|
| - jsobj.AddProperty("kind", "String");
|
| - jsobj.AddServiceId(*this);
|
| - jsobj.AddProperty("length", Length());
|
| - if (ref) {
|
| - // String refs always truncate to a fixed count;
|
| - const intptr_t kFixedCount = 128;
|
| - if (jsobj.AddPropertyStr("valueAsString", *this, 0, kFixedCount)) {
|
| - jsobj.AddProperty("count", kFixedCount);
|
| - jsobj.AddProperty("valueAsStringIsTruncated", true);
|
| - }
|
| - return;
|
| - }
|
| -
|
| - intptr_t offset;
|
| - intptr_t count;
|
| - stream->ComputeOffsetAndCount(Length(), &offset, &count);
|
| - if (offset > 0) {
|
| - jsobj.AddProperty("offset", offset);
|
| - }
|
| - if (count < Length()) {
|
| - jsobj.AddProperty("count", count);
|
| - }
|
| - jsobj.AddPropertyStr("valueAsString", *this, offset, count);
|
| -}
|
| -
|
| -
|
| void String::ToUTF8(uint8_t* utf8_array, intptr_t array_len) const {
|
| ASSERT(array_len >= Utf8::Length(*this));
|
| Utf8::Encode(*this, reinterpret_cast<char*>(utf8_array), array_len);
|
| @@ -21191,16 +19908,6 @@ const char* Bool::ToCString() const {
|
| }
|
|
|
|
|
| -void Bool::PrintJSONImpl(JSONStream* stream, bool ref) const {
|
| - const char* str = ToCString();
|
| - JSONObject jsobj(stream);
|
| - PrintSharedInstanceJSON(&jsobj, ref);
|
| - jsobj.AddProperty("kind", "Bool");
|
| - jsobj.AddFixedServiceId("objects/bool-%s", str);
|
| - jsobj.AddPropertyF("valueAsString", "%s", str);
|
| -}
|
| -
|
| -
|
| bool Array::CanonicalizeEquals(const Instance& other) const {
|
| if (this->raw() == other.raw()) {
|
| // Both handles point to the same raw instance.
|
| @@ -21303,37 +20010,6 @@ const char* Array::ToCString() const {
|
| }
|
|
|
|
|
| -void Array::PrintJSONImpl(JSONStream* stream, bool ref) const {
|
| - JSONObject jsobj(stream);
|
| - PrintSharedInstanceJSON(&jsobj, ref);
|
| - jsobj.AddProperty("kind", "List");
|
| - jsobj.AddServiceId(*this);
|
| - jsobj.AddProperty("length", Length());
|
| - if (ref) {
|
| - return;
|
| - }
|
| - intptr_t offset;
|
| - intptr_t count;
|
| - stream->ComputeOffsetAndCount(Length(), &offset, &count);
|
| - if (offset > 0) {
|
| - jsobj.AddProperty("offset", offset);
|
| - }
|
| - if (count < Length()) {
|
| - jsobj.AddProperty("count", count);
|
| - }
|
| - intptr_t limit = offset + count;
|
| - ASSERT(limit <= Length());
|
| - {
|
| - JSONArray jsarr(&jsobj, "elements");
|
| - Object& element = Object::Handle();
|
| - for (intptr_t index = offset; index < limit; index++) {
|
| - element = At(index);
|
| - jsarr.AddValue(element);
|
| - }
|
| - }
|
| -}
|
| -
|
| -
|
| RawArray* Array::Grow(const Array& source,
|
| intptr_t new_length,
|
| Heap::Space space) {
|
| @@ -21551,38 +20227,6 @@ const char* GrowableObjectArray::ToCString() const {
|
| }
|
|
|
|
|
| -void GrowableObjectArray::PrintJSONImpl(JSONStream* stream,
|
| - bool ref) const {
|
| - JSONObject jsobj(stream);
|
| - PrintSharedInstanceJSON(&jsobj, ref);
|
| - jsobj.AddProperty("kind", "List");
|
| - jsobj.AddServiceId(*this);
|
| - jsobj.AddProperty("length", Length());
|
| - if (ref) {
|
| - return;
|
| - }
|
| - intptr_t offset;
|
| - intptr_t count;
|
| - stream->ComputeOffsetAndCount(Length(), &offset, &count);
|
| - if (offset > 0) {
|
| - jsobj.AddProperty("offset", offset);
|
| - }
|
| - if (count < Length()) {
|
| - jsobj.AddProperty("count", count);
|
| - }
|
| - intptr_t limit = offset + count;
|
| - ASSERT(limit <= Length());
|
| - {
|
| - JSONArray jsarr(&jsobj, "elements");
|
| - Object& element = Object::Handle();
|
| - for (intptr_t index = offset; index < limit; index++) {
|
| - element = At(index);
|
| - jsarr.AddValue(element);
|
| - }
|
| - }
|
| -}
|
| -
|
| -
|
| // Equivalent to Dart's operator "==" and hashCode.
|
| class DefaultHashTraits {
|
| public:
|
| @@ -21669,45 +20313,6 @@ const char* LinkedHashMap::ToCString() const {
|
| }
|
|
|
|
|
| -void LinkedHashMap::PrintJSONImpl(JSONStream* stream, bool ref) const {
|
| - JSONObject jsobj(stream);
|
| - PrintSharedInstanceJSON(&jsobj, ref);
|
| - jsobj.AddProperty("kind", "Map");
|
| - jsobj.AddServiceId(*this);
|
| - jsobj.AddProperty("length", Length());
|
| - if (ref) {
|
| - return;
|
| - }
|
| - intptr_t offset;
|
| - intptr_t count;
|
| - stream->ComputeOffsetAndCount(Length(), &offset, &count);
|
| - if (offset > 0) {
|
| - jsobj.AddProperty("offset", offset);
|
| - }
|
| - if (count < Length()) {
|
| - jsobj.AddProperty("count", count);
|
| - }
|
| - intptr_t limit = offset + count;
|
| - ASSERT(limit <= Length());
|
| - {
|
| - JSONArray jsarr(&jsobj, "associations");
|
| - Object& object = Object::Handle();
|
| - LinkedHashMap::Iterator iterator(*this);
|
| - int i = 0;
|
| - while (iterator.MoveNext() && i < limit) {
|
| - if (i >= offset) {
|
| - JSONObject jsassoc(&jsarr);
|
| - object = iterator.CurrentKey();
|
| - jsassoc.AddProperty("key", object);
|
| - object = iterator.CurrentValue();
|
| - jsassoc.AddProperty("value", object);
|
| - }
|
| - i++;
|
| - }
|
| - }
|
| -}
|
| -
|
| -
|
| RawFloat32x4* Float32x4::New(float v0, float v1, float v2, float v3,
|
| Heap::Space space) {
|
| ASSERT(Isolate::Current()->object_store()->float32x4_class() !=
|
| @@ -21804,15 +20409,6 @@ const char* Float32x4::ToCString() const {
|
| }
|
|
|
|
|
| -void Float32x4::PrintJSONImpl(JSONStream* stream, bool ref) const {
|
| - JSONObject jsobj(stream);
|
| - PrintSharedInstanceJSON(&jsobj, ref);
|
| - jsobj.AddProperty("kind", "Float32x4");
|
| - jsobj.AddServiceId(*this);
|
| - jsobj.AddProperty("valueAsString", ToCString());
|
| -}
|
| -
|
| -
|
| RawInt32x4* Int32x4::New(int32_t v0, int32_t v1, int32_t v2, int32_t v3,
|
| Heap::Space space) {
|
| ASSERT(Isolate::Current()->object_store()->int32x4_class() !=
|
| @@ -21909,15 +20505,6 @@ const char* Int32x4::ToCString() const {
|
| }
|
|
|
|
|
| -void Int32x4::PrintJSONImpl(JSONStream* stream, bool ref) const {
|
| - JSONObject jsobj(stream);
|
| - PrintSharedInstanceJSON(&jsobj, ref);
|
| - jsobj.AddProperty("kind", "Int32x4");
|
| - jsobj.AddServiceId(*this);
|
| - jsobj.AddProperty("valueAsString", ToCString());
|
| -}
|
| -
|
| -
|
| RawFloat64x2* Float64x2::New(double value0, double value1, Heap::Space space) {
|
| ASSERT(Isolate::Current()->object_store()->float64x2_class() !=
|
| Class::null());
|
| @@ -21988,15 +20575,6 @@ const char* Float64x2::ToCString() const {
|
| }
|
|
|
|
|
| -void Float64x2::PrintJSONImpl(JSONStream* stream, bool ref) const {
|
| - JSONObject jsobj(stream);
|
| - PrintSharedInstanceJSON(&jsobj, ref);
|
| - jsobj.AddProperty("kind", "Float64x2");
|
| - jsobj.AddServiceId(*this);
|
| - jsobj.AddProperty("valueAsString", ToCString());
|
| -}
|
| -
|
| -
|
| const intptr_t TypedData::element_size_table[TypedData::kNumElementSizes] = {
|
| 1, // kTypedDataInt8ArrayCid.
|
| 1, // kTypedDataUint8ArrayCid.
|
| @@ -22085,38 +20663,6 @@ const char* TypedData::ToCString() const {
|
| }
|
|
|
|
|
| -void TypedData::PrintJSONImpl(JSONStream* stream, bool ref) const {
|
| - JSONObject jsobj(stream);
|
| - PrintSharedInstanceJSON(&jsobj, ref);
|
| - const Class& cls = Class::Handle(clazz());
|
| - const String& kind = String::Handle(cls.UserVisibleName());
|
| - jsobj.AddProperty("kind", kind.ToCString());
|
| - jsobj.AddServiceId(*this);
|
| - jsobj.AddProperty("length", Length());
|
| - if (ref) {
|
| - return;
|
| - }
|
| - intptr_t offset;
|
| - intptr_t count;
|
| - stream->ComputeOffsetAndCount(Length(), &offset, &count);
|
| - if (offset > 0) {
|
| - jsobj.AddProperty("offset", offset);
|
| - }
|
| - if (count < Length()) {
|
| - jsobj.AddProperty("count", count);
|
| - }
|
| - if (count == 0) {
|
| - jsobj.AddProperty("bytes", "");
|
| - } else {
|
| - NoSafepointScope no_safepoint;
|
| - jsobj.AddPropertyBase64("bytes",
|
| - reinterpret_cast<const uint8_t*>(
|
| - DataAddr(offset * ElementSizeInBytes())),
|
| - count * ElementSizeInBytes());
|
| - }
|
| -}
|
| -
|
| -
|
| FinalizablePersistentHandle* ExternalTypedData::AddFinalizer(
|
| void* peer, Dart_WeakPersistentHandleFinalizer callback) const {
|
| return dart::AddFinalizer(*this, peer, callback);
|
| @@ -22146,39 +20692,6 @@ const char* ExternalTypedData::ToCString() const {
|
| }
|
|
|
|
|
| -void ExternalTypedData::PrintJSONImpl(JSONStream* stream,
|
| - bool ref) const {
|
| - JSONObject jsobj(stream);
|
| - PrintSharedInstanceJSON(&jsobj, ref);
|
| - const Class& cls = Class::Handle(clazz());
|
| - const String& kind = String::Handle(cls.UserVisibleName());
|
| - jsobj.AddProperty("kind", kind.ToCString());
|
| - jsobj.AddServiceId(*this);
|
| - jsobj.AddProperty("length", Length());
|
| - if (ref) {
|
| - return;
|
| - }
|
| - intptr_t offset;
|
| - intptr_t count;
|
| - stream->ComputeOffsetAndCount(Length(), &offset, &count);
|
| - if (offset > 0) {
|
| - jsobj.AddProperty("offset", offset);
|
| - }
|
| - if (count < Length()) {
|
| - jsobj.AddProperty("count", count);
|
| - }
|
| - if (count == 0) {
|
| - jsobj.AddProperty("bytes", "");
|
| - } else {
|
| - NoSafepointScope no_safepoint;
|
| - jsobj.AddPropertyBase64("bytes",
|
| - reinterpret_cast<const uint8_t*>(
|
| - DataAddr(offset * ElementSizeInBytes())),
|
| - count * ElementSizeInBytes());
|
| - }
|
| -}
|
| -
|
| -
|
| RawCapability* Capability::New(uint64_t id, Heap::Space space) {
|
| Capability& result = Capability::Handle();
|
| {
|
| @@ -22198,11 +20711,6 @@ const char* Capability::ToCString() const {
|
| }
|
|
|
|
|
| -void Capability::PrintJSONImpl(JSONStream* stream, bool ref) const {
|
| - Instance::PrintJSONImpl(stream, ref);
|
| -}
|
| -
|
| -
|
| RawReceivePort* ReceivePort::New(Dart_Port id,
|
| bool is_control_port,
|
| Heap::Space space) {
|
| @@ -22235,11 +20743,6 @@ const char* ReceivePort::ToCString() const {
|
| }
|
|
|
|
|
| -void ReceivePort::PrintJSONImpl(JSONStream* stream, bool ref) const {
|
| - Instance::PrintJSONImpl(stream, ref);
|
| -}
|
| -
|
| -
|
| RawSendPort* SendPort::New(Dart_Port id, Heap::Space space) {
|
| return New(id, Isolate::Current()->origin_id(), space);
|
| }
|
| @@ -22268,11 +20771,6 @@ const char* SendPort::ToCString() const {
|
| }
|
|
|
|
|
| -void SendPort::PrintJSONImpl(JSONStream* stream, bool ref) const {
|
| - Instance::PrintJSONImpl(stream, ref);
|
| -}
|
| -
|
| -
|
| const char* Closure::ToCString() const {
|
| const Function& fun = Function::Handle(function());
|
| const bool is_implicit_closure = fun.IsImplicitClosureFunction();
|
| @@ -22284,11 +20782,6 @@ const char* Closure::ToCString() const {
|
| }
|
|
|
|
|
| -void Closure::PrintJSONImpl(JSONStream* stream, bool ref) const {
|
| - Instance::PrintJSONImpl(stream, ref);
|
| -}
|
| -
|
| -
|
| RawClosure* Closure::New(const Function& function,
|
| const Context& context,
|
| Heap::Space space) {
|
| @@ -22396,16 +20889,6 @@ const char* Stacktrace::ToCString() const {
|
| }
|
|
|
|
|
| -void Stacktrace::PrintJSONImpl(JSONStream* stream, bool ref) const {
|
| - JSONObject jsobj(stream);
|
| - PrintSharedInstanceJSON(&jsobj, ref);
|
| - jsobj.AddProperty("kind", "StackTrace");
|
| - jsobj.AddServiceId(*this);
|
| - intptr_t idx = 0;
|
| - jsobj.AddProperty("valueAsString", ToCStringInternal(&idx));
|
| -}
|
| -
|
| -
|
| static intptr_t PrintOneStacktrace(Zone* zone,
|
| GrowableArray<char*>* frame_strings,
|
| uword pc,
|
| @@ -22655,33 +21138,6 @@ const char* JSRegExp::ToCString() const {
|
| }
|
|
|
|
|
| -void JSRegExp::PrintJSONImpl(JSONStream* stream, bool ref) const {
|
| - JSONObject jsobj(stream);
|
| - PrintSharedInstanceJSON(&jsobj, ref);
|
| - jsobj.AddProperty("kind", "RegExp");
|
| - jsobj.AddServiceId(*this);
|
| -
|
| - jsobj.AddProperty("pattern", String::Handle(pattern()));
|
| -
|
| - if (ref) {
|
| - return;
|
| - }
|
| -
|
| - jsobj.AddProperty("isCaseSensitive", !is_ignore_case());
|
| - jsobj.AddProperty("isMultiLine", is_multi_line());
|
| -
|
| - Function& func = Function::Handle();
|
| - func = function(kOneByteStringCid);
|
| - jsobj.AddProperty("_oneByteFunction", func);
|
| - func = function(kTwoByteStringCid);
|
| - jsobj.AddProperty("_twoByteFunction", func);
|
| - func = function(kExternalOneByteStringCid);
|
| - jsobj.AddProperty("_externalOneByteFunction", func);
|
| - func = function(kExternalTwoByteStringCid);
|
| - jsobj.AddProperty("_externalTwoByteFunction", func);
|
| -}
|
| -
|
| -
|
| RawWeakProperty* WeakProperty::New(Heap::Space space) {
|
| ASSERT(Isolate::Current()->object_store()->weak_property_class()
|
| != Class::null());
|
| @@ -22697,21 +21153,6 @@ const char* WeakProperty::ToCString() const {
|
| }
|
|
|
|
|
| -void WeakProperty::PrintJSONImpl(JSONStream* stream, bool ref) const {
|
| - JSONObject jsobj(stream);
|
| - PrintSharedInstanceJSON(&jsobj, ref);
|
| - jsobj.AddProperty("kind", "WeakProperty");
|
| - jsobj.AddServiceId(*this);
|
| - if (ref) {
|
| - return;
|
| - }
|
| -
|
| - const Object& key_handle = Object::Handle(key());
|
| - jsobj.AddProperty("propertyKey", key_handle);
|
| - const Object& value_handle = Object::Handle(value());
|
| - jsobj.AddProperty("propertyValue", value_handle);
|
| -}
|
| -
|
| RawAbstractType* MirrorReference::GetAbstractTypeReferent() const {
|
| ASSERT(Object::Handle(referent()).IsAbstractType());
|
| return AbstractType::Cast(Object::Handle(referent())).raw();
|
| @@ -22768,21 +21209,6 @@ const char* MirrorReference::ToCString() const {
|
| }
|
|
|
|
|
| -void MirrorReference::PrintJSONImpl(JSONStream* stream, bool ref) const {
|
| - JSONObject jsobj(stream);
|
| - PrintSharedInstanceJSON(&jsobj, ref);
|
| - jsobj.AddProperty("kind", "MirrorReference");
|
| - jsobj.AddServiceId(*this);
|
| -
|
| - if (ref) {
|
| - return;
|
| - }
|
| -
|
| - const Object& referent_handle = Object::Handle(referent());
|
| - jsobj.AddProperty("mirrorReferent", referent_handle);
|
| -}
|
| -
|
| -
|
| void UserTag::MakeActive() const {
|
| Isolate* isolate = Isolate::Current();
|
| ASSERT(isolate != NULL);
|
| @@ -22920,10 +21346,4 @@ const char* UserTag::ToCString() const {
|
| return tag_label.ToCString();
|
| }
|
|
|
| -
|
| -void UserTag::PrintJSONImpl(JSONStream* stream, bool ref) const {
|
| - Instance::PrintJSONImpl(stream, ref);
|
| -}
|
| -
|
| -
|
| } // namespace dart
|
|
|