OLD | NEW |
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, 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/locations.h" | 5 #include "vm/locations.h" |
6 | 6 |
7 #include "vm/assembler.h" | 7 #include "vm/assembler.h" |
8 #include "vm/il_printer.h" | 8 #include "vm/il_printer.h" |
9 #include "vm/intermediate_language.h" | 9 #include "vm/intermediate_language.h" |
10 #include "vm/flow_graph_compiler.h" | 10 #include "vm/flow_graph_compiler.h" |
(...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
209 } else if (kind() == kDoubleStackSlot) { | 209 } else if (kind() == kDoubleStackSlot) { |
210 f->Print("DS%+" Pd "", stack_index()); | 210 f->Print("DS%+" Pd "", stack_index()); |
211 } else if (kind() == kQuadStackSlot) { | 211 } else if (kind() == kQuadStackSlot) { |
212 f->Print("QS%+" Pd "", stack_index()); | 212 f->Print("QS%+" Pd "", stack_index()); |
213 } else { | 213 } else { |
214 f->Print("%s", Name()); | 214 f->Print("%s", Name()); |
215 } | 215 } |
216 } | 216 } |
217 | 217 |
218 | 218 |
| 219 const char* Location::ToCString() const { |
| 220 char buffer[1024]; |
| 221 BufferFormatter bf(buffer, 1024); |
| 222 PrintTo(&bf); |
| 223 return Isolate::Current()->current_zone()->MakeCopyOfString(buffer); |
| 224 } |
| 225 |
| 226 |
219 void Location::Print() const { | 227 void Location::Print() const { |
220 if (kind() == kStackSlot) { | 228 if (kind() == kStackSlot) { |
221 OS::Print("S%+" Pd "", stack_index()); | 229 OS::Print("S%+" Pd "", stack_index()); |
222 } else { | 230 } else { |
223 OS::Print("%s", Name()); | 231 OS::Print("%s", Name()); |
224 } | 232 } |
225 } | 233 } |
226 | 234 |
227 | 235 |
228 void LocationSummary::PrintTo(BufferFormatter* f) const { | 236 void LocationSummary::PrintTo(BufferFormatter* f) const { |
(...skipping 17 matching lines...) Expand all Loading... |
246 | 254 |
247 if (!out(0).IsInvalid()) { | 255 if (!out(0).IsInvalid()) { |
248 f->Print(" => "); | 256 f->Print(" => "); |
249 out(0).PrintTo(f); | 257 out(0).PrintTo(f); |
250 } | 258 } |
251 | 259 |
252 if (always_calls()) f->Print(" C"); | 260 if (always_calls()) f->Print(" C"); |
253 } | 261 } |
254 | 262 |
255 } // namespace dart | 263 } // namespace dart |
OLD | NEW |