Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(650)

Side by Side Diff: runtime/vm/intermediate_language_arm.cc

Issue 1295693002: Add ObjectPool tag for external labels. Use LoadExternalLabel for native calls... (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « runtime/vm/assembler.cc ('k') | runtime/vm/intermediate_language_arm64.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « runtime/vm/assembler.cc ('k') | runtime/vm/intermediate_language_arm64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698