| 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_MIPS. | 5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_MIPS. |
| 6 #if defined(TARGET_ARCH_MIPS) | 6 #if defined(TARGET_ARCH_MIPS) |
| 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 1037 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1048 if (!function().HasOptionalParameters()) { | 1048 if (!function().HasOptionalParameters()) { |
| 1049 __ AddImmediate(A2, FP, (kParamEndSlotFromFp + | 1049 __ AddImmediate(A2, FP, (kParamEndSlotFromFp + |
| 1050 function().NumParameters()) * kWordSize); | 1050 function().NumParameters()) * kWordSize); |
| 1051 } else { | 1051 } else { |
| 1052 __ AddImmediate(A2, FP, kFirstLocalSlotFromFp * kWordSize); | 1052 __ AddImmediate(A2, FP, kFirstLocalSlotFromFp * kWordSize); |
| 1053 } | 1053 } |
| 1054 // Compute the effective address. When running under the simulator, | 1054 // Compute the effective address. When running under the simulator, |
| 1055 // this is a redirection address that forces the simulator to call | 1055 // this is a redirection address that forces the simulator to call |
| 1056 // into the runtime system. | 1056 // into the runtime system. |
| 1057 uword entry = reinterpret_cast<uword>(native_c_function()); | 1057 uword entry = reinterpret_cast<uword>(native_c_function()); |
| 1058 const ExternalLabel* stub_entry; |
| 1059 if (is_bootstrap_native()) { |
| 1060 stub_entry = &StubCode::CallBootstrapCFunctionLabel(); |
| 1058 #if defined(USING_SIMULATOR) | 1061 #if defined(USING_SIMULATOR) |
| 1059 entry = Simulator::RedirectExternalReference(entry, | 1062 entry = Simulator::RedirectExternalReference( |
| 1060 Simulator::kNativeCall, | 1063 entry, Simulator::kBootstrapNativeCall, function().NumParameters()); |
| 1061 function().NumParameters()); | |
| 1062 #endif | 1064 #endif |
| 1065 } else { |
| 1066 // In the case of non bootstrap native methods the CallNativeCFunction |
| 1067 // stub generates the redirection address when running under the simulator |
| 1068 // and hence we do not change 'entry' here. |
| 1069 stub_entry = &StubCode::CallNativeCFunctionLabel(); |
| 1070 } |
| 1063 __ LoadImmediate(T5, entry); | 1071 __ LoadImmediate(T5, entry); |
| 1064 __ LoadImmediate(A1, NativeArguments::ComputeArgcTag(function())); | 1072 __ LoadImmediate(A1, NativeArguments::ComputeArgcTag(function())); |
| 1065 compiler->GenerateCall(token_pos(), | 1073 compiler->GenerateCall(token_pos(), |
| 1066 &StubCode::CallNativeCFunctionLabel(), | 1074 stub_entry, |
| 1067 PcDescriptors::kOther, | 1075 PcDescriptors::kOther, |
| 1068 locs()); | 1076 locs()); |
| 1069 __ Pop(result); | 1077 __ Pop(result); |
| 1070 } | 1078 } |
| 1071 | 1079 |
| 1072 | 1080 |
| 1073 LocationSummary* StringFromCharCodeInstr::MakeLocationSummary() const { | 1081 LocationSummary* StringFromCharCodeInstr::MakeLocationSummary() const { |
| 1074 const intptr_t kNumInputs = 1; | 1082 const intptr_t kNumInputs = 1; |
| 1075 // TODO(fschneider): Allow immediate operands for the char code. | 1083 // TODO(fschneider): Allow immediate operands for the char code. |
| 1076 return LocationSummary::Make(kNumInputs, | 1084 return LocationSummary::Make(kNumInputs, |
| (...skipping 2795 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3872 compiler->GenerateCall(token_pos(), | 3880 compiler->GenerateCall(token_pos(), |
| 3873 &label, | 3881 &label, |
| 3874 PcDescriptors::kOther, | 3882 PcDescriptors::kOther, |
| 3875 locs()); | 3883 locs()); |
| 3876 __ Drop(2); // Discard type arguments and receiver. | 3884 __ Drop(2); // Discard type arguments and receiver. |
| 3877 } | 3885 } |
| 3878 | 3886 |
| 3879 } // namespace dart | 3887 } // namespace dart |
| 3880 | 3888 |
| 3881 #endif // defined TARGET_ARCH_MIPS | 3889 #endif // defined TARGET_ARCH_MIPS |
| OLD | NEW |