| 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/globals.h" // Needed here to get TARGET_ARCH_ARM. | 5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_ARM. |
| 6 #if defined(TARGET_ARCH_ARM) | 6 #if defined(TARGET_ARCH_ARM) |
| 7 | 7 |
| 8 #include "vm/intermediate_language.h" | 8 #include "vm/intermediate_language.h" |
| 9 | 9 |
| 10 #include "vm/dart_entry.h" | 10 #include "vm/dart_entry.h" |
| (...skipping 2539 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2550 } else { | 2550 } else { |
| 2551 __ orr(IP, left, ShifterOperand(right)); | 2551 __ orr(IP, left, ShifterOperand(right)); |
| 2552 __ tst(IP, ShifterOperand(kSmiTagMask)); | 2552 __ tst(IP, ShifterOperand(kSmiTagMask)); |
| 2553 } | 2553 } |
| 2554 __ b(deopt, EQ); | 2554 __ b(deopt, EQ); |
| 2555 } | 2555 } |
| 2556 | 2556 |
| 2557 | 2557 |
| 2558 LocationSummary* BoxDoubleInstr::MakeLocationSummary() const { | 2558 LocationSummary* BoxDoubleInstr::MakeLocationSummary() const { |
| 2559 const intptr_t kNumInputs = 1; | 2559 const intptr_t kNumInputs = 1; |
| 2560 const intptr_t kNumTemps = 0; | 2560 const intptr_t kNumTemps = 1; |
| 2561 LocationSummary* summary = | 2561 LocationSummary* summary = |
| 2562 new LocationSummary(kNumInputs, | 2562 new LocationSummary(kNumInputs, |
| 2563 kNumTemps, | 2563 kNumTemps, |
| 2564 LocationSummary::kCallOnSlowPath); | 2564 LocationSummary::kCallOnSlowPath); |
| 2565 summary->set_in(0, Location::RequiresFpuRegister()); | 2565 summary->set_in(0, Location::RequiresFpuRegister()); |
| 2566 summary->set_temp(0, Location::RequiresRegister()); |
| 2566 summary->set_out(Location::RequiresRegister()); | 2567 summary->set_out(Location::RequiresRegister()); |
| 2567 return summary; | 2568 return summary; |
| 2568 } | 2569 } |
| 2569 | 2570 |
| 2570 | 2571 |
| 2571 class BoxDoubleSlowPath : public SlowPathCode { | 2572 class BoxDoubleSlowPath : public SlowPathCode { |
| 2572 public: | 2573 public: |
| 2573 explicit BoxDoubleSlowPath(BoxDoubleInstr* instruction) | 2574 explicit BoxDoubleSlowPath(BoxDoubleInstr* instruction) |
| 2574 : instruction_(instruction) { } | 2575 : instruction_(instruction) { } |
| 2575 | 2576 |
| (...skipping 26 matching lines...) Expand all Loading... |
| 2602 | 2603 |
| 2603 void BoxDoubleInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 2604 void BoxDoubleInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
| 2604 BoxDoubleSlowPath* slow_path = new BoxDoubleSlowPath(this); | 2605 BoxDoubleSlowPath* slow_path = new BoxDoubleSlowPath(this); |
| 2605 compiler->AddSlowPathCode(slow_path); | 2606 compiler->AddSlowPathCode(slow_path); |
| 2606 | 2607 |
| 2607 const Register out_reg = locs()->out().reg(); | 2608 const Register out_reg = locs()->out().reg(); |
| 2608 const DRegister value = EvenDRegisterOf(locs()->in(0).fpu_reg()); | 2609 const DRegister value = EvenDRegisterOf(locs()->in(0).fpu_reg()); |
| 2609 | 2610 |
| 2610 __ TryAllocate(compiler->double_class(), | 2611 __ TryAllocate(compiler->double_class(), |
| 2611 slow_path->entry_label(), | 2612 slow_path->entry_label(), |
| 2612 out_reg); | 2613 out_reg, |
| 2614 locs()->temp(0).reg()); |
| 2613 __ Bind(slow_path->exit_label()); | 2615 __ Bind(slow_path->exit_label()); |
| 2614 __ StoreDToOffset(value, out_reg, Double::value_offset() - kHeapObjectTag); | 2616 __ StoreDToOffset(value, out_reg, Double::value_offset() - kHeapObjectTag); |
| 2615 } | 2617 } |
| 2616 | 2618 |
| 2617 | 2619 |
| 2618 LocationSummary* UnboxDoubleInstr::MakeLocationSummary() const { | 2620 LocationSummary* UnboxDoubleInstr::MakeLocationSummary() const { |
| 2619 const intptr_t kNumInputs = 1; | 2621 const intptr_t kNumInputs = 1; |
| 2620 const intptr_t value_cid = value()->Type()->ToCid(); | 2622 const intptr_t value_cid = value()->Type()->ToCid(); |
| 2621 const bool needs_temp = ((value_cid != kSmiCid) && (value_cid != kDoubleCid)); | 2623 const bool needs_temp = ((value_cid != kSmiCid) && (value_cid != kDoubleCid)); |
| 2622 const bool needs_writable_input = (value_cid == kSmiCid); | 2624 const bool needs_writable_input = (value_cid == kSmiCid); |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2658 __ mov(IP, ShifterOperand(value, ASR, 1)); // Copy and untag. | 2660 __ mov(IP, ShifterOperand(value, ASR, 1)); // Copy and untag. |
| 2659 __ vmovsr(STMP, IP); | 2661 __ vmovsr(STMP, IP); |
| 2660 __ vcvtdi(result, STMP); | 2662 __ vcvtdi(result, STMP); |
| 2661 __ Bind(&done); | 2663 __ Bind(&done); |
| 2662 } | 2664 } |
| 2663 } | 2665 } |
| 2664 | 2666 |
| 2665 | 2667 |
| 2666 LocationSummary* BoxFloat32x4Instr::MakeLocationSummary() const { | 2668 LocationSummary* BoxFloat32x4Instr::MakeLocationSummary() const { |
| 2667 const intptr_t kNumInputs = 1; | 2669 const intptr_t kNumInputs = 1; |
| 2668 const intptr_t kNumTemps = 0; | 2670 const intptr_t kNumTemps = 1; |
| 2669 LocationSummary* summary = | 2671 LocationSummary* summary = |
| 2670 new LocationSummary(kNumInputs, | 2672 new LocationSummary(kNumInputs, |
| 2671 kNumTemps, | 2673 kNumTemps, |
| 2672 LocationSummary::kCallOnSlowPath); | 2674 LocationSummary::kCallOnSlowPath); |
| 2673 summary->set_in(0, Location::RequiresFpuRegister()); | 2675 summary->set_in(0, Location::RequiresFpuRegister()); |
| 2676 summary->set_temp(0, Location::RequiresRegister()); |
| 2674 summary->set_out(Location::RequiresRegister()); | 2677 summary->set_out(Location::RequiresRegister()); |
| 2675 return summary; | 2678 return summary; |
| 2676 } | 2679 } |
| 2677 | 2680 |
| 2678 | 2681 |
| 2679 class BoxFloat32x4SlowPath : public SlowPathCode { | 2682 class BoxFloat32x4SlowPath : public SlowPathCode { |
| 2680 public: | 2683 public: |
| 2681 explicit BoxFloat32x4SlowPath(BoxFloat32x4Instr* instruction) | 2684 explicit BoxFloat32x4SlowPath(BoxFloat32x4Instr* instruction) |
| 2682 : instruction_(instruction) { } | 2685 : instruction_(instruction) { } |
| 2683 | 2686 |
| (...skipping 28 matching lines...) Expand all Loading... |
| 2712 BoxFloat32x4SlowPath* slow_path = new BoxFloat32x4SlowPath(this); | 2715 BoxFloat32x4SlowPath* slow_path = new BoxFloat32x4SlowPath(this); |
| 2713 compiler->AddSlowPathCode(slow_path); | 2716 compiler->AddSlowPathCode(slow_path); |
| 2714 | 2717 |
| 2715 Register out_reg = locs()->out().reg(); | 2718 Register out_reg = locs()->out().reg(); |
| 2716 QRegister value = locs()->in(0).fpu_reg(); | 2719 QRegister value = locs()->in(0).fpu_reg(); |
| 2717 DRegister value_even = EvenDRegisterOf(value); | 2720 DRegister value_even = EvenDRegisterOf(value); |
| 2718 DRegister value_odd = OddDRegisterOf(value); | 2721 DRegister value_odd = OddDRegisterOf(value); |
| 2719 | 2722 |
| 2720 __ TryAllocate(compiler->float32x4_class(), | 2723 __ TryAllocate(compiler->float32x4_class(), |
| 2721 slow_path->entry_label(), | 2724 slow_path->entry_label(), |
| 2722 out_reg); | 2725 out_reg, |
| 2726 locs()->temp(0).reg()); |
| 2723 __ Bind(slow_path->exit_label()); | 2727 __ Bind(slow_path->exit_label()); |
| 2724 | 2728 |
| 2725 __ StoreDToOffset(value_even, out_reg, | 2729 __ StoreDToOffset(value_even, out_reg, |
| 2726 Float32x4::value_offset() - kHeapObjectTag); | 2730 Float32x4::value_offset() - kHeapObjectTag); |
| 2727 __ StoreDToOffset(value_odd, out_reg, | 2731 __ StoreDToOffset(value_odd, out_reg, |
| 2728 Float32x4::value_offset() + 2*kWordSize - kHeapObjectTag); | 2732 Float32x4::value_offset() + 2*kWordSize - kHeapObjectTag); |
| 2729 } | 2733 } |
| 2730 | 2734 |
| 2731 | 2735 |
| 2732 LocationSummary* UnboxFloat32x4Instr::MakeLocationSummary() const { | 2736 LocationSummary* UnboxFloat32x4Instr::MakeLocationSummary() const { |
| (...skipping 30 matching lines...) Expand all Loading... |
| 2763 const DRegister result_odd = OddDRegisterOf(result); | 2767 const DRegister result_odd = OddDRegisterOf(result); |
| 2764 __ LoadDFromOffset(result_even, value, | 2768 __ LoadDFromOffset(result_even, value, |
| 2765 Float32x4::value_offset() - kHeapObjectTag); | 2769 Float32x4::value_offset() - kHeapObjectTag); |
| 2766 __ LoadDFromOffset(result_odd, value, | 2770 __ LoadDFromOffset(result_odd, value, |
| 2767 Float32x4::value_offset() + 2*kWordSize - kHeapObjectTag); | 2771 Float32x4::value_offset() + 2*kWordSize - kHeapObjectTag); |
| 2768 } | 2772 } |
| 2769 | 2773 |
| 2770 | 2774 |
| 2771 LocationSummary* BoxInt32x4Instr::MakeLocationSummary() const { | 2775 LocationSummary* BoxInt32x4Instr::MakeLocationSummary() const { |
| 2772 const intptr_t kNumInputs = 1; | 2776 const intptr_t kNumInputs = 1; |
| 2773 const intptr_t kNumTemps = 0; | 2777 const intptr_t kNumTemps = 1; |
| 2774 LocationSummary* summary = | 2778 LocationSummary* summary = |
| 2775 new LocationSummary(kNumInputs, | 2779 new LocationSummary(kNumInputs, |
| 2776 kNumTemps, | 2780 kNumTemps, |
| 2777 LocationSummary::kCallOnSlowPath); | 2781 LocationSummary::kCallOnSlowPath); |
| 2778 summary->set_in(0, Location::RequiresFpuRegister()); | 2782 summary->set_in(0, Location::RequiresFpuRegister()); |
| 2783 summary->set_temp(0, Location::RequiresRegister()); |
| 2779 summary->set_out(Location::RequiresRegister()); | 2784 summary->set_out(Location::RequiresRegister()); |
| 2780 return summary; | 2785 return summary; |
| 2781 } | 2786 } |
| 2782 | 2787 |
| 2783 | 2788 |
| 2784 class BoxInt32x4SlowPath : public SlowPathCode { | 2789 class BoxInt32x4SlowPath : public SlowPathCode { |
| 2785 public: | 2790 public: |
| 2786 explicit BoxInt32x4SlowPath(BoxInt32x4Instr* instruction) | 2791 explicit BoxInt32x4SlowPath(BoxInt32x4Instr* instruction) |
| 2787 : instruction_(instruction) { } | 2792 : instruction_(instruction) { } |
| 2788 | 2793 |
| (...skipping 28 matching lines...) Expand all Loading... |
| 2817 BoxInt32x4SlowPath* slow_path = new BoxInt32x4SlowPath(this); | 2822 BoxInt32x4SlowPath* slow_path = new BoxInt32x4SlowPath(this); |
| 2818 compiler->AddSlowPathCode(slow_path); | 2823 compiler->AddSlowPathCode(slow_path); |
| 2819 | 2824 |
| 2820 Register out_reg = locs()->out().reg(); | 2825 Register out_reg = locs()->out().reg(); |
| 2821 QRegister value = locs()->in(0).fpu_reg(); | 2826 QRegister value = locs()->in(0).fpu_reg(); |
| 2822 DRegister value_even = EvenDRegisterOf(value); | 2827 DRegister value_even = EvenDRegisterOf(value); |
| 2823 DRegister value_odd = OddDRegisterOf(value); | 2828 DRegister value_odd = OddDRegisterOf(value); |
| 2824 | 2829 |
| 2825 __ TryAllocate(compiler->int32x4_class(), | 2830 __ TryAllocate(compiler->int32x4_class(), |
| 2826 slow_path->entry_label(), | 2831 slow_path->entry_label(), |
| 2827 out_reg); | 2832 out_reg, |
| 2833 locs()->temp(0).reg()); |
| 2828 __ Bind(slow_path->exit_label()); | 2834 __ Bind(slow_path->exit_label()); |
| 2829 __ StoreDToOffset(value_even, out_reg, | 2835 __ StoreDToOffset(value_even, out_reg, |
| 2830 Int32x4::value_offset() - kHeapObjectTag); | 2836 Int32x4::value_offset() - kHeapObjectTag); |
| 2831 __ StoreDToOffset(value_odd, out_reg, | 2837 __ StoreDToOffset(value_odd, out_reg, |
| 2832 Int32x4::value_offset() + 2*kWordSize - kHeapObjectTag); | 2838 Int32x4::value_offset() + 2*kWordSize - kHeapObjectTag); |
| 2833 } | 2839 } |
| 2834 | 2840 |
| 2835 | 2841 |
| 2836 LocationSummary* UnboxInt32x4Instr::MakeLocationSummary() const { | 2842 LocationSummary* UnboxInt32x4Instr::MakeLocationSummary() const { |
| 2837 const intptr_t value_cid = value()->Type()->ToCid(); | 2843 const intptr_t value_cid = value()->Type()->ToCid(); |
| (...skipping 1715 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4553 compiler->GenerateCall(token_pos(), | 4559 compiler->GenerateCall(token_pos(), |
| 4554 &label, | 4560 &label, |
| 4555 PcDescriptors::kOther, | 4561 PcDescriptors::kOther, |
| 4556 locs()); | 4562 locs()); |
| 4557 __ Drop(2); // Discard type arguments and receiver. | 4563 __ Drop(2); // Discard type arguments and receiver. |
| 4558 } | 4564 } |
| 4559 | 4565 |
| 4560 } // namespace dart | 4566 } // namespace dart |
| 4561 | 4567 |
| 4562 #endif // defined TARGET_ARCH_ARM | 4568 #endif // defined TARGET_ARCH_ARM |
| OLD | NEW |