Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(527)

Side by Side Diff: runtime/vm/disassembler.cc

Issue 904763003: Redesign inlining interval computation. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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/json_stream.h" 10 #include "vm/json_stream.h"
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after
124 while (comment_finger < comments.Length() && 124 while (comment_finger < comments.Length() &&
125 comments.PCOffsetAt(comment_finger) <= offset) { 125 comments.PCOffsetAt(comment_finger) <= offset) {
126 formatter->Print( 126 formatter->Print(
127 " ;; %s\n", 127 " ;; %s\n",
128 String::Handle(comments.CommentAt(comment_finger)).ToCString()); 128 String::Handle(comments.CommentAt(comment_finger)).ToCString());
129 comment_finger++; 129 comment_finger++;
130 } 130 }
131 if (old_comment_finger != comment_finger) { 131 if (old_comment_finger != comment_finger) {
132 // Comment emitted, emit inlining information. 132 // Comment emitted, emit inlining information.
133 code.GetInlinedFunctionsAt(offset, &inlined_functions); 133 code.GetInlinedFunctionsAt(offset, &inlined_functions);
134 // Skip top scope function printing. 134 // Skip top scope function printing (last entry in 'inlined_functions').
135 for (intptr_t i = 1; i < inlined_functions.length(); i++) { 135 bool first = true;
136 if (i == 1) { 136 for (intptr_t i = inlined_functions.length() - 2; i >= 0; i--) {
137 formatter->Print(" ;; Inlined "); 137 const char* name = inlined_functions[i]->ToQualifiedCString();
138 if (first) {
139 formatter->Print(" ;; Inlined [%s", name);
140 first = false;
141 } else {
142 formatter->Print(" -> %s", name);
138 } 143 }
139 formatter->Print("-> %s ", inlined_functions[i]->ToQualifiedCString());
140 } 144 }
141 if (inlined_functions.length() > 1) { 145 if (!first) {
142 formatter->Print("\n"); 146 formatter->Print("]\n");
143 } 147 }
144 } 148 }
145 int instruction_length; 149 int instruction_length;
146 DecodeInstruction(hex_buffer, 150 DecodeInstruction(hex_buffer,
147 sizeof(hex_buffer), 151 sizeof(hex_buffer),
148 human_buffer, 152 human_buffer,
149 sizeof(human_buffer), 153 sizeof(human_buffer),
150 &instruction_length, pc); 154 &instruction_length, pc);
151 formatter->ConsumeInstruction(hex_buffer, 155 formatter->ConsumeInstruction(hex_buffer,
152 sizeof(hex_buffer), 156 sizeof(hex_buffer),
153 human_buffer, 157 human_buffer,
154 sizeof(human_buffer), 158 sizeof(human_buffer),
155 pc); 159 pc);
156 pc += instruction_length; 160 pc += instruction_length;
157 } 161 }
158 } 162 }
159 163
160 } // namespace dart 164 } // namespace dart
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698