OLD | NEW |
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, 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_ARM64. | 5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_ARM64. |
6 #if defined(TARGET_ARCH_ARM64) | 6 #if defined(TARGET_ARCH_ARM64) |
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 796 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
807 // stub generates the redirection address when running under the simulator | 807 // stub generates the redirection address when running under the simulator |
808 // and hence we do not change 'entry' here. | 808 // and hence we do not change 'entry' here. |
809 stub_entry = StubCode::CallNativeCFunction_entry(); | 809 stub_entry = StubCode::CallNativeCFunction_entry(); |
810 #if defined(USING_SIMULATOR) | 810 #if defined(USING_SIMULATOR) |
811 if (!function().IsNativeAutoSetupScope()) { | 811 if (!function().IsNativeAutoSetupScope()) { |
812 entry = Simulator::RedirectExternalReference( | 812 entry = Simulator::RedirectExternalReference( |
813 entry, Simulator::kBootstrapNativeCall, function().NumParameters()); | 813 entry, Simulator::kBootstrapNativeCall, function().NumParameters()); |
814 } | 814 } |
815 #endif | 815 #endif |
816 } | 816 } |
817 __ LoadImmediate(R5, entry); | 817 ExternalLabel label(entry); |
| 818 __ LoadExternalLabel(R5, &label); |
818 __ LoadImmediate(R1, argc_tag); | 819 __ LoadImmediate(R1, argc_tag); |
819 compiler->GenerateCall(token_pos(), | 820 compiler->GenerateCall(token_pos(), |
820 *stub_entry, | 821 *stub_entry, |
821 RawPcDescriptors::kOther, | 822 RawPcDescriptors::kOther, |
822 locs()); | 823 locs()); |
823 __ Pop(result); | 824 __ Pop(result); |
824 } | 825 } |
825 | 826 |
826 | 827 |
827 LocationSummary* StringFromCharCodeInstr::MakeLocationSummary(Zone* zone, | 828 LocationSummary* StringFromCharCodeInstr::MakeLocationSummary(Zone* zone, |
828 bool opt) const { | 829 bool opt) const { |
829 const intptr_t kNumInputs = 1; | 830 const intptr_t kNumInputs = 1; |
830 // TODO(fschneider): Allow immediate operands for the char code. | 831 // TODO(fschneider): Allow immediate operands for the char code. |
831 return LocationSummary::Make(zone, | 832 return LocationSummary::Make(zone, |
832 kNumInputs, | 833 kNumInputs, |
833 Location::RequiresRegister(), | 834 Location::RequiresRegister(), |
834 LocationSummary::kNoCall); | 835 LocationSummary::kNoCall); |
835 } | 836 } |
836 | 837 |
837 | 838 |
838 void StringFromCharCodeInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 839 void StringFromCharCodeInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
839 ASSERT(compiler->is_optimizing()); | 840 ASSERT(compiler->is_optimizing()); |
840 const Register char_code = locs()->in(0).reg(); | 841 const Register char_code = locs()->in(0).reg(); |
841 const Register result = locs()->out(0).reg(); | 842 const Register result = locs()->out(0).reg(); |
842 __ LoadImmediate( | 843 |
843 result, reinterpret_cast<uword>(Symbols::PredefinedAddress())); | 844 ExternalLabel label(reinterpret_cast<uword>(Symbols::PredefinedAddress())); |
| 845 __ LoadExternalLabel(result, &label); |
844 __ AddImmediate( | 846 __ AddImmediate( |
845 result, result, Symbols::kNullCharCodeSymbolOffset * kWordSize); | 847 result, result, Symbols::kNullCharCodeSymbolOffset * kWordSize); |
846 __ SmiUntag(TMP, char_code); // Untag to use scaled adress mode. | 848 __ SmiUntag(TMP, char_code); // Untag to use scaled adress mode. |
847 __ ldr(result, Address(result, TMP, UXTX, Address::Scaled)); | 849 __ ldr(result, Address(result, TMP, UXTX, Address::Scaled)); |
848 } | 850 } |
849 | 851 |
850 | 852 |
851 LocationSummary* StringToCharCodeInstr::MakeLocationSummary(Zone* zone, | 853 LocationSummary* StringToCharCodeInstr::MakeLocationSummary(Zone* zone, |
852 bool opt) const { | 854 bool opt) const { |
853 const intptr_t kNumInputs = 1; | 855 const intptr_t kNumInputs = 1; |
(...skipping 4755 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5609 1, | 5611 1, |
5610 locs()); | 5612 locs()); |
5611 __ Drop(1); | 5613 __ Drop(1); |
5612 __ Pop(result); | 5614 __ Pop(result); |
5613 } | 5615 } |
5614 | 5616 |
5615 | 5617 |
5616 } // namespace dart | 5618 } // namespace dart |
5617 | 5619 |
5618 #endif // defined TARGET_ARCH_ARM64 | 5620 #endif // defined TARGET_ARCH_ARM64 |
OLD | NEW |