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/il_printer.h" | 5 #include "vm/il_printer.h" |
6 | 6 |
7 #include "vm/flow_graph_range_analysis.h" | 7 #include "vm/flow_graph_range_analysis.h" |
8 #include "vm/intermediate_language.h" | 8 #include "vm/intermediate_language.h" |
9 #include "vm/os.h" | 9 #include "vm/os.h" |
10 #include "vm/parser.h" | 10 #include "vm/parser.h" |
(...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
190 BufferFormatter f(buffer, sizeof(buffer)); | 190 BufferFormatter f(buffer, sizeof(buffer)); |
191 PrintTo(&f); | 191 PrintTo(&f); |
192 return Thread::Current()->zone()->MakeCopyOfString(buffer); | 192 return Thread::Current()->zone()->MakeCopyOfString(buffer); |
193 } | 193 } |
194 | 194 |
195 | 195 |
196 static void PrintICDataHelper(BufferFormatter* f, | 196 static void PrintICDataHelper(BufferFormatter* f, |
197 const ICData& ic_data, | 197 const ICData& ic_data, |
198 intptr_t num_checks_to_print) { | 198 intptr_t num_checks_to_print) { |
199 f->Print(" IC["); | 199 f->Print(" IC["); |
200 if (ic_data.HasRangeFeedback()) { | |
201 f->Print("{%s", | |
202 ICData::RangeFeedbackToString(ic_data.DecodeRangeFeedbackAt(0))); | |
203 if (ic_data.NumArgsTested() == 2) { | |
204 f->Print(" x %s", | |
205 ICData::RangeFeedbackToString(ic_data.DecodeRangeFeedbackAt(1))); | |
206 } | |
207 f->Print("->%s} ", | |
208 ICData::RangeFeedbackToString(ic_data.DecodeRangeFeedbackAt(2))); | |
209 } | |
210 f->Print("%" Pd ": ", ic_data.NumberOfChecks()); | 200 f->Print("%" Pd ": ", ic_data.NumberOfChecks()); |
211 Function& target = Function::Handle(); | 201 Function& target = Function::Handle(); |
212 if ((num_checks_to_print == FlowGraphPrinter::kPrintAll) || | 202 if ((num_checks_to_print == FlowGraphPrinter::kPrintAll) || |
213 (num_checks_to_print > ic_data.NumberOfChecks())) { | 203 (num_checks_to_print > ic_data.NumberOfChecks())) { |
214 num_checks_to_print = ic_data.NumberOfChecks(); | 204 num_checks_to_print = ic_data.NumberOfChecks(); |
215 } | 205 } |
216 for (intptr_t i = 0; i < num_checks_to_print; i++) { | 206 for (intptr_t i = 0; i < num_checks_to_print; i++) { |
217 GrowableArray<intptr_t> class_ids; | 207 GrowableArray<intptr_t> class_ids; |
218 ic_data.GetCheckAt(i, &class_ids, &target); | 208 ic_data.GetCheckAt(i, &class_ids, &target); |
219 const intptr_t count = ic_data.GetCountAt(i); | 209 const intptr_t count = ic_data.GetCountAt(i); |
(...skipping 1097 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1317 } | 1307 } |
1318 | 1308 |
1319 | 1309 |
1320 bool FlowGraphPrinter::ShouldPrint(const Function& function) { | 1310 bool FlowGraphPrinter::ShouldPrint(const Function& function) { |
1321 return false; | 1311 return false; |
1322 } | 1312 } |
1323 | 1313 |
1324 #endif // !PRODUCT | 1314 #endif // !PRODUCT |
1325 | 1315 |
1326 } // namespace dart | 1316 } // namespace dart |
OLD | NEW |