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 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
92 ASSERT(fp_sp_dist <= 0); | 92 ASSERT(fp_sp_dist <= 0); |
93 __ sub(R2, SP, ShifterOperand(FP)); | 93 __ sub(R2, SP, ShifterOperand(FP)); |
94 __ CompareImmediate(R2, fp_sp_dist); | 94 __ CompareImmediate(R2, fp_sp_dist); |
95 __ b(&stack_ok, EQ); | 95 __ b(&stack_ok, EQ); |
96 __ bkpt(0); | 96 __ bkpt(0); |
97 __ Bind(&stack_ok); | 97 __ Bind(&stack_ok); |
98 } | 98 } |
99 #endif | 99 #endif |
100 __ LeaveDartFrame(); | 100 __ LeaveDartFrame(); |
101 __ Ret(); | 101 __ Ret(); |
102 | |
103 // No need to generate NOP instructions so that the debugger can patch the | |
104 // return pattern (3 instructions) with a call to the debug stub (also 3 | |
105 // instructions). | |
106 compiler->AddCurrentDescriptor(PcDescriptors::kReturn, | |
107 Isolate::kNoDeoptId, | |
108 token_pos()); | |
109 } | 102 } |
110 | 103 |
111 | 104 |
112 static Condition NegateCondition(Condition condition) { | 105 static Condition NegateCondition(Condition condition) { |
113 switch (condition) { | 106 switch (condition) { |
114 case EQ: return NE; | 107 case EQ: return NE; |
115 case NE: return EQ; | 108 case NE: return EQ; |
116 case LT: return GE; | 109 case LT: return GE; |
117 case LE: return GT; | 110 case LE: return GT; |
118 case GT: return LE; | 111 case GT: return LE; |
(...skipping 619 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
738 void StringFromCharCodeInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 731 void StringFromCharCodeInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
739 Register char_code = locs()->in(0).reg(); | 732 Register char_code = locs()->in(0).reg(); |
740 Register result = locs()->out().reg(); | 733 Register result = locs()->out().reg(); |
741 __ LoadImmediate(result, | 734 __ LoadImmediate(result, |
742 reinterpret_cast<uword>(Symbols::PredefinedAddress())); | 735 reinterpret_cast<uword>(Symbols::PredefinedAddress())); |
743 __ AddImmediate(result, Symbols::kNullCharCodeSymbolOffset * kWordSize); | 736 __ AddImmediate(result, Symbols::kNullCharCodeSymbolOffset * kWordSize); |
744 __ ldr(result, Address(result, char_code, LSL, 1)); // Char code is a smi. | 737 __ ldr(result, Address(result, char_code, LSL, 1)); // Char code is a smi. |
745 } | 738 } |
746 | 739 |
747 | 740 |
| 741 LocationSummary* StringToCharCodeInstr::MakeLocationSummary(bool opt) const { |
| 742 const intptr_t kNumInputs = 1; |
| 743 return LocationSummary::Make(kNumInputs, |
| 744 Location::RequiresRegister(), |
| 745 LocationSummary::kNoCall); |
| 746 } |
| 747 |
| 748 |
| 749 void StringToCharCodeInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
| 750 ASSERT(cid_ == kOneByteStringCid); |
| 751 Register str = locs()->in(0).reg(); |
| 752 Register result = locs()->out().reg(); |
| 753 __ ldr(result, FieldAddress(str, String::length_offset())); |
| 754 __ cmp(result, ShifterOperand(Smi::RawValue(1))); |
| 755 __ LoadImmediate(result, Smi::RawValue(-1), NE); |
| 756 __ ldrb(result, FieldAddress(str, OneByteString::data_offset()), EQ); |
| 757 __ SmiTag(result); |
| 758 } |
| 759 |
| 760 |
748 LocationSummary* StringInterpolateInstr::MakeLocationSummary(bool opt) const { | 761 LocationSummary* StringInterpolateInstr::MakeLocationSummary(bool opt) const { |
749 const intptr_t kNumInputs = 1; | 762 const intptr_t kNumInputs = 1; |
750 const intptr_t kNumTemps = 0; | 763 const intptr_t kNumTemps = 0; |
751 LocationSummary* summary = | 764 LocationSummary* summary = |
752 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kCall); | 765 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kCall); |
753 summary->set_in(0, Location::RegisterLocation(R0)); | 766 summary->set_in(0, Location::RegisterLocation(R0)); |
754 summary->set_out(Location::RegisterLocation(R0)); | 767 summary->set_out(Location::RegisterLocation(R0)); |
755 return summary; | 768 return summary; |
756 } | 769 } |
757 | 770 |
(...skipping 4068 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4826 compiler->GenerateCall(token_pos(), | 4839 compiler->GenerateCall(token_pos(), |
4827 &label, | 4840 &label, |
4828 PcDescriptors::kOther, | 4841 PcDescriptors::kOther, |
4829 locs()); | 4842 locs()); |
4830 __ Drop(2); // Discard type arguments and receiver. | 4843 __ Drop(2); // Discard type arguments and receiver. |
4831 } | 4844 } |
4832 | 4845 |
4833 } // namespace dart | 4846 } // namespace dart |
4834 | 4847 |
4835 #endif // defined TARGET_ARCH_ARM | 4848 #endif // defined TARGET_ARCH_ARM |
OLD | NEW |