| 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 846 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 857 // Only disassemble alive code objects. | 857 // Only disassemble alive code objects. |
| 858 DisassembleToJSONStream formatter(jsarr); | 858 DisassembleToJSONStream formatter(jsarr); |
| 859 Disassemble(&formatter); | 859 Disassemble(&formatter); |
| 860 } | 860 } |
| 861 } | 861 } |
| 862 const PcDescriptors& descriptors = PcDescriptors::Handle(pc_descriptors()); | 862 const PcDescriptors& descriptors = PcDescriptors::Handle(pc_descriptors()); |
| 863 if (!descriptors.IsNull()) { | 863 if (!descriptors.IsNull()) { |
| 864 JSONObject desc(&jsobj, "_descriptors"); | 864 JSONObject desc(&jsobj, "_descriptors"); |
| 865 descriptors.PrintToJSONObject(&desc, false); | 865 descriptors.PrintToJSONObject(&desc, false); |
| 866 } | 866 } |
| 867 const Array& inlined_function_table = Array::Handle(GetInlinedIdToFunction()); | |
| 868 if (!inlined_function_table.IsNull() && | |
| 869 (inlined_function_table.Length() > 0)) { | |
| 870 JSONArray inlined_functions(&jsobj, "_inlinedFunctions"); | |
| 871 Function& function = Function::Handle(); | |
| 872 for (intptr_t i = 0; i < inlined_function_table.Length(); i++) { | |
| 873 function ^= inlined_function_table.At(i); | |
| 874 ASSERT(!function.IsNull()); | |
| 875 inlined_functions.AddValue(function); | |
| 876 } | |
| 877 } | |
| 878 const Array& intervals = Array::Handle(GetInlinedIntervals()); | |
| 879 if (!intervals.IsNull() && (intervals.Length() > 0)) { | |
| 880 Smi& start = Smi::Handle(); | |
| 881 Smi& end = Smi::Handle(); | |
| 882 Smi& temp_smi = Smi::Handle(); | |
| 883 JSONArray inline_intervals(&jsobj, "_inlinedIntervals"); | |
| 884 for (intptr_t i = 0; i < intervals.Length() - Code::kInlIntNumEntries; | |
| 885 i += Code::kInlIntNumEntries) { | |
| 886 start ^= intervals.At(i + Code::kInlIntStart); | |
| 887 if (start.IsNull()) { | |
| 888 continue; | |
| 889 } | |
| 890 end ^= intervals.At(i + Code::kInlIntNumEntries + Code::kInlIntStart); | |
| 891 | 867 |
| 892 // Format: [start, end, inline functions...] | 868 PrintJSONInlineIntervals(&jsobj); |
| 893 JSONArray inline_interval(&inline_intervals); | |
| 894 inline_interval.AddValue(start.Value()); | |
| 895 inline_interval.AddValue(end.Value()); | |
| 896 | |
| 897 temp_smi ^= intervals.At(i + Code::kInlIntInliningId); | |
| 898 intptr_t inlining_id = temp_smi.Value(); | |
| 899 ASSERT(inlining_id >= 0); | |
| 900 intptr_t caller_id = GetCallerId(inlining_id); | |
| 901 while (inlining_id >= 0) { | |
| 902 inline_interval.AddValue(inlining_id); | |
| 903 inlining_id = caller_id; | |
| 904 caller_id = GetCallerId(inlining_id); | |
| 905 } | |
| 906 } | |
| 907 } | |
| 908 } | 869 } |
| 909 | 870 |
| 910 | 871 |
| 911 void Context::PrintJSONImpl(JSONStream* stream, bool ref) const { | 872 void Context::PrintJSONImpl(JSONStream* stream, bool ref) const { |
| 912 JSONObject jsobj(stream); | 873 JSONObject jsobj(stream); |
| 913 // TODO(turnidge): Should the user level type for Context be Context | 874 // TODO(turnidge): Should the user level type for Context be Context |
| 914 // or Object? | 875 // or Object? |
| 915 AddCommonObjectProperties(&jsobj, "Context", ref); | 876 AddCommonObjectProperties(&jsobj, "Context", ref); |
| 916 jsobj.AddServiceId(*this); | 877 jsobj.AddServiceId(*this); |
| 917 | 878 |
| (...skipping 671 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1589 jsobj.AddProperty("mirrorReferent", referent_handle); | 1550 jsobj.AddProperty("mirrorReferent", referent_handle); |
| 1590 } | 1551 } |
| 1591 | 1552 |
| 1592 void UserTag::PrintJSONImpl(JSONStream* stream, bool ref) const { | 1553 void UserTag::PrintJSONImpl(JSONStream* stream, bool ref) const { |
| 1593 Instance::PrintJSONImpl(stream, ref); | 1554 Instance::PrintJSONImpl(stream, ref); |
| 1594 } | 1555 } |
| 1595 | 1556 |
| 1596 #endif | 1557 #endif |
| 1597 | 1558 |
| 1598 } // namespace dart | 1559 } // namespace dart |
| OLD | NEW |