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 "lib/error.h" | 10 #include "lib/error.h" |
(...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
190 } | 190 } |
191 | 191 |
192 | 192 |
193 void RelationalOpInstr::EmitBranchCode(FlowGraphCompiler* compiler, | 193 void RelationalOpInstr::EmitBranchCode(FlowGraphCompiler* compiler, |
194 BranchInstr* branch) { | 194 BranchInstr* branch) { |
195 UNIMPLEMENTED(); | 195 UNIMPLEMENTED(); |
196 } | 196 } |
197 | 197 |
198 | 198 |
199 LocationSummary* NativeCallInstr::MakeLocationSummary() const { | 199 LocationSummary* NativeCallInstr::MakeLocationSummary() const { |
200 UNIMPLEMENTED(); | 200 const intptr_t kNumInputs = 0; |
201 return NULL; | 201 const intptr_t kNumTemps = 3; |
| 202 LocationSummary* locs = |
| 203 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kCall); |
| 204 locs->set_temp(0, Location::RegisterLocation(A1)); |
| 205 locs->set_temp(1, Location::RegisterLocation(A2)); |
| 206 locs->set_temp(2, Location::RegisterLocation(T5)); |
| 207 locs->set_out(Location::RegisterLocation(V0)); |
| 208 return locs; |
202 } | 209 } |
203 | 210 |
204 | 211 |
205 void NativeCallInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 212 void NativeCallInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
206 UNIMPLEMENTED(); | 213 ASSERT(locs()->temp(0).reg() == A1); |
| 214 ASSERT(locs()->temp(1).reg() == A2); |
| 215 ASSERT(locs()->temp(2).reg() == T5); |
| 216 Register result = locs()->out().reg(); |
| 217 |
| 218 // Push the result place holder initialized to NULL. |
| 219 __ PushObject(Object::ZoneHandle()); |
| 220 // Pass a pointer to the first argument in A2. |
| 221 if (!function().HasOptionalParameters()) { |
| 222 __ addiu(A2, FP, Immediate((kLastParamSlotIndex + |
| 223 function().NumParameters() - 1) * kWordSize)); |
| 224 } else { |
| 225 __ addiu(A2, FP, Immediate(kFirstLocalSlotIndex * kWordSize)); |
| 226 } |
| 227 // Compute the effective address. When running under the simulator, |
| 228 // this is a redirection address that forces the simulator to call |
| 229 // into the runtime system. |
| 230 uword entry = reinterpret_cast<uword>(native_c_function()); |
| 231 #if defined(USING_SIMULATOR) |
| 232 entry = Simulator::RedirectExternalReference(entry, Simulator::kNativeCall); |
| 233 #endif |
| 234 __ LoadImmediate(T5, entry); |
| 235 __ LoadImmediate(A1, NativeArguments::ComputeArgcTag(function())); |
| 236 compiler->GenerateCall(token_pos(), |
| 237 &StubCode::CallNativeCFunctionLabel(), |
| 238 PcDescriptors::kOther, |
| 239 locs()); |
| 240 __ Pop(result); |
207 } | 241 } |
208 | 242 |
209 | 243 |
210 LocationSummary* StringFromCharCodeInstr::MakeLocationSummary() const { | 244 LocationSummary* StringFromCharCodeInstr::MakeLocationSummary() const { |
211 UNIMPLEMENTED(); | 245 UNIMPLEMENTED(); |
212 return NULL; | 246 return NULL; |
213 } | 247 } |
214 | 248 |
215 | 249 |
216 void StringFromCharCodeInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 250 void StringFromCharCodeInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
(...skipping 638 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
855 | 889 |
856 | 890 |
857 void CreateClosureInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 891 void CreateClosureInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
858 UNIMPLEMENTED(); | 892 UNIMPLEMENTED(); |
859 } | 893 } |
860 | 894 |
861 } // namespace dart | 895 } // namespace dart |
862 | 896 |
863 #endif // defined TARGET_ARCH_MIPS | 897 #endif // defined TARGET_ARCH_MIPS |
864 | 898 |
OLD | NEW |