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 2522 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2533 } else { | 2533 } else { |
2534 __ orr(IP, left, ShifterOperand(right)); | 2534 __ orr(IP, left, ShifterOperand(right)); |
2535 __ tst(IP, ShifterOperand(kSmiTagMask)); | 2535 __ tst(IP, ShifterOperand(kSmiTagMask)); |
2536 } | 2536 } |
2537 __ b(deopt, EQ); | 2537 __ b(deopt, EQ); |
2538 } | 2538 } |
2539 | 2539 |
2540 | 2540 |
2541 LocationSummary* BoxDoubleInstr::MakeLocationSummary() const { | 2541 LocationSummary* BoxDoubleInstr::MakeLocationSummary() const { |
2542 const intptr_t kNumInputs = 1; | 2542 const intptr_t kNumInputs = 1; |
2543 const intptr_t kNumTemps = 0; | 2543 const intptr_t kNumTemps = 1; |
2544 LocationSummary* summary = | 2544 LocationSummary* summary = |
2545 new LocationSummary(kNumInputs, | 2545 new LocationSummary(kNumInputs, |
2546 kNumTemps, | 2546 kNumTemps, |
2547 LocationSummary::kCallOnSlowPath); | 2547 LocationSummary::kCallOnSlowPath); |
2548 summary->set_in(0, Location::RequiresFpuRegister()); | 2548 summary->set_in(0, Location::RequiresFpuRegister()); |
| 2549 summary->set_temp(0, Location::RequiresRegister()); |
2549 summary->set_out(Location::RequiresRegister()); | 2550 summary->set_out(Location::RequiresRegister()); |
2550 return summary; | 2551 return summary; |
2551 } | 2552 } |
2552 | 2553 |
2553 | 2554 |
2554 class BoxDoubleSlowPath : public SlowPathCode { | 2555 class BoxDoubleSlowPath : public SlowPathCode { |
2555 public: | 2556 public: |
2556 explicit BoxDoubleSlowPath(BoxDoubleInstr* instruction) | 2557 explicit BoxDoubleSlowPath(BoxDoubleInstr* instruction) |
2557 : instruction_(instruction) { } | 2558 : instruction_(instruction) { } |
2558 | 2559 |
(...skipping 26 matching lines...) Expand all Loading... |
2585 | 2586 |
2586 void BoxDoubleInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 2587 void BoxDoubleInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
2587 BoxDoubleSlowPath* slow_path = new BoxDoubleSlowPath(this); | 2588 BoxDoubleSlowPath* slow_path = new BoxDoubleSlowPath(this); |
2588 compiler->AddSlowPathCode(slow_path); | 2589 compiler->AddSlowPathCode(slow_path); |
2589 | 2590 |
2590 const Register out_reg = locs()->out().reg(); | 2591 const Register out_reg = locs()->out().reg(); |
2591 const DRegister value = EvenDRegisterOf(locs()->in(0).fpu_reg()); | 2592 const DRegister value = EvenDRegisterOf(locs()->in(0).fpu_reg()); |
2592 | 2593 |
2593 __ TryAllocate(compiler->double_class(), | 2594 __ TryAllocate(compiler->double_class(), |
2594 slow_path->entry_label(), | 2595 slow_path->entry_label(), |
2595 out_reg); | 2596 out_reg, |
| 2597 locs()->temp(0).reg()); |
2596 __ Bind(slow_path->exit_label()); | 2598 __ Bind(slow_path->exit_label()); |
2597 __ StoreDToOffset(value, out_reg, Double::value_offset() - kHeapObjectTag); | 2599 __ StoreDToOffset(value, out_reg, Double::value_offset() - kHeapObjectTag); |
2598 } | 2600 } |
2599 | 2601 |
2600 | 2602 |
2601 LocationSummary* UnboxDoubleInstr::MakeLocationSummary() const { | 2603 LocationSummary* UnboxDoubleInstr::MakeLocationSummary() const { |
2602 const intptr_t kNumInputs = 1; | 2604 const intptr_t kNumInputs = 1; |
2603 const intptr_t value_cid = value()->Type()->ToCid(); | 2605 const intptr_t value_cid = value()->Type()->ToCid(); |
2604 const bool needs_temp = ((value_cid != kSmiCid) && (value_cid != kDoubleCid)); | 2606 const bool needs_temp = ((value_cid != kSmiCid) && (value_cid != kDoubleCid)); |
2605 const bool needs_writable_input = (value_cid == kSmiCid); | 2607 const bool needs_writable_input = (value_cid == kSmiCid); |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2641 __ mov(IP, ShifterOperand(value, ASR, 1)); // Copy and untag. | 2643 __ mov(IP, ShifterOperand(value, ASR, 1)); // Copy and untag. |
2642 __ vmovsr(STMP, IP); | 2644 __ vmovsr(STMP, IP); |
2643 __ vcvtdi(result, STMP); | 2645 __ vcvtdi(result, STMP); |
2644 __ Bind(&done); | 2646 __ Bind(&done); |
2645 } | 2647 } |
2646 } | 2648 } |
2647 | 2649 |
2648 | 2650 |
2649 LocationSummary* BoxFloat32x4Instr::MakeLocationSummary() const { | 2651 LocationSummary* BoxFloat32x4Instr::MakeLocationSummary() const { |
2650 const intptr_t kNumInputs = 1; | 2652 const intptr_t kNumInputs = 1; |
2651 const intptr_t kNumTemps = 0; | 2653 const intptr_t kNumTemps = 1; |
2652 LocationSummary* summary = | 2654 LocationSummary* summary = |
2653 new LocationSummary(kNumInputs, | 2655 new LocationSummary(kNumInputs, |
2654 kNumTemps, | 2656 kNumTemps, |
2655 LocationSummary::kCallOnSlowPath); | 2657 LocationSummary::kCallOnSlowPath); |
2656 summary->set_in(0, Location::RequiresFpuRegister()); | 2658 summary->set_in(0, Location::RequiresFpuRegister()); |
| 2659 summary->set_temp(0, Location::RequiresRegister()); |
2657 summary->set_out(Location::RequiresRegister()); | 2660 summary->set_out(Location::RequiresRegister()); |
2658 return summary; | 2661 return summary; |
2659 } | 2662 } |
2660 | 2663 |
2661 | 2664 |
2662 class BoxFloat32x4SlowPath : public SlowPathCode { | 2665 class BoxFloat32x4SlowPath : public SlowPathCode { |
2663 public: | 2666 public: |
2664 explicit BoxFloat32x4SlowPath(BoxFloat32x4Instr* instruction) | 2667 explicit BoxFloat32x4SlowPath(BoxFloat32x4Instr* instruction) |
2665 : instruction_(instruction) { } | 2668 : instruction_(instruction) { } |
2666 | 2669 |
(...skipping 28 matching lines...) Expand all Loading... |
2695 BoxFloat32x4SlowPath* slow_path = new BoxFloat32x4SlowPath(this); | 2698 BoxFloat32x4SlowPath* slow_path = new BoxFloat32x4SlowPath(this); |
2696 compiler->AddSlowPathCode(slow_path); | 2699 compiler->AddSlowPathCode(slow_path); |
2697 | 2700 |
2698 Register out_reg = locs()->out().reg(); | 2701 Register out_reg = locs()->out().reg(); |
2699 QRegister value = locs()->in(0).fpu_reg(); | 2702 QRegister value = locs()->in(0).fpu_reg(); |
2700 DRegister value_even = EvenDRegisterOf(value); | 2703 DRegister value_even = EvenDRegisterOf(value); |
2701 DRegister value_odd = OddDRegisterOf(value); | 2704 DRegister value_odd = OddDRegisterOf(value); |
2702 | 2705 |
2703 __ TryAllocate(compiler->float32x4_class(), | 2706 __ TryAllocate(compiler->float32x4_class(), |
2704 slow_path->entry_label(), | 2707 slow_path->entry_label(), |
2705 out_reg); | 2708 out_reg, |
| 2709 locs()->temp(0).reg()); |
2706 __ Bind(slow_path->exit_label()); | 2710 __ Bind(slow_path->exit_label()); |
2707 | 2711 |
2708 __ StoreDToOffset(value_even, out_reg, | 2712 __ StoreDToOffset(value_even, out_reg, |
2709 Float32x4::value_offset() - kHeapObjectTag); | 2713 Float32x4::value_offset() - kHeapObjectTag); |
2710 __ StoreDToOffset(value_odd, out_reg, | 2714 __ StoreDToOffset(value_odd, out_reg, |
2711 Float32x4::value_offset() + 2*kWordSize - kHeapObjectTag); | 2715 Float32x4::value_offset() + 2*kWordSize - kHeapObjectTag); |
2712 } | 2716 } |
2713 | 2717 |
2714 | 2718 |
2715 LocationSummary* UnboxFloat32x4Instr::MakeLocationSummary() const { | 2719 LocationSummary* UnboxFloat32x4Instr::MakeLocationSummary() const { |
(...skipping 30 matching lines...) Expand all Loading... |
2746 const DRegister result_odd = OddDRegisterOf(result); | 2750 const DRegister result_odd = OddDRegisterOf(result); |
2747 __ LoadDFromOffset(result_even, value, | 2751 __ LoadDFromOffset(result_even, value, |
2748 Float32x4::value_offset() - kHeapObjectTag); | 2752 Float32x4::value_offset() - kHeapObjectTag); |
2749 __ LoadDFromOffset(result_odd, value, | 2753 __ LoadDFromOffset(result_odd, value, |
2750 Float32x4::value_offset() + 2*kWordSize - kHeapObjectTag); | 2754 Float32x4::value_offset() + 2*kWordSize - kHeapObjectTag); |
2751 } | 2755 } |
2752 | 2756 |
2753 | 2757 |
2754 LocationSummary* BoxInt32x4Instr::MakeLocationSummary() const { | 2758 LocationSummary* BoxInt32x4Instr::MakeLocationSummary() const { |
2755 const intptr_t kNumInputs = 1; | 2759 const intptr_t kNumInputs = 1; |
2756 const intptr_t kNumTemps = 0; | 2760 const intptr_t kNumTemps = 1; |
2757 LocationSummary* summary = | 2761 LocationSummary* summary = |
2758 new LocationSummary(kNumInputs, | 2762 new LocationSummary(kNumInputs, |
2759 kNumTemps, | 2763 kNumTemps, |
2760 LocationSummary::kCallOnSlowPath); | 2764 LocationSummary::kCallOnSlowPath); |
2761 summary->set_in(0, Location::RequiresFpuRegister()); | 2765 summary->set_in(0, Location::RequiresFpuRegister()); |
| 2766 summary->set_temp(0, Location::RequiresRegister()); |
2762 summary->set_out(Location::RequiresRegister()); | 2767 summary->set_out(Location::RequiresRegister()); |
2763 return summary; | 2768 return summary; |
2764 } | 2769 } |
2765 | 2770 |
2766 | 2771 |
2767 class BoxInt32x4SlowPath : public SlowPathCode { | 2772 class BoxInt32x4SlowPath : public SlowPathCode { |
2768 public: | 2773 public: |
2769 explicit BoxInt32x4SlowPath(BoxInt32x4Instr* instruction) | 2774 explicit BoxInt32x4SlowPath(BoxInt32x4Instr* instruction) |
2770 : instruction_(instruction) { } | 2775 : instruction_(instruction) { } |
2771 | 2776 |
(...skipping 28 matching lines...) Expand all Loading... |
2800 BoxInt32x4SlowPath* slow_path = new BoxInt32x4SlowPath(this); | 2805 BoxInt32x4SlowPath* slow_path = new BoxInt32x4SlowPath(this); |
2801 compiler->AddSlowPathCode(slow_path); | 2806 compiler->AddSlowPathCode(slow_path); |
2802 | 2807 |
2803 Register out_reg = locs()->out().reg(); | 2808 Register out_reg = locs()->out().reg(); |
2804 QRegister value = locs()->in(0).fpu_reg(); | 2809 QRegister value = locs()->in(0).fpu_reg(); |
2805 DRegister value_even = EvenDRegisterOf(value); | 2810 DRegister value_even = EvenDRegisterOf(value); |
2806 DRegister value_odd = OddDRegisterOf(value); | 2811 DRegister value_odd = OddDRegisterOf(value); |
2807 | 2812 |
2808 __ TryAllocate(compiler->int32x4_class(), | 2813 __ TryAllocate(compiler->int32x4_class(), |
2809 slow_path->entry_label(), | 2814 slow_path->entry_label(), |
2810 out_reg); | 2815 out_reg, |
| 2816 locs()->temp(0).reg()); |
2811 __ Bind(slow_path->exit_label()); | 2817 __ Bind(slow_path->exit_label()); |
2812 __ StoreDToOffset(value_even, out_reg, | 2818 __ StoreDToOffset(value_even, out_reg, |
2813 Int32x4::value_offset() - kHeapObjectTag); | 2819 Int32x4::value_offset() - kHeapObjectTag); |
2814 __ StoreDToOffset(value_odd, out_reg, | 2820 __ StoreDToOffset(value_odd, out_reg, |
2815 Int32x4::value_offset() + 2*kWordSize - kHeapObjectTag); | 2821 Int32x4::value_offset() + 2*kWordSize - kHeapObjectTag); |
2816 } | 2822 } |
2817 | 2823 |
2818 | 2824 |
2819 LocationSummary* UnboxInt32x4Instr::MakeLocationSummary() const { | 2825 LocationSummary* UnboxInt32x4Instr::MakeLocationSummary() const { |
2820 const intptr_t value_cid = value()->Type()->ToCid(); | 2826 const intptr_t value_cid = value()->Type()->ToCid(); |
(...skipping 1801 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4622 compiler->GenerateCall(token_pos(), | 4628 compiler->GenerateCall(token_pos(), |
4623 &label, | 4629 &label, |
4624 PcDescriptors::kOther, | 4630 PcDescriptors::kOther, |
4625 locs()); | 4631 locs()); |
4626 __ Drop(2); // Discard type arguments and receiver. | 4632 __ Drop(2); // Discard type arguments and receiver. |
4627 } | 4633 } |
4628 | 4634 |
4629 } // namespace dart | 4635 } // namespace dart |
4630 | 4636 |
4631 #endif // defined TARGET_ARCH_ARM | 4637 #endif // defined TARGET_ARCH_ARM |
OLD | NEW |