| 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" |
| 11 | 11 |
| 12 namespace dart { | 12 namespace dart { |
| 13 | 13 |
| 14 DEFINE_FLAG(bool, print_environments, false, "Print SSA environments."); | 14 DEFINE_FLAG(bool, print_environments, false, "Print SSA environments."); |
| 15 DEFINE_FLAG(charp, print_flow_graph_filter, NULL, | 15 DEFINE_FLAG(charp, print_flow_graph_filter, NULL, |
| 16 "Print only IR of functions with matching names"); | 16 "Print only IR of functions with matching names"); |
| 17 | 17 |
| 18 DECLARE_FLAG(bool, trace_inlining_intervals); |
| 19 |
| 18 void BufferFormatter::Print(const char* format, ...) { | 20 void BufferFormatter::Print(const char* format, ...) { |
| 19 va_list args; | 21 va_list args; |
| 20 va_start(args, format); | 22 va_start(args, format); |
| 21 VPrint(format, args); | 23 VPrint(format, args); |
| 22 va_end(args); | 24 va_end(args); |
| 23 } | 25 } |
| 24 | 26 |
| 25 | 27 |
| 26 void BufferFormatter::VPrint(const char* format, va_list args) { | 28 void BufferFormatter::VPrint(const char* format, va_list args) { |
| 27 intptr_t available = size_ - position_; | 29 intptr_t available = size_ - position_; |
| (...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 129 instr->env()->PrintTo(&f); | 131 instr->env()->PrintTo(&f); |
| 130 } | 132 } |
| 131 if (print_locations && (instr->HasLocs())) { | 133 if (print_locations && (instr->HasLocs())) { |
| 132 instr->locs()->PrintTo(&f); | 134 instr->locs()->PrintTo(&f); |
| 133 } | 135 } |
| 134 if (instr->lifetime_position() != -1) { | 136 if (instr->lifetime_position() != -1) { |
| 135 ISL_Print("%3" Pd ": ", instr->lifetime_position()); | 137 ISL_Print("%3" Pd ": ", instr->lifetime_position()); |
| 136 } | 138 } |
| 137 if (!instr->IsBlockEntry()) ISL_Print(" "); | 139 if (!instr->IsBlockEntry()) ISL_Print(" "); |
| 138 ISL_Print("%s", str); | 140 ISL_Print("%s", str); |
| 141 if (FLAG_trace_inlining_intervals) { |
| 142 ISL_Print(" iid: %"Pd"", instr->inlining_id()); |
| 143 } |
| 139 } | 144 } |
| 140 | 145 |
| 141 | 146 |
| 142 void FlowGraphPrinter::PrintTypeCheck(const ParsedFunction& parsed_function, | 147 void FlowGraphPrinter::PrintTypeCheck(const ParsedFunction& parsed_function, |
| 143 intptr_t token_pos, | 148 intptr_t token_pos, |
| 144 Value* value, | 149 Value* value, |
| 145 const AbstractType& dst_type, | 150 const AbstractType& dst_type, |
| 146 const String& dst_name, | 151 const String& dst_name, |
| 147 bool eliminated) { | 152 bool eliminated) { |
| 148 const char* compile_type_name = "unknown"; | 153 const char* compile_type_name = "unknown"; |
| (...skipping 1058 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1207 } | 1212 } |
| 1208 | 1213 |
| 1209 const char* Environment::ToCString() const { | 1214 const char* Environment::ToCString() const { |
| 1210 char buffer[1024]; | 1215 char buffer[1024]; |
| 1211 BufferFormatter bf(buffer, 1024); | 1216 BufferFormatter bf(buffer, 1024); |
| 1212 PrintTo(&bf); | 1217 PrintTo(&bf); |
| 1213 return Thread::Current()->zone()->MakeCopyOfString(buffer); | 1218 return Thread::Current()->zone()->MakeCopyOfString(buffer); |
| 1214 } | 1219 } |
| 1215 | 1220 |
| 1216 } // namespace dart | 1221 } // namespace dart |
| OLD | NEW |