OLD | NEW |
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
2 // for details. All rights reserved. Use of this source code is governed by a | 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. | 3 // BSD-style license that can be found in the LICENSE file. |
4 | 4 |
5 #include "vm/object.h" | 5 #include "vm/object.h" |
6 | 6 |
7 #include "include/dart_api.h" | 7 #include "include/dart_api.h" |
8 #include "platform/assert.h" | 8 #include "platform/assert.h" |
9 #include "vm/assembler.h" | 9 #include "vm/assembler.h" |
10 #include "vm/cpu.h" | 10 #include "vm/cpu.h" |
(...skipping 7414 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7425 const char* library_url = String::Handle(url()).ToCString(); | 7425 const char* library_url = String::Handle(url()).ToCString(); |
7426 ObjectIdRing* ring = Isolate::Current()->object_id_ring(); | 7426 ObjectIdRing* ring = Isolate::Current()->object_id_ring(); |
7427 intptr_t id = ring->GetIdForObject(raw()); | 7427 intptr_t id = ring->GetIdForObject(raw()); |
7428 JSONObject jsobj(stream); | 7428 JSONObject jsobj(stream); |
7429 jsobj.AddProperty("type", JSONType(ref)); | 7429 jsobj.AddProperty("type", JSONType(ref)); |
7430 jsobj.AddProperty("id", id); | 7430 jsobj.AddProperty("id", id); |
7431 jsobj.AddProperty("name", library_name); | 7431 jsobj.AddProperty("name", library_name); |
7432 if (ref) return; | 7432 if (ref) return; |
7433 jsobj.AddProperty("url", library_url); | 7433 jsobj.AddProperty("url", library_url); |
7434 { | 7434 { |
7435 JSONArray jsarr(jsobj, "classes"); | 7435 JSONArray jsarr(&jsobj, "classes"); |
7436 ClassDictionaryIterator class_iter(*this); | 7436 ClassDictionaryIterator class_iter(*this); |
7437 Class& klass = Class::Handle(); | 7437 Class& klass = Class::Handle(); |
7438 while (class_iter.HasNext()) { | 7438 while (class_iter.HasNext()) { |
7439 klass = class_iter.GetNextClass(); | 7439 klass = class_iter.GetNextClass(); |
7440 jsarr.AddValue(klass); | 7440 jsarr.AddValue(klass); |
7441 } | 7441 } |
7442 } | 7442 } |
7443 { | 7443 { |
7444 JSONArray jsarr(jsobj, "libraries"); | 7444 JSONArray jsarr(&jsobj, "libraries"); |
7445 Library& lib = Library::Handle(); | 7445 Library& lib = Library::Handle(); |
7446 for (intptr_t i = 0; i < num_imports(); i++) { | 7446 for (intptr_t i = 0; i < num_imports(); i++) { |
7447 lib = ImportLibraryAt(i); | 7447 lib = ImportLibraryAt(i); |
7448 jsarr.AddValue(lib); | 7448 jsarr.AddValue(lib); |
7449 } | 7449 } |
7450 } | 7450 } |
7451 } | 7451 } |
7452 | 7452 |
7453 | 7453 |
7454 RawLibrary* LibraryPrefix::GetLibrary(int index) const { | 7454 RawLibrary* LibraryPrefix::GetLibrary(int index) const { |
(...skipping 1476 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
8931 if (ref) { | 8931 if (ref) { |
8932 jsobj.AddProperty("type", "@Code"); | 8932 jsobj.AddProperty("type", "@Code"); |
8933 jsobj.AddProperty("id", id); | 8933 jsobj.AddProperty("id", id); |
8934 return; | 8934 return; |
8935 } | 8935 } |
8936 jsobj.AddProperty("type", "Code"); | 8936 jsobj.AddProperty("type", "Code"); |
8937 jsobj.AddProperty("id", id); | 8937 jsobj.AddProperty("id", id); |
8938 jsobj.AddProperty("is_optimized", is_optimized()); | 8938 jsobj.AddProperty("is_optimized", is_optimized()); |
8939 jsobj.AddProperty("is_alive", is_alive()); | 8939 jsobj.AddProperty("is_alive", is_alive()); |
8940 jsobj.AddProperty("function", Object::Handle(function())); | 8940 jsobj.AddProperty("function", Object::Handle(function())); |
8941 JSONArray jsarr(jsobj, "disassembly"); | 8941 JSONArray jsarr(&jsobj, "disassembly"); |
8942 DisassembleToJSONStream formatter(jsarr); | 8942 DisassembleToJSONStream formatter(jsarr); |
8943 const Instructions& instr = Instructions::Handle(instructions()); | 8943 const Instructions& instr = Instructions::Handle(instructions()); |
8944 uword start = instr.EntryPoint(); | 8944 uword start = instr.EntryPoint(); |
8945 Disassembler::Disassemble(start, start + instr.size(), &formatter, | 8945 Disassembler::Disassemble(start, start + instr.size(), &formatter, |
8946 comments()); | 8946 comments()); |
8947 } | 8947 } |
8948 | 8948 |
8949 | 8949 |
8950 uword Code::GetPatchCodePc() const { | 8950 uword Code::GetPatchCodePc() const { |
8951 const PcDescriptors& descriptors = PcDescriptors::Handle(pc_descriptors()); | 8951 const PcDescriptors& descriptors = PcDescriptors::Handle(pc_descriptors()); |
(...skipping 5898 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
14850 return "_MirrorReference"; | 14850 return "_MirrorReference"; |
14851 } | 14851 } |
14852 | 14852 |
14853 | 14853 |
14854 void MirrorReference::PrintToJSONStream(JSONStream* stream, bool ref) const { | 14854 void MirrorReference::PrintToJSONStream(JSONStream* stream, bool ref) const { |
14855 JSONObject jsobj(stream); | 14855 JSONObject jsobj(stream); |
14856 } | 14856 } |
14857 | 14857 |
14858 | 14858 |
14859 } // namespace dart | 14859 } // namespace dart |
OLD | NEW |