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_MIPS. | 5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_MIPS. |
6 #if defined(TARGET_ARCH_MIPS) | 6 #if defined(TARGET_ARCH_MIPS) |
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 2633 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2644 } else { | 2644 } else { |
2645 __ or_(TMP, left, right); | 2645 __ or_(TMP, left, right); |
2646 __ andi(CMPRES1, TMP, Immediate(kSmiTagMask)); | 2646 __ andi(CMPRES1, TMP, Immediate(kSmiTagMask)); |
2647 } | 2647 } |
2648 __ beq(CMPRES1, ZR, deopt); | 2648 __ beq(CMPRES1, ZR, deopt); |
2649 } | 2649 } |
2650 | 2650 |
2651 | 2651 |
2652 LocationSummary* BoxDoubleInstr::MakeLocationSummary() const { | 2652 LocationSummary* BoxDoubleInstr::MakeLocationSummary() const { |
2653 const intptr_t kNumInputs = 1; | 2653 const intptr_t kNumInputs = 1; |
2654 const intptr_t kNumTemps = 0; | 2654 const intptr_t kNumTemps = 1; |
2655 LocationSummary* summary = | 2655 LocationSummary* summary = |
2656 new LocationSummary(kNumInputs, | 2656 new LocationSummary(kNumInputs, |
2657 kNumTemps, | 2657 kNumTemps, |
2658 LocationSummary::kCallOnSlowPath); | 2658 LocationSummary::kCallOnSlowPath); |
2659 summary->set_in(0, Location::RequiresFpuRegister()); | 2659 summary->set_in(0, Location::RequiresFpuRegister()); |
| 2660 summary->set_temp(0, Location::RequiresRegister()); |
2660 summary->set_out(Location::RequiresRegister()); | 2661 summary->set_out(Location::RequiresRegister()); |
2661 return summary; | 2662 return summary; |
2662 } | 2663 } |
2663 | 2664 |
2664 | 2665 |
2665 class BoxDoubleSlowPath : public SlowPathCode { | 2666 class BoxDoubleSlowPath : public SlowPathCode { |
2666 public: | 2667 public: |
2667 explicit BoxDoubleSlowPath(BoxDoubleInstr* instruction) | 2668 explicit BoxDoubleSlowPath(BoxDoubleInstr* instruction) |
2668 : instruction_(instruction) { } | 2669 : instruction_(instruction) { } |
2669 | 2670 |
(...skipping 28 matching lines...) Expand all Loading... |
2698 | 2699 |
2699 void BoxDoubleInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 2700 void BoxDoubleInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
2700 BoxDoubleSlowPath* slow_path = new BoxDoubleSlowPath(this); | 2701 BoxDoubleSlowPath* slow_path = new BoxDoubleSlowPath(this); |
2701 compiler->AddSlowPathCode(slow_path); | 2702 compiler->AddSlowPathCode(slow_path); |
2702 | 2703 |
2703 Register out_reg = locs()->out().reg(); | 2704 Register out_reg = locs()->out().reg(); |
2704 DRegister value = locs()->in(0).fpu_reg(); | 2705 DRegister value = locs()->in(0).fpu_reg(); |
2705 | 2706 |
2706 __ TryAllocate(compiler->double_class(), | 2707 __ TryAllocate(compiler->double_class(), |
2707 slow_path->entry_label(), | 2708 slow_path->entry_label(), |
2708 out_reg); | 2709 out_reg, |
| 2710 locs()->temp(0).reg()); |
2709 __ Bind(slow_path->exit_label()); | 2711 __ Bind(slow_path->exit_label()); |
2710 __ StoreDToOffset(value, out_reg, Double::value_offset() - kHeapObjectTag); | 2712 __ StoreDToOffset(value, out_reg, Double::value_offset() - kHeapObjectTag); |
2711 } | 2713 } |
2712 | 2714 |
2713 | 2715 |
2714 LocationSummary* UnboxDoubleInstr::MakeLocationSummary() const { | 2716 LocationSummary* UnboxDoubleInstr::MakeLocationSummary() const { |
2715 const intptr_t kNumInputs = 1; | 2717 const intptr_t kNumInputs = 1; |
2716 const intptr_t value_cid = value()->Type()->ToCid(); | 2718 const intptr_t value_cid = value()->Type()->ToCid(); |
2717 const bool needs_writable_input = (value_cid == kSmiCid); | 2719 const bool needs_writable_input = (value_cid == kSmiCid); |
2718 const intptr_t kNumTemps = 0; | 2720 const intptr_t kNumTemps = 0; |
(...skipping 1183 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3902 compiler->GenerateCall(token_pos(), | 3904 compiler->GenerateCall(token_pos(), |
3903 &label, | 3905 &label, |
3904 PcDescriptors::kOther, | 3906 PcDescriptors::kOther, |
3905 locs()); | 3907 locs()); |
3906 __ Drop(2); // Discard type arguments and receiver. | 3908 __ Drop(2); // Discard type arguments and receiver. |
3907 } | 3909 } |
3908 | 3910 |
3909 } // namespace dart | 3911 } // namespace dart |
3910 | 3912 |
3911 #endif // defined TARGET_ARCH_MIPS | 3913 #endif // defined TARGET_ARCH_MIPS |
OLD | NEW |