| 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/flow_graph_optimizer.h" | 5 #include "vm/flow_graph_optimizer.h" |
| 6 | 6 |
| 7 #include "vm/bit_vector.h" | 7 #include "vm/bit_vector.h" |
| 8 #include "vm/cha.h" | 8 #include "vm/cha.h" |
| 9 #include "vm/flow_graph_builder.h" | 9 #include "vm/flow_graph_builder.h" |
| 10 #include "vm/flow_graph_compiler.h" | 10 #include "vm/flow_graph_compiler.h" |
| (...skipping 2454 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2465 call->deopt_id()); | 2465 call->deopt_id()); |
| 2466 ReplaceCall(call, con); | 2466 ReplaceCall(call, con); |
| 2467 } else if (recognized_kind == MethodRecognizer::kUint32x4BoolConstructor) { | 2467 } else if (recognized_kind == MethodRecognizer::kUint32x4BoolConstructor) { |
| 2468 Uint32x4BoolConstructorInstr* con = new Uint32x4BoolConstructorInstr( | 2468 Uint32x4BoolConstructorInstr* con = new Uint32x4BoolConstructorInstr( |
| 2469 new Value(call->ArgumentAt(1)), | 2469 new Value(call->ArgumentAt(1)), |
| 2470 new Value(call->ArgumentAt(2)), | 2470 new Value(call->ArgumentAt(2)), |
| 2471 new Value(call->ArgumentAt(3)), | 2471 new Value(call->ArgumentAt(3)), |
| 2472 new Value(call->ArgumentAt(4)), | 2472 new Value(call->ArgumentAt(4)), |
| 2473 call->deopt_id()); | 2473 call->deopt_id()); |
| 2474 ReplaceCall(call, con); | 2474 ReplaceCall(call, con); |
| 2475 } else if (recognized_kind == MethodRecognizer::kObjectConstructor) { |
| 2476 // Remove the original push arguments. |
| 2477 for (intptr_t i = 0; i < call->ArgumentCount(); ++i) { |
| 2478 PushArgumentInstr* push = call->PushArgumentAt(i); |
| 2479 push->ReplaceUsesWith(push->value()->definition()); |
| 2480 push->RemoveFromGraph(); |
| 2481 } |
| 2482 // Manually replace call with global null constant. ReplaceCall can't |
| 2483 // be used for definitions that are already in the graph. |
| 2484 call->ReplaceUsesWith(flow_graph_->constant_null()); |
| 2485 ASSERT(current_iterator()->Current() == call); |
| 2486 current_iterator()->RemoveCurrentFromGraph();; |
| 2475 } | 2487 } |
| 2476 } | 2488 } |
| 2477 | 2489 |
| 2478 | 2490 |
| 2479 bool FlowGraphOptimizer::TryInlineInstanceSetter(InstanceCallInstr* instr, | 2491 bool FlowGraphOptimizer::TryInlineInstanceSetter(InstanceCallInstr* instr, |
| 2480 const ICData& unary_ic_data) { | 2492 const ICData& unary_ic_data) { |
| 2481 ASSERT((unary_ic_data.NumberOfChecks() > 0) && | 2493 ASSERT((unary_ic_data.NumberOfChecks() > 0) && |
| 2482 (unary_ic_data.num_args_tested() == 1)); | 2494 (unary_ic_data.num_args_tested() == 1)); |
| 2483 if (FLAG_enable_type_checks) { | 2495 if (FLAG_enable_type_checks) { |
| 2484 // TODO(srdjan): Add assignable check node if --enable_type_checks. | 2496 // TODO(srdjan): Add assignable check node if --enable_type_checks. |
| (...skipping 4099 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6584 | 6596 |
| 6585 // Insert materializations at environment uses. | 6597 // Insert materializations at environment uses. |
| 6586 const Class& cls = Class::Handle(alloc->constructor().Owner()); | 6598 const Class& cls = Class::Handle(alloc->constructor().Owner()); |
| 6587 for (intptr_t i = 0; i < exits.length(); i++) { | 6599 for (intptr_t i = 0; i < exits.length(); i++) { |
| 6588 CreateMaterializationAt(exits[i], alloc, cls, *fields); | 6600 CreateMaterializationAt(exits[i], alloc, cls, *fields); |
| 6589 } | 6601 } |
| 6590 } | 6602 } |
| 6591 | 6603 |
| 6592 | 6604 |
| 6593 } // namespace dart | 6605 } // namespace dart |
| OLD | NEW |