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 12532 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
12543 // Only disassemble alive code objects. | 12543 // Only disassemble alive code objects. |
12544 DisassembleToJSONStream formatter(jsarr); | 12544 DisassembleToJSONStream formatter(jsarr); |
12545 Disassemble(&formatter); | 12545 Disassemble(&formatter); |
12546 } | 12546 } |
12547 } | 12547 } |
12548 const PcDescriptors& descriptors = PcDescriptors::Handle(pc_descriptors()); | 12548 const PcDescriptors& descriptors = PcDescriptors::Handle(pc_descriptors()); |
12549 if (!descriptors.IsNull()) { | 12549 if (!descriptors.IsNull()) { |
12550 JSONObject desc(&jsobj, "descriptors"); | 12550 JSONObject desc(&jsobj, "descriptors"); |
12551 descriptors.PrintToJSONObject(&desc, false); | 12551 descriptors.PrintToJSONObject(&desc, false); |
12552 } | 12552 } |
| 12553 const Array& inlined_function_table = Array::Handle(inlined_id_to_function()); |
| 12554 if (!inlined_function_table.IsNull()) { |
| 12555 JSONArray inlined_functions(&jsobj, "inlinedFunctions"); |
| 12556 Function& function = Function::Handle(); |
| 12557 for (intptr_t i = 0; i < inlined_function_table.Length(); i++) { |
| 12558 function ^= inlined_function_table.At(i); |
| 12559 ASSERT(!function.IsNull()); |
| 12560 inlined_functions.AddValue(function); |
| 12561 } |
| 12562 } |
| 12563 const Array& intervals = Array::Handle(inlined_intervals()); |
| 12564 if (!intervals.IsNull()) { |
| 12565 Smi& start = Smi::Handle(); |
| 12566 Smi& end = Smi::Handle(); |
| 12567 JSONArray inline_intervals(&jsobj, "inlinedIntervals"); |
| 12568 for (intptr_t i = 0; i < intervals.Length() - Code::kInlIntNumEntries; |
| 12569 i += Code::kInlIntNumEntries) { |
| 12570 start ^= intervals.At(i + Code::kInlIntStart); |
| 12571 if (start.IsNull()) { |
| 12572 continue; |
| 12573 } |
| 12574 end ^= intervals.At(i + Code::kInlIntNumEntries + Code::kInlIntStart); |
| 12575 |
| 12576 // Format: [start, end, inline functions...] |
| 12577 JSONArray inline_interval(&inline_intervals); |
| 12578 inline_interval.AddValue(start.Value()); |
| 12579 inline_interval.AddValue(end.Value()); |
| 12580 |
| 12581 Smi& temp_smi = Smi::Handle(); |
| 12582 temp_smi ^= intervals.At(i + Code::kInlIntInliningId); |
| 12583 intptr_t inlining_id = temp_smi.Value(); |
| 12584 ASSERT(inlining_id >= 0); |
| 12585 temp_smi ^= intervals.At(i + Code::kInlIntCallerId); |
| 12586 intptr_t caller_id = temp_smi.Value(); |
| 12587 while (inlining_id >= 0) { |
| 12588 inline_interval.AddValue(inlining_id); |
| 12589 inlining_id = caller_id; |
| 12590 caller_id = GetCallerId(inlining_id); |
| 12591 } |
| 12592 } |
| 12593 } |
12553 } | 12594 } |
12554 | 12595 |
12555 | 12596 |
12556 uword Code::GetEntryPatchPc() const { | 12597 uword Code::GetEntryPatchPc() const { |
12557 return (entry_patch_pc_offset() != kInvalidPc) | 12598 return (entry_patch_pc_offset() != kInvalidPc) |
12558 ? EntryPoint() + entry_patch_pc_offset() : 0; | 12599 ? EntryPoint() + entry_patch_pc_offset() : 0; |
12559 } | 12600 } |
12560 | 12601 |
12561 | 12602 |
12562 uword Code::GetPatchCodePc() const { | 12603 uword Code::GetPatchCodePc() const { |
(...skipping 8061 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
20624 return tag_label.ToCString(); | 20665 return tag_label.ToCString(); |
20625 } | 20666 } |
20626 | 20667 |
20627 | 20668 |
20628 void UserTag::PrintJSONImpl(JSONStream* stream, bool ref) const { | 20669 void UserTag::PrintJSONImpl(JSONStream* stream, bool ref) const { |
20629 Instance::PrintJSONImpl(stream, ref); | 20670 Instance::PrintJSONImpl(stream, ref); |
20630 } | 20671 } |
20631 | 20672 |
20632 | 20673 |
20633 } // namespace dart | 20674 } // namespace dart |
OLD | NEW |