| 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 957 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 968 } | 968 } |
| 969 | 969 |
| 970 | 970 |
| 971 LocationSummary* NativeCallInstr::MakeLocationSummary(Zone* zone, | 971 LocationSummary* NativeCallInstr::MakeLocationSummary(Zone* zone, |
| 972 bool opt) const { | 972 bool opt) const { |
| 973 return MakeCallSummary(zone); | 973 return MakeCallSummary(zone); |
| 974 } | 974 } |
| 975 | 975 |
| 976 | 976 |
| 977 void NativeCallInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 977 void NativeCallInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
| 978 SetupNative(); |
| 978 __ Comment("NativeCallInstr"); | 979 __ Comment("NativeCallInstr"); |
| 979 Register result = locs()->out(0).reg(); | 980 Register result = locs()->out(0).reg(); |
| 980 | 981 |
| 981 // Push the result place holder initialized to NULL. | 982 // Push the result place holder initialized to NULL. |
| 982 __ PushObject(Object::null_object()); | 983 __ PushObject(Object::null_object()); |
| 983 // Pass a pointer to the first argument in A2. | 984 // Pass a pointer to the first argument in A2. |
| 984 if (!function().HasOptionalParameters()) { | 985 if (!function().HasOptionalParameters()) { |
| 985 __ AddImmediate(A2, FP, (kParamEndSlotFromFp + | 986 __ AddImmediate(A2, FP, (kParamEndSlotFromFp + |
| 986 function().NumParameters()) * kWordSize); | 987 function().NumParameters()) * kWordSize); |
| 987 } else { | 988 } else { |
| 988 __ AddImmediate(A2, FP, kFirstLocalSlotFromFp * kWordSize); | 989 __ AddImmediate(A2, FP, kFirstLocalSlotFromFp * kWordSize); |
| 989 } | 990 } |
| 990 // Compute the effective address. When running under the simulator, | 991 // Compute the effective address. When running under the simulator, |
| 991 // this is a redirection address that forces the simulator to call | 992 // this is a redirection address that forces the simulator to call |
| 992 // into the runtime system. | 993 // into the runtime system. |
| 993 uword entry; | 994 uword entry; |
| 994 const intptr_t argc_tag = NativeArguments::ComputeArgcTag(function()); | 995 const intptr_t argc_tag = NativeArguments::ComputeArgcTag(function()); |
| 995 const bool is_leaf_call = | 996 const bool is_leaf_call = |
| 996 (argc_tag & NativeArguments::AutoSetupScopeMask()) == 0; | 997 (argc_tag & NativeArguments::AutoSetupScopeMask()) == 0; |
| 997 const StubEntry* stub_entry; | 998 const StubEntry* stub_entry; |
| 998 if (link_lazily()) { | 999 if (link_lazily()) { |
| 999 stub_entry = StubCode::CallBootstrapCFunction_entry(); | 1000 stub_entry = StubCode::CallBootstrapCFunction_entry(); |
| 1000 entry = NativeEntry::LinkNativeCallEntry(); | 1001 entry = NativeEntry::LinkNativeCallEntry(); |
| 1001 } else { | 1002 } else { |
| 1002 entry = reinterpret_cast<uword>(native_c_function()); | 1003 entry = reinterpret_cast<uword>(native_c_function()); |
| 1003 if (is_bootstrap_native() || is_leaf_call) { | 1004 if (is_bootstrap_native() || is_leaf_call) { |
| 1004 stub_entry = StubCode::CallBootstrapCFunction_entry(); | 1005 stub_entry = StubCode::CallBootstrapCFunction_entry(); |
| 1005 #if defined(USING_SIMULATOR) | 1006 #if defined(USING_SIMULATOR) |
| 1006 entry = Simulator::RedirectExternalReference( | 1007 entry = Simulator::RedirectExternalReference( |
| (...skipping 4590 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5597 1, | 5598 1, |
| 5598 locs()); | 5599 locs()); |
| 5599 __ lw(result, Address(SP, 1 * kWordSize)); | 5600 __ lw(result, Address(SP, 1 * kWordSize)); |
| 5600 __ addiu(SP, SP, Immediate(2 * kWordSize)); | 5601 __ addiu(SP, SP, Immediate(2 * kWordSize)); |
| 5601 } | 5602 } |
| 5602 | 5603 |
| 5603 | 5604 |
| 5604 } // namespace dart | 5605 } // namespace dart |
| 5605 | 5606 |
| 5606 #endif // defined TARGET_ARCH_MIPS | 5607 #endif // defined TARGET_ARCH_MIPS |
| OLD | NEW |