Chromium Code Reviews| 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/flow_graph_optimizer.h" | 5 #include "vm/flow_graph_optimizer.h" |
| 6 | 6 |
| 7 #include "vm/flow_graph_builder.h" | 7 #include "vm/flow_graph_builder.h" |
| 8 #include "vm/il_printer.h" | 8 #include "vm/il_printer.h" |
| 9 #include "vm/object_store.h" | 9 #include "vm/object_store.h" |
| 10 | 10 |
| (...skipping 280 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 291 comp->InputAt(0), | 291 comp->InputAt(0), |
| 292 length_offset, | 292 length_offset, |
| 293 Type::ZoneHandle(Type::IntInterface())); | 293 Type::ZoneHandle(Type::IntInterface())); |
| 294 load->set_original(comp); | 294 load->set_original(comp); |
| 295 load->set_ic_data(comp->ic_data()); | 295 load->set_ic_data(comp->ic_data()); |
| 296 instr->set_computation(load); | 296 instr->set_computation(load); |
| 297 return true; | 297 return true; |
| 298 } | 298 } |
| 299 | 299 |
| 300 if (recognized_kind == MethodRecognizer::kStringBaseLength) { | 300 if (recognized_kind == MethodRecognizer::kStringBaseLength) { |
| 301 // All bets are off if we run in production mode, i.e., at one call site | |
|
regis
2012/07/23 21:38:57
"if we run in production mode"
Can you do more if
srdjan
2012/07/23 21:40:41
Changed comment: it can happen in any mode. Just s
| |
| 302 // we may have StringBase_get_length as well as ImmutableArray_get_length. | |
| 303 if (!HasOneTarget(ic_data)) { | |
| 304 return false; | |
| 305 } | |
| 301 ASSERT(HasOneTarget(ic_data)); | 306 ASSERT(HasOneTarget(ic_data)); |
| 302 LoadVMFieldComp* load = new LoadVMFieldComp( | 307 LoadVMFieldComp* load = new LoadVMFieldComp( |
| 303 comp->InputAt(0), | 308 comp->InputAt(0), |
| 304 String::length_offset(), | 309 String::length_offset(), |
| 305 Type::ZoneHandle(Type::IntInterface())); | 310 Type::ZoneHandle(Type::IntInterface())); |
| 306 load->set_original(comp); | 311 load->set_original(comp); |
| 307 load->set_ic_data(comp->ic_data()); | 312 load->set_ic_data(comp->ic_data()); |
| 308 instr->set_computation(load); | 313 instr->set_computation(load); |
| 309 return true; | 314 return true; |
| 310 } | 315 } |
| (...skipping 225 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 536 LocationSummary* locs = it.Current()->locs(); | 541 LocationSummary* locs = it.Current()->locs(); |
| 537 if ((locs != NULL) && locs->is_call()) { | 542 if ((locs != NULL) && locs->is_call()) { |
| 538 is_leaf_ = false; | 543 is_leaf_ = false; |
| 539 return; | 544 return; |
| 540 } | 545 } |
| 541 } | 546 } |
| 542 } | 547 } |
| 543 } | 548 } |
| 544 | 549 |
| 545 } // namespace dart | 550 } // namespace dart |
| OLD | NEW |