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_inliner.h" | 5 #include "vm/flow_graph_inliner.h" |
6 | 6 |
7 #include "vm/aot_optimizer.h" | 7 #include "vm/aot_optimizer.h" |
8 #include "vm/block_scheduler.h" | 8 #include "vm/block_scheduler.h" |
9 #include "vm/branch_optimizer.h" | 9 #include "vm/branch_optimizer.h" |
10 #include "vm/compiler.h" | 10 #include "vm/compiler.h" |
(...skipping 1755 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1766 push->previous()->LinkTo(push->next()); | 1766 push->previous()->LinkTo(push->next()); |
1767 cursor->LinkTo(push); | 1767 cursor->LinkTo(push); |
1768 cursor = push; | 1768 cursor = push; |
1769 } | 1769 } |
1770 const ICData& old_checks = call_->ic_data(); | 1770 const ICData& old_checks = call_->ic_data(); |
1771 const ICData& new_checks = ICData::ZoneHandle( | 1771 const ICData& new_checks = ICData::ZoneHandle( |
1772 ICData::New(Function::Handle(old_checks.Owner()), | 1772 ICData::New(Function::Handle(old_checks.Owner()), |
1773 String::Handle(old_checks.target_name()), | 1773 String::Handle(old_checks.target_name()), |
1774 Array::Handle(old_checks.arguments_descriptor()), | 1774 Array::Handle(old_checks.arguments_descriptor()), |
1775 old_checks.deopt_id(), | 1775 old_checks.deopt_id(), |
1776 1)); // Number of args tested. | 1776 1, // Number of args tested. |
| 1777 false)); // is_static_call |
1777 for (intptr_t i = 0; i < non_inlined_variants_.length(); ++i) { | 1778 for (intptr_t i = 0; i < non_inlined_variants_.length(); ++i) { |
1778 new_checks.AddReceiverCheck(non_inlined_variants_[i].cid, | 1779 new_checks.AddReceiverCheck(non_inlined_variants_[i].cid, |
1779 *non_inlined_variants_[i].target, | 1780 *non_inlined_variants_[i].target, |
1780 non_inlined_variants_[i].count); | 1781 non_inlined_variants_[i].count); |
1781 } | 1782 } |
1782 PolymorphicInstanceCallInstr* fallback_call = | 1783 PolymorphicInstanceCallInstr* fallback_call = |
1783 new PolymorphicInstanceCallInstr(call_->instance_call(), | 1784 new PolymorphicInstanceCallInstr(call_->instance_call(), |
1784 new_checks, | 1785 new_checks, |
1785 /* with_checks = */ true, | 1786 /* with_checks = */ true, |
1786 call_->complete()); | 1787 call_->complete()); |
(...skipping 857 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2644 case kTypedDataUint8ClampedArrayCid: | 2645 case kTypedDataUint8ClampedArrayCid: |
2645 case kExternalTypedDataUint8ArrayCid: | 2646 case kExternalTypedDataUint8ArrayCid: |
2646 case kExternalTypedDataUint8ClampedArrayCid: | 2647 case kExternalTypedDataUint8ClampedArrayCid: |
2647 case kTypedDataInt16ArrayCid: | 2648 case kTypedDataInt16ArrayCid: |
2648 case kTypedDataUint16ArrayCid: { | 2649 case kTypedDataUint16ArrayCid: { |
2649 // Check that value is always smi. | 2650 // Check that value is always smi. |
2650 value_check = ICData::New(flow_graph->function(), | 2651 value_check = ICData::New(flow_graph->function(), |
2651 i_call->function_name(), | 2652 i_call->function_name(), |
2652 Object::empty_array(), // Dummy args. descr. | 2653 Object::empty_array(), // Dummy args. descr. |
2653 Thread::kNoDeoptId, | 2654 Thread::kNoDeoptId, |
2654 1); | 2655 1, |
| 2656 false); |
2655 value_check.AddReceiverCheck(kSmiCid, target); | 2657 value_check.AddReceiverCheck(kSmiCid, target); |
2656 break; | 2658 break; |
2657 } | 2659 } |
2658 case kTypedDataInt32ArrayCid: | 2660 case kTypedDataInt32ArrayCid: |
2659 case kTypedDataUint32ArrayCid: | 2661 case kTypedDataUint32ArrayCid: |
2660 // On 64-bit platforms assume that stored value is always a smi. | 2662 // On 64-bit platforms assume that stored value is always a smi. |
2661 if (kSmiBits >= 32) { | 2663 if (kSmiBits >= 32) { |
2662 value_check = ICData::New(flow_graph->function(), | 2664 value_check = ICData::New(flow_graph->function(), |
2663 i_call->function_name(), | 2665 i_call->function_name(), |
2664 Object::empty_array(), // Dummy args. descr. | 2666 Object::empty_array(), // Dummy args. descr. |
2665 Thread::kNoDeoptId, | 2667 Thread::kNoDeoptId, |
2666 1); | 2668 1, |
| 2669 false); |
2667 value_check.AddReceiverCheck(kSmiCid, target); | 2670 value_check.AddReceiverCheck(kSmiCid, target); |
2668 } | 2671 } |
2669 break; | 2672 break; |
2670 case kTypedDataFloat32ArrayCid: | 2673 case kTypedDataFloat32ArrayCid: |
2671 case kTypedDataFloat64ArrayCid: { | 2674 case kTypedDataFloat64ArrayCid: { |
2672 // Check that value is always double. | 2675 // Check that value is always double. |
2673 value_check = ICData::New(flow_graph->function(), | 2676 value_check = ICData::New(flow_graph->function(), |
2674 i_call->function_name(), | 2677 i_call->function_name(), |
2675 Object::empty_array(), // Dummy args. descr. | 2678 Object::empty_array(), // Dummy args. descr. |
2676 Thread::kNoDeoptId, | 2679 Thread::kNoDeoptId, |
2677 1); | 2680 1, |
| 2681 false); |
2678 value_check.AddReceiverCheck(kDoubleCid, target); | 2682 value_check.AddReceiverCheck(kDoubleCid, target); |
2679 break; | 2683 break; |
2680 } | 2684 } |
2681 case kTypedDataInt32x4ArrayCid: { | 2685 case kTypedDataInt32x4ArrayCid: { |
2682 // Check that value is always Int32x4. | 2686 // Check that value is always Int32x4. |
2683 value_check = ICData::New(flow_graph->function(), | 2687 value_check = ICData::New(flow_graph->function(), |
2684 i_call->function_name(), | 2688 i_call->function_name(), |
2685 Object::empty_array(), // Dummy args. descr. | 2689 Object::empty_array(), // Dummy args. descr. |
2686 Thread::kNoDeoptId, | 2690 Thread::kNoDeoptId, |
2687 1); | 2691 1, |
| 2692 false); |
2688 value_check.AddReceiverCheck(kInt32x4Cid, target); | 2693 value_check.AddReceiverCheck(kInt32x4Cid, target); |
2689 break; | 2694 break; |
2690 } | 2695 } |
2691 case kTypedDataFloat32x4ArrayCid: { | 2696 case kTypedDataFloat32x4ArrayCid: { |
2692 // Check that value is always Float32x4. | 2697 // Check that value is always Float32x4. |
2693 value_check = ICData::New(flow_graph->function(), | 2698 value_check = ICData::New(flow_graph->function(), |
2694 i_call->function_name(), | 2699 i_call->function_name(), |
2695 Object::empty_array(), // Dummy args. descr. | 2700 Object::empty_array(), // Dummy args. descr. |
2696 Thread::kNoDeoptId, | 2701 Thread::kNoDeoptId, |
2697 1); | 2702 1, |
| 2703 false); |
2698 value_check.AddReceiverCheck(kFloat32x4Cid, target); | 2704 value_check.AddReceiverCheck(kFloat32x4Cid, target); |
2699 break; | 2705 break; |
2700 } | 2706 } |
2701 default: | 2707 default: |
2702 // Array cids are already checked in the caller. | 2708 // Array cids are already checked in the caller. |
2703 UNREACHABLE(); | 2709 UNREACHABLE(); |
2704 } | 2710 } |
2705 | 2711 |
2706 Definition* stored_value = call->ArgumentAt(2); | 2712 Definition* stored_value = call->ArgumentAt(2); |
2707 if (!value_check.IsNull()) { | 2713 if (!value_check.IsNull()) { |
(...skipping 419 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3127 return InlineDoubleOp(flow_graph, Token::kMUL, call, entry, last); | 3133 return InlineDoubleOp(flow_graph, Token::kMUL, call, entry, last); |
3128 case MethodRecognizer::kDoubleDiv: | 3134 case MethodRecognizer::kDoubleDiv: |
3129 return InlineDoubleOp(flow_graph, Token::kDIV, call, entry, last); | 3135 return InlineDoubleOp(flow_graph, Token::kDIV, call, entry, last); |
3130 default: | 3136 default: |
3131 return false; | 3137 return false; |
3132 } | 3138 } |
3133 } | 3139 } |
3134 | 3140 |
3135 | 3141 |
3136 } // namespace dart | 3142 } // namespace dart |
OLD | NEW |