| OLD | NEW |
| 1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2011, 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/disassembler.h" | 5 #include "vm/disassembler.h" |
| 6 | 6 |
| 7 #include "vm/assembler.h" | 7 #include "vm/assembler.h" |
| 8 #include "vm/globals.h" | 8 #include "vm/globals.h" |
| 9 #include "vm/os.h" | 9 #include "vm/os.h" |
| 10 #include "vm/log.h" | 10 #include "vm/log.h" |
| (...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 134 while (comment_finger < comments.Length() && | 134 while (comment_finger < comments.Length() && |
| 135 comments.PCOffsetAt(comment_finger) <= offset) { | 135 comments.PCOffsetAt(comment_finger) <= offset) { |
| 136 formatter->Print( | 136 formatter->Print( |
| 137 " ;; %s\n", | 137 " ;; %s\n", |
| 138 String::Handle(comments.CommentAt(comment_finger)).ToCString()); | 138 String::Handle(comments.CommentAt(comment_finger)).ToCString()); |
| 139 comment_finger++; | 139 comment_finger++; |
| 140 } | 140 } |
| 141 if (old_comment_finger != comment_finger) { | 141 if (old_comment_finger != comment_finger) { |
| 142 // Comment emitted, emit inlining information. | 142 // Comment emitted, emit inlining information. |
| 143 code.GetInlinedFunctionsAt(offset, &inlined_functions); | 143 code.GetInlinedFunctionsAt(offset, &inlined_functions); |
| 144 // Skip top scope function printing. | 144 // Skip top scope function printing (last entry in 'inlined_functions'). |
| 145 for (intptr_t i = 1; i < inlined_functions.length(); i++) { | 145 bool first = true; |
| 146 if (i == 1) { | 146 for (intptr_t i = inlined_functions.length() - 2; i >= 0; i--) { |
| 147 formatter->Print(" ;; Inlined "); | 147 const char* name = inlined_functions[i]->ToQualifiedCString(); |
| 148 if (first) { |
| 149 formatter->Print(" ;; Inlined [%s", name); |
| 150 first = false; |
| 151 } else { |
| 152 formatter->Print(" -> %s", name); |
| 148 } | 153 } |
| 149 formatter->Print("-> %s ", inlined_functions[i]->ToQualifiedCString()); | |
| 150 } | 154 } |
| 151 if (inlined_functions.length() > 1) { | 155 if (!first) { |
| 152 formatter->Print("\n"); | 156 formatter->Print("]\n"); |
| 153 } | 157 } |
| 154 } | 158 } |
| 155 int instruction_length; | 159 int instruction_length; |
| 156 DecodeInstruction(hex_buffer, | 160 DecodeInstruction(hex_buffer, |
| 157 sizeof(hex_buffer), | 161 sizeof(hex_buffer), |
| 158 human_buffer, | 162 human_buffer, |
| 159 sizeof(human_buffer), | 163 sizeof(human_buffer), |
| 160 &instruction_length, pc); | 164 &instruction_length, pc); |
| 161 formatter->ConsumeInstruction(hex_buffer, | 165 formatter->ConsumeInstruction(hex_buffer, |
| 162 sizeof(hex_buffer), | 166 sizeof(hex_buffer), |
| 163 human_buffer, | 167 human_buffer, |
| 164 sizeof(human_buffer), | 168 sizeof(human_buffer), |
| 165 pc); | 169 pc); |
| 166 pc += instruction_length; | 170 pc += instruction_length; |
| 167 } | 171 } |
| 168 } | 172 } |
| 169 | 173 |
| 170 } // namespace dart | 174 } // namespace dart |
| OLD | NEW |