| OLD | NEW |
| 1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2016, 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/debugger.h" | 5 #include "vm/debugger.h" |
| 6 #include "vm/disassembler.h" | 6 #include "vm/disassembler.h" |
| 7 #include "vm/object.h" | 7 #include "vm/object.h" |
| 8 #include "vm/object_store.h" | 8 #include "vm/object_store.h" |
| 9 #include "vm/stub_code.h" | 9 #include "vm/stub_code.h" |
| 10 #include "vm/symbols.h" | 10 #include "vm/symbols.h" |
| (...skipping 816 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 827 cache_entry.AddProperty("count", count); | 827 cache_entry.AddProperty("count", count); |
| 828 } | 828 } |
| 829 } | 829 } |
| 830 | 830 |
| 831 | 831 |
| 832 void Code::PrintJSONImpl(JSONStream* stream, bool ref) const { | 832 void Code::PrintJSONImpl(JSONStream* stream, bool ref) const { |
| 833 JSONObject jsobj(stream); | 833 JSONObject jsobj(stream); |
| 834 AddCommonObjectProperties(&jsobj, "Code", ref); | 834 AddCommonObjectProperties(&jsobj, "Code", ref); |
| 835 jsobj.AddFixedServiceId("code/%" Px64"-%" Px "", | 835 jsobj.AddFixedServiceId("code/%" Px64"-%" Px "", |
| 836 compile_timestamp(), | 836 compile_timestamp(), |
| 837 EntryPoint()); | 837 PayloadStart()); |
| 838 const String& qualified_name = String::Handle(QualifiedName()); | 838 const String& qualified_name = String::Handle(QualifiedName()); |
| 839 const String& vm_name = String::Handle(Name()); | 839 const String& vm_name = String::Handle(Name()); |
| 840 AddNameProperties(&jsobj, qualified_name, vm_name); | 840 AddNameProperties(&jsobj, qualified_name, vm_name); |
| 841 const bool is_stub = IsStubCode() || IsAllocationStubCode(); | 841 const bool is_stub = IsStubCode() || IsAllocationStubCode(); |
| 842 if (is_stub) { | 842 if (is_stub) { |
| 843 jsobj.AddProperty("kind", "Stub"); | 843 jsobj.AddProperty("kind", "Stub"); |
| 844 } else { | 844 } else { |
| 845 jsobj.AddProperty("kind", "Dart"); | 845 jsobj.AddProperty("kind", "Dart"); |
| 846 } | 846 } |
| 847 jsobj.AddProperty("_optimized", is_optimized()); | 847 jsobj.AddProperty("_optimized", is_optimized()); |
| (...skipping 13 matching lines...) Expand all Loading... |
| 861 jsobj.AddProperty("function", obj); | 861 jsobj.AddProperty("function", obj); |
| 862 } else { | 862 } else { |
| 863 // Generate a fake function reference. | 863 // Generate a fake function reference. |
| 864 JSONObject func(&jsobj, "function"); | 864 JSONObject func(&jsobj, "function"); |
| 865 func.AddProperty("type", "@Function"); | 865 func.AddProperty("type", "@Function"); |
| 866 func.AddProperty("_kind", "Stub"); | 866 func.AddProperty("_kind", "Stub"); |
| 867 ASSERT(qualified_name.Equals(vm_name)); | 867 ASSERT(qualified_name.Equals(vm_name)); |
| 868 func.AddProperty("name", vm_name.ToCString()); | 868 func.AddProperty("name", vm_name.ToCString()); |
| 869 AddNameProperties(&func, vm_name, vm_name); | 869 AddNameProperties(&func, vm_name, vm_name); |
| 870 } | 870 } |
| 871 jsobj.AddPropertyF("_startAddress", "%" Px "", EntryPoint()); | 871 jsobj.AddPropertyF("_startAddress", "%" Px "", PayloadStart()); |
| 872 jsobj.AddPropertyF("_endAddress", "%" Px "", EntryPoint() + Size()); | 872 jsobj.AddPropertyF("_endAddress", "%" Px "", PayloadStart() + Size()); |
| 873 jsobj.AddProperty("_alive", is_alive()); | 873 jsobj.AddProperty("_alive", is_alive()); |
| 874 const ObjectPool& object_pool = ObjectPool::Handle(GetObjectPool()); | 874 const ObjectPool& object_pool = ObjectPool::Handle(GetObjectPool()); |
| 875 jsobj.AddProperty("_objectPool", object_pool); | 875 jsobj.AddProperty("_objectPool", object_pool); |
| 876 { | 876 { |
| 877 JSONArray jsarr(&jsobj, "_disassembly"); | 877 JSONArray jsarr(&jsobj, "_disassembly"); |
| 878 if (is_alive()) { | 878 if (is_alive()) { |
| 879 // Only disassemble alive code objects. | 879 // Only disassemble alive code objects. |
| 880 DisassembleToJSONStream formatter(jsarr); | 880 DisassembleToJSONStream formatter(jsarr); |
| 881 Disassemble(&formatter); | 881 Disassemble(&formatter); |
| 882 } | 882 } |
| (...skipping 714 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1597 jsobj.AddProperty("mirrorReferent", referent_handle); | 1597 jsobj.AddProperty("mirrorReferent", referent_handle); |
| 1598 } | 1598 } |
| 1599 | 1599 |
| 1600 void UserTag::PrintJSONImpl(JSONStream* stream, bool ref) const { | 1600 void UserTag::PrintJSONImpl(JSONStream* stream, bool ref) const { |
| 1601 Instance::PrintJSONImpl(stream, ref); | 1601 Instance::PrintJSONImpl(stream, ref); |
| 1602 } | 1602 } |
| 1603 | 1603 |
| 1604 #endif | 1604 #endif |
| 1605 | 1605 |
| 1606 } // namespace dart | 1606 } // namespace dart |
| OLD | NEW |