| 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 850 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 861 | 861 |
| 862 | 862 |
| 863 void NativeCallInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 863 void NativeCallInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
| 864 __ TraceSimMsg("NativeCallInstr"); | 864 __ TraceSimMsg("NativeCallInstr"); |
| 865 ASSERT(locs()->temp(0).reg() == A1); | 865 ASSERT(locs()->temp(0).reg() == A1); |
| 866 ASSERT(locs()->temp(1).reg() == A2); | 866 ASSERT(locs()->temp(1).reg() == A2); |
| 867 ASSERT(locs()->temp(2).reg() == T5); | 867 ASSERT(locs()->temp(2).reg() == T5); |
| 868 Register result = locs()->out(0).reg(); | 868 Register result = locs()->out(0).reg(); |
| 869 | 869 |
| 870 // Push the result place holder initialized to NULL. | 870 // Push the result place holder initialized to NULL. |
| 871 __ PushObject(Object::ZoneHandle()); | 871 __ PushObject(Object::null_object()); |
| 872 // Pass a pointer to the first argument in A2. | 872 // Pass a pointer to the first argument in A2. |
| 873 if (!function().HasOptionalParameters()) { | 873 if (!function().HasOptionalParameters()) { |
| 874 __ AddImmediate(A2, FP, (kParamEndSlotFromFp + | 874 __ AddImmediate(A2, FP, (kParamEndSlotFromFp + |
| 875 function().NumParameters()) * kWordSize); | 875 function().NumParameters()) * kWordSize); |
| 876 } else { | 876 } else { |
| 877 __ AddImmediate(A2, FP, kFirstLocalSlotFromFp * kWordSize); | 877 __ AddImmediate(A2, FP, kFirstLocalSlotFromFp * kWordSize); |
| 878 } | 878 } |
| 879 // Compute the effective address. When running under the simulator, | 879 // Compute the effective address. When running under the simulator, |
| 880 // this is a redirection address that forces the simulator to call | 880 // this is a redirection address that forces the simulator to call |
| 881 // into the runtime system. | 881 // into the runtime system. |
| (...skipping 1206 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2088 ASSERT(locs()->in(1).reg() == kLengthReg); | 2088 ASSERT(locs()->in(1).reg() == kLengthReg); |
| 2089 | 2089 |
| 2090 Label slow_path, done; | 2090 Label slow_path, done; |
| 2091 if (num_elements()->BindsToConstant() && | 2091 if (num_elements()->BindsToConstant() && |
| 2092 num_elements()->BoundConstant().IsSmi()) { | 2092 num_elements()->BoundConstant().IsSmi()) { |
| 2093 const intptr_t length = Smi::Cast(num_elements()->BoundConstant()).Value(); | 2093 const intptr_t length = Smi::Cast(num_elements()->BoundConstant()).Value(); |
| 2094 if ((length >= 0) && (length <= Array::kMaxElements)) { | 2094 if ((length >= 0) && (length <= Array::kMaxElements)) { |
| 2095 Label slow_path, done; | 2095 Label slow_path, done; |
| 2096 InlineArrayAllocation(compiler, length, &slow_path, &done); | 2096 InlineArrayAllocation(compiler, length, &slow_path, &done); |
| 2097 __ Bind(&slow_path); | 2097 __ Bind(&slow_path); |
| 2098 __ PushObject(Object::ZoneHandle()); // Make room for the result. | 2098 __ PushObject(Object::null_object()); // Make room for the result. |
| 2099 __ Push(kLengthReg); // length. | 2099 __ Push(kLengthReg); // length. |
| 2100 __ Push(kElemTypeReg); | 2100 __ Push(kElemTypeReg); |
| 2101 compiler->GenerateRuntimeCall(token_pos(), | 2101 compiler->GenerateRuntimeCall(token_pos(), |
| 2102 deopt_id(), | 2102 deopt_id(), |
| 2103 kAllocateArrayRuntimeEntry, | 2103 kAllocateArrayRuntimeEntry, |
| 2104 2, | 2104 2, |
| 2105 locs()); | 2105 locs()); |
| 2106 __ Drop(2); | 2106 __ Drop(2); |
| 2107 __ Pop(kResultReg); | 2107 __ Pop(kResultReg); |
| 2108 __ Bind(&done); | 2108 __ Bind(&done); |
| (...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2265 | 2265 |
| 2266 | 2266 |
| 2267 void InstantiateTypeInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 2267 void InstantiateTypeInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
| 2268 __ TraceSimMsg("InstantiateTypeInstr"); | 2268 __ TraceSimMsg("InstantiateTypeInstr"); |
| 2269 Register instantiator_reg = locs()->in(0).reg(); | 2269 Register instantiator_reg = locs()->in(0).reg(); |
| 2270 Register result_reg = locs()->out(0).reg(); | 2270 Register result_reg = locs()->out(0).reg(); |
| 2271 | 2271 |
| 2272 // 'instantiator_reg' is the instantiator TypeArguments object (or null). | 2272 // 'instantiator_reg' is the instantiator TypeArguments object (or null). |
| 2273 // A runtime call to instantiate the type is required. | 2273 // A runtime call to instantiate the type is required. |
| 2274 __ addiu(SP, SP, Immediate(-3 * kWordSize)); | 2274 __ addiu(SP, SP, Immediate(-3 * kWordSize)); |
| 2275 __ LoadObject(TMP, Object::ZoneHandle()); | 2275 __ LoadObject(TMP, Object::null_object()); |
| 2276 __ sw(TMP, Address(SP, 2 * kWordSize)); // Make room for the result. | 2276 __ sw(TMP, Address(SP, 2 * kWordSize)); // Make room for the result. |
| 2277 __ LoadObject(TMP, type()); | 2277 __ LoadObject(TMP, type()); |
| 2278 __ sw(TMP, Address(SP, 1 * kWordSize)); | 2278 __ sw(TMP, Address(SP, 1 * kWordSize)); |
| 2279 // Push instantiator type arguments. | 2279 // Push instantiator type arguments. |
| 2280 __ sw(instantiator_reg, Address(SP, 0 * kWordSize)); | 2280 __ sw(instantiator_reg, Address(SP, 0 * kWordSize)); |
| 2281 | 2281 |
| 2282 compiler->GenerateRuntimeCall(token_pos(), | 2282 compiler->GenerateRuntimeCall(token_pos(), |
| 2283 deopt_id(), | 2283 deopt_id(), |
| 2284 kInstantiateTypeRuntimeEntry, | 2284 kInstantiateTypeRuntimeEntry, |
| 2285 2, | 2285 2, |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2339 __ delay_slot()->addiu(T2, T2, Immediate(2 * kWordSize)); | 2339 __ delay_slot()->addiu(T2, T2, Immediate(2 * kWordSize)); |
| 2340 __ b(&slow_case); | 2340 __ b(&slow_case); |
| 2341 __ Bind(&found); | 2341 __ Bind(&found); |
| 2342 __ lw(T0, Address(T2, 1 * kWordSize)); // Cached instantiated args. | 2342 __ lw(T0, Address(T2, 1 * kWordSize)); // Cached instantiated args. |
| 2343 __ b(&type_arguments_instantiated); | 2343 __ b(&type_arguments_instantiated); |
| 2344 | 2344 |
| 2345 __ Bind(&slow_case); | 2345 __ Bind(&slow_case); |
| 2346 // Instantiate non-null type arguments. | 2346 // Instantiate non-null type arguments. |
| 2347 // A runtime call to instantiate the type arguments is required. | 2347 // A runtime call to instantiate the type arguments is required. |
| 2348 __ addiu(SP, SP, Immediate(-3 * kWordSize)); | 2348 __ addiu(SP, SP, Immediate(-3 * kWordSize)); |
| 2349 __ LoadObject(TMP, Object::ZoneHandle()); | 2349 __ LoadObject(TMP, Object::null_object()); |
| 2350 __ sw(TMP, Address(SP, 2 * kWordSize)); // Make room for the result. | 2350 __ sw(TMP, Address(SP, 2 * kWordSize)); // Make room for the result. |
| 2351 __ LoadObject(TMP, type_arguments()); | 2351 __ LoadObject(TMP, type_arguments()); |
| 2352 __ sw(TMP, Address(SP, 1 * kWordSize)); | 2352 __ sw(TMP, Address(SP, 1 * kWordSize)); |
| 2353 // Push instantiator type arguments. | 2353 // Push instantiator type arguments. |
| 2354 __ sw(instantiator_reg, Address(SP, 0 * kWordSize)); | 2354 __ sw(instantiator_reg, Address(SP, 0 * kWordSize)); |
| 2355 | 2355 |
| 2356 compiler->GenerateRuntimeCall(token_pos(), | 2356 compiler->GenerateRuntimeCall(token_pos(), |
| 2357 deopt_id(), | 2357 deopt_id(), |
| 2358 kInstantiateTypeArgumentsRuntimeEntry, | 2358 kInstantiateTypeArgumentsRuntimeEntry, |
| 2359 2, | 2359 2, |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2405 } | 2405 } |
| 2406 | 2406 |
| 2407 | 2407 |
| 2408 void CloneContextInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 2408 void CloneContextInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
| 2409 Register context_value = locs()->in(0).reg(); | 2409 Register context_value = locs()->in(0).reg(); |
| 2410 Register result = locs()->out(0).reg(); | 2410 Register result = locs()->out(0).reg(); |
| 2411 | 2411 |
| 2412 __ TraceSimMsg("CloneContextInstr"); | 2412 __ TraceSimMsg("CloneContextInstr"); |
| 2413 | 2413 |
| 2414 __ addiu(SP, SP, Immediate(-2 * kWordSize)); | 2414 __ addiu(SP, SP, Immediate(-2 * kWordSize)); |
| 2415 __ LoadObject(TMP, Object::ZoneHandle()); // Make room for the result. | 2415 __ LoadObject(TMP, Object::null_object()); // Make room for the result. |
| 2416 __ sw(TMP, Address(SP, 1 * kWordSize)); | 2416 __ sw(TMP, Address(SP, 1 * kWordSize)); |
| 2417 __ sw(context_value, Address(SP, 0 * kWordSize)); | 2417 __ sw(context_value, Address(SP, 0 * kWordSize)); |
| 2418 | 2418 |
| 2419 compiler->GenerateRuntimeCall(token_pos(), | 2419 compiler->GenerateRuntimeCall(token_pos(), |
| 2420 deopt_id(), | 2420 deopt_id(), |
| 2421 kCloneContextRuntimeEntry, | 2421 kCloneContextRuntimeEntry, |
| 2422 1, | 2422 1, |
| 2423 locs()); | 2423 locs()); |
| 2424 __ lw(result, Address(SP, 1 * kWordSize)); // Get result (cloned context). | 2424 __ lw(result, Address(SP, 1 * kWordSize)); // Get result (cloned context). |
| 2425 __ addiu(SP, SP, Immediate(2 * kWordSize)); | 2425 __ addiu(SP, SP, Immediate(2 * kWordSize)); |
| (...skipping 2271 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4697 compiler->GenerateCall(token_pos(), &label, stub_kind_, locs()); | 4697 compiler->GenerateCall(token_pos(), &label, stub_kind_, locs()); |
| 4698 #if defined(DEBUG) | 4698 #if defined(DEBUG) |
| 4699 __ LoadImmediate(S4, kInvalidObjectPointer); | 4699 __ LoadImmediate(S4, kInvalidObjectPointer); |
| 4700 __ LoadImmediate(S5, kInvalidObjectPointer); | 4700 __ LoadImmediate(S5, kInvalidObjectPointer); |
| 4701 #endif | 4701 #endif |
| 4702 } | 4702 } |
| 4703 | 4703 |
| 4704 } // namespace dart | 4704 } // namespace dart |
| 4705 | 4705 |
| 4706 #endif // defined TARGET_ARCH_MIPS | 4706 #endif // defined TARGET_ARCH_MIPS |
| OLD | NEW |