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/cpu.h" | 10 #include "vm/cpu.h" |
(...skipping 943 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
954 // stub generates the redirection address when running under the simulator | 954 // stub generates the redirection address when running under the simulator |
955 // and hence we do not change 'entry' here. | 955 // and hence we do not change 'entry' here. |
956 stub_entry = StubCode::CallNativeCFunction_entry(); | 956 stub_entry = StubCode::CallNativeCFunction_entry(); |
957 #if defined(USING_SIMULATOR) | 957 #if defined(USING_SIMULATOR) |
958 if (!function().IsNativeAutoSetupScope()) { | 958 if (!function().IsNativeAutoSetupScope()) { |
959 entry = Simulator::RedirectExternalReference( | 959 entry = Simulator::RedirectExternalReference( |
960 entry, Simulator::kBootstrapNativeCall, function().NumParameters()); | 960 entry, Simulator::kBootstrapNativeCall, function().NumParameters()); |
961 } | 961 } |
962 #endif | 962 #endif |
963 } | 963 } |
964 __ LoadImmediate(R5, entry); | 964 ExternalLabel label(entry); |
| 965 __ LoadExternalLabel(R5, &label, kNotPatchable); |
965 __ LoadImmediate(R1, argc_tag); | 966 __ LoadImmediate(R1, argc_tag); |
966 compiler->GenerateCall(token_pos(), | 967 compiler->GenerateCall(token_pos(), |
967 *stub_entry, | 968 *stub_entry, |
968 RawPcDescriptors::kOther, | 969 RawPcDescriptors::kOther, |
969 locs()); | 970 locs()); |
970 __ Pop(result); | 971 __ Pop(result); |
971 } | 972 } |
972 | 973 |
973 | 974 |
974 LocationSummary* StringFromCharCodeInstr::MakeLocationSummary(Zone* zone, | 975 LocationSummary* StringFromCharCodeInstr::MakeLocationSummary(Zone* zone, |
975 bool opt) const { | 976 bool opt) const { |
976 const intptr_t kNumInputs = 1; | 977 const intptr_t kNumInputs = 1; |
977 // TODO(fschneider): Allow immediate operands for the char code. | 978 // TODO(fschneider): Allow immediate operands for the char code. |
978 return LocationSummary::Make(zone, | 979 return LocationSummary::Make(zone, |
979 kNumInputs, | 980 kNumInputs, |
980 Location::RequiresRegister(), | 981 Location::RequiresRegister(), |
981 LocationSummary::kNoCall); | 982 LocationSummary::kNoCall); |
982 } | 983 } |
983 | 984 |
984 | 985 |
985 void StringFromCharCodeInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 986 void StringFromCharCodeInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
986 ASSERT(compiler->is_optimizing()); | 987 ASSERT(compiler->is_optimizing()); |
987 const Register char_code = locs()->in(0).reg(); | 988 const Register char_code = locs()->in(0).reg(); |
988 const Register result = locs()->out(0).reg(); | 989 const Register result = locs()->out(0).reg(); |
989 __ LoadImmediate(result, | 990 |
990 reinterpret_cast<uword>(Symbols::PredefinedAddress())); | 991 ExternalLabel label(reinterpret_cast<uword>(Symbols::PredefinedAddress())); |
| 992 __ LoadExternalLabel(result, &label, kNotPatchable); |
991 __ AddImmediate(result, Symbols::kNullCharCodeSymbolOffset * kWordSize); | 993 __ AddImmediate(result, Symbols::kNullCharCodeSymbolOffset * kWordSize); |
992 __ ldr(result, Address(result, char_code, LSL, 1)); // Char code is a smi. | 994 __ ldr(result, Address(result, char_code, LSL, 1)); // Char code is a smi. |
993 } | 995 } |
994 | 996 |
995 | 997 |
996 LocationSummary* StringToCharCodeInstr::MakeLocationSummary(Zone* zone, | 998 LocationSummary* StringToCharCodeInstr::MakeLocationSummary(Zone* zone, |
997 bool opt) const { | 999 bool opt) const { |
998 const intptr_t kNumInputs = 1; | 1000 const intptr_t kNumInputs = 1; |
999 return LocationSummary::Make(zone, | 1001 return LocationSummary::Make(zone, |
1000 kNumInputs, | 1002 kNumInputs, |
(...skipping 5847 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6848 1, | 6850 1, |
6849 locs()); | 6851 locs()); |
6850 __ Drop(1); | 6852 __ Drop(1); |
6851 __ Pop(result); | 6853 __ Pop(result); |
6852 } | 6854 } |
6853 | 6855 |
6854 | 6856 |
6855 } // namespace dart | 6857 } // namespace dart |
6856 | 6858 |
6857 #endif // defined TARGET_ARCH_ARM | 6859 #endif // defined TARGET_ARCH_ARM |
OLD | NEW |