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 981 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
992 if (!function().HasOptionalParameters()) { | 992 if (!function().HasOptionalParameters()) { |
993 __ AddImmediate(R2, FP, (kParamEndSlotFromFp + | 993 __ AddImmediate(R2, FP, (kParamEndSlotFromFp + |
994 function().NumParameters()) * kWordSize); | 994 function().NumParameters()) * kWordSize); |
995 } else { | 995 } else { |
996 __ AddImmediate(R2, FP, kFirstLocalSlotFromFp * kWordSize); | 996 __ AddImmediate(R2, FP, kFirstLocalSlotFromFp * kWordSize); |
997 } | 997 } |
998 // Compute the effective address. When running under the simulator, | 998 // Compute the effective address. When running under the simulator, |
999 // this is a redirection address that forces the simulator to call | 999 // this is a redirection address that forces the simulator to call |
1000 // into the runtime system. | 1000 // into the runtime system. |
1001 uword entry = reinterpret_cast<uword>(native_c_function()); | 1001 uword entry = reinterpret_cast<uword>(native_c_function()); |
| 1002 const ExternalLabel* stub_entry; |
| 1003 if (is_bootstrap_native()) { |
| 1004 stub_entry = &StubCode::CallBootstrapCFunctionLabel(); |
1002 #if defined(USING_SIMULATOR) | 1005 #if defined(USING_SIMULATOR) |
1003 entry = Simulator::RedirectExternalReference(entry, | 1006 entry = Simulator::RedirectExternalReference( |
1004 Simulator::kNativeCall, | 1007 entry, Simulator::kBootstrapNativeCall, function().NumParameters()); |
1005 function().NumParameters()); | |
1006 #endif | 1008 #endif |
| 1009 } else { |
| 1010 // In the case of non bootstrap native methods the CallNativeCFunction |
| 1011 // stub generates the redirection address when running under the simulator |
| 1012 // and hence we do not change 'entry' here. |
| 1013 stub_entry = &StubCode::CallNativeCFunctionLabel(); |
| 1014 } |
1007 __ LoadImmediate(R5, entry); | 1015 __ LoadImmediate(R5, entry); |
1008 __ LoadImmediate(R1, NativeArguments::ComputeArgcTag(function())); | 1016 __ LoadImmediate(R1, NativeArguments::ComputeArgcTag(function())); |
1009 compiler->GenerateCall(token_pos(), | 1017 compiler->GenerateCall(token_pos(), |
1010 &StubCode::CallNativeCFunctionLabel(), | 1018 stub_entry, |
1011 PcDescriptors::kOther, | 1019 PcDescriptors::kOther, |
1012 locs()); | 1020 locs()); |
1013 __ Pop(result); | 1021 __ Pop(result); |
1014 } | 1022 } |
1015 | 1023 |
1016 | 1024 |
1017 LocationSummary* StringFromCharCodeInstr::MakeLocationSummary() const { | 1025 LocationSummary* StringFromCharCodeInstr::MakeLocationSummary() const { |
1018 const intptr_t kNumInputs = 1; | 1026 const intptr_t kNumInputs = 1; |
1019 // TODO(fschneider): Allow immediate operands for the char code. | 1027 // TODO(fschneider): Allow immediate operands for the char code. |
1020 return LocationSummary::Make(kNumInputs, | 1028 return LocationSummary::Make(kNumInputs, |
(...skipping 3398 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4419 compiler->GenerateCall(token_pos(), | 4427 compiler->GenerateCall(token_pos(), |
4420 &label, | 4428 &label, |
4421 PcDescriptors::kOther, | 4429 PcDescriptors::kOther, |
4422 locs()); | 4430 locs()); |
4423 __ Drop(2); // Discard type arguments and receiver. | 4431 __ Drop(2); // Discard type arguments and receiver. |
4424 } | 4432 } |
4425 | 4433 |
4426 } // namespace dart | 4434 } // namespace dart |
4427 | 4435 |
4428 #endif // defined TARGET_ARCH_ARM | 4436 #endif // defined TARGET_ARCH_ARM |
OLD | NEW |