| 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/cpu.h" | 10 #include "vm/cpu.h" |
| (...skipping 895 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 906 } | 906 } |
| 907 | 907 |
| 908 | 908 |
| 909 void NativeCallInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 909 void NativeCallInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
| 910 ASSERT(locs()->temp(0).reg() == R1); | 910 ASSERT(locs()->temp(0).reg() == R1); |
| 911 ASSERT(locs()->temp(1).reg() == R2); | 911 ASSERT(locs()->temp(1).reg() == R2); |
| 912 ASSERT(locs()->temp(2).reg() == R5); | 912 ASSERT(locs()->temp(2).reg() == R5); |
| 913 const Register result = locs()->out(0).reg(); | 913 const Register result = locs()->out(0).reg(); |
| 914 | 914 |
| 915 // Push the result place holder initialized to NULL. | 915 // Push the result place holder initialized to NULL. |
| 916 __ PushObject(Object::ZoneHandle()); | 916 __ PushObject(Object::null_object()); |
| 917 // Pass a pointer to the first argument in R2. | 917 // Pass a pointer to the first argument in R2. |
| 918 if (!function().HasOptionalParameters()) { | 918 if (!function().HasOptionalParameters()) { |
| 919 __ AddImmediate(R2, FP, (kParamEndSlotFromFp + | 919 __ AddImmediate(R2, FP, (kParamEndSlotFromFp + |
| 920 function().NumParameters()) * kWordSize); | 920 function().NumParameters()) * kWordSize); |
| 921 } else { | 921 } else { |
| 922 __ AddImmediate(R2, FP, kFirstLocalSlotFromFp * kWordSize); | 922 __ AddImmediate(R2, FP, kFirstLocalSlotFromFp * kWordSize); |
| 923 } | 923 } |
| 924 // Compute the effective address. When running under the simulator, | 924 // Compute the effective address. When running under the simulator, |
| 925 // this is a redirection address that forces the simulator to call | 925 // this is a redirection address that forces the simulator to call |
| 926 // into the runtime system. | 926 // into the runtime system. |
| (...skipping 1429 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2356 ASSERT(locs()->in(kElementTypePos).reg() == kElemTypeReg); | 2356 ASSERT(locs()->in(kElementTypePos).reg() == kElemTypeReg); |
| 2357 ASSERT(locs()->in(kLengthPos).reg() == kLengthReg); | 2357 ASSERT(locs()->in(kLengthPos).reg() == kLengthReg); |
| 2358 | 2358 |
| 2359 if (num_elements()->BindsToConstant() && | 2359 if (num_elements()->BindsToConstant() && |
| 2360 num_elements()->BoundConstant().IsSmi()) { | 2360 num_elements()->BoundConstant().IsSmi()) { |
| 2361 const intptr_t length = Smi::Cast(num_elements()->BoundConstant()).Value(); | 2361 const intptr_t length = Smi::Cast(num_elements()->BoundConstant()).Value(); |
| 2362 if ((length >= 0) && (length <= Array::kMaxElements)) { | 2362 if ((length >= 0) && (length <= Array::kMaxElements)) { |
| 2363 Label slow_path, done; | 2363 Label slow_path, done; |
| 2364 InlineArrayAllocation(compiler, length, &slow_path, &done); | 2364 InlineArrayAllocation(compiler, length, &slow_path, &done); |
| 2365 __ Bind(&slow_path); | 2365 __ Bind(&slow_path); |
| 2366 __ PushObject(Object::ZoneHandle()); // Make room for the result. | 2366 __ PushObject(Object::null_object()); // Make room for the result. |
| 2367 __ Push(kLengthReg); // length. | 2367 __ Push(kLengthReg); // length. |
| 2368 __ Push(kElemTypeReg); | 2368 __ Push(kElemTypeReg); |
| 2369 compiler->GenerateRuntimeCall(token_pos(), | 2369 compiler->GenerateRuntimeCall(token_pos(), |
| 2370 deopt_id(), | 2370 deopt_id(), |
| 2371 kAllocateArrayRuntimeEntry, | 2371 kAllocateArrayRuntimeEntry, |
| 2372 2, | 2372 2, |
| 2373 locs()); | 2373 locs()); |
| 2374 __ Drop(2); | 2374 __ Drop(2); |
| 2375 __ Pop(kResultReg); | 2375 __ Pop(kResultReg); |
| 2376 __ Bind(&done); | 2376 __ Bind(&done); |
| (...skipping 267 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2644 return locs; | 2644 return locs; |
| 2645 } | 2645 } |
| 2646 | 2646 |
| 2647 | 2647 |
| 2648 void InstantiateTypeInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 2648 void InstantiateTypeInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
| 2649 const Register instantiator_reg = locs()->in(0).reg(); | 2649 const Register instantiator_reg = locs()->in(0).reg(); |
| 2650 const Register result_reg = locs()->out(0).reg(); | 2650 const Register result_reg = locs()->out(0).reg(); |
| 2651 | 2651 |
| 2652 // 'instantiator_reg' is the instantiator TypeArguments object (or null). | 2652 // 'instantiator_reg' is the instantiator TypeArguments object (or null). |
| 2653 // A runtime call to instantiate the type is required. | 2653 // A runtime call to instantiate the type is required. |
| 2654 __ PushObject(Object::ZoneHandle()); // Make room for the result. | 2654 __ PushObject(Object::null_object()); // Make room for the result. |
| 2655 __ PushObject(type()); | 2655 __ PushObject(type()); |
| 2656 __ Push(instantiator_reg); // Push instantiator type arguments. | 2656 __ Push(instantiator_reg); // Push instantiator type arguments. |
| 2657 compiler->GenerateRuntimeCall(token_pos(), | 2657 compiler->GenerateRuntimeCall(token_pos(), |
| 2658 deopt_id(), | 2658 deopt_id(), |
| 2659 kInstantiateTypeRuntimeEntry, | 2659 kInstantiateTypeRuntimeEntry, |
| 2660 2, | 2660 2, |
| 2661 locs()); | 2661 locs()); |
| 2662 __ Drop(2); // Drop instantiator and uninstantiated type. | 2662 __ Drop(2); // Drop instantiator and uninstantiated type. |
| 2663 __ Pop(result_reg); // Pop instantiated type. | 2663 __ Pop(result_reg); // Pop instantiated type. |
| 2664 ASSERT(instantiator_reg == result_reg); | 2664 ASSERT(instantiator_reg == result_reg); |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2713 __ CompareImmediate(R1, Smi::RawValue(StubCode::kNoInstantiator)); | 2713 __ CompareImmediate(R1, Smi::RawValue(StubCode::kNoInstantiator)); |
| 2714 __ b(&loop, NE); | 2714 __ b(&loop, NE); |
| 2715 __ b(&slow_case); | 2715 __ b(&slow_case); |
| 2716 __ Bind(&found); | 2716 __ Bind(&found); |
| 2717 __ ldr(R0, Address(R2, 1 * kWordSize)); // Cached instantiated args. | 2717 __ ldr(R0, Address(R2, 1 * kWordSize)); // Cached instantiated args. |
| 2718 __ b(&type_arguments_instantiated); | 2718 __ b(&type_arguments_instantiated); |
| 2719 | 2719 |
| 2720 __ Bind(&slow_case); | 2720 __ Bind(&slow_case); |
| 2721 // Instantiate non-null type arguments. | 2721 // Instantiate non-null type arguments. |
| 2722 // A runtime call to instantiate the type arguments is required. | 2722 // A runtime call to instantiate the type arguments is required. |
| 2723 __ PushObject(Object::ZoneHandle()); // Make room for the result. | 2723 __ PushObject(Object::null_object()); // Make room for the result. |
| 2724 __ PushObject(type_arguments()); | 2724 __ PushObject(type_arguments()); |
| 2725 __ Push(instantiator_reg); // Push instantiator type arguments. | 2725 __ Push(instantiator_reg); // Push instantiator type arguments. |
| 2726 compiler->GenerateRuntimeCall(token_pos(), | 2726 compiler->GenerateRuntimeCall(token_pos(), |
| 2727 deopt_id(), | 2727 deopt_id(), |
| 2728 kInstantiateTypeArgumentsRuntimeEntry, | 2728 kInstantiateTypeArgumentsRuntimeEntry, |
| 2729 2, | 2729 2, |
| 2730 locs()); | 2730 locs()); |
| 2731 __ Drop(2); // Drop instantiator and uninstantiated type arguments. | 2731 __ Drop(2); // Drop instantiator and uninstantiated type arguments. |
| 2732 __ Pop(result_reg); // Pop instantiated type arguments. | 2732 __ Pop(result_reg); // Pop instantiated type arguments. |
| 2733 __ Bind(&type_arguments_instantiated); | 2733 __ Bind(&type_arguments_instantiated); |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2768 locs->set_in(0, Location::RegisterLocation(R0)); | 2768 locs->set_in(0, Location::RegisterLocation(R0)); |
| 2769 locs->set_out(0, Location::RegisterLocation(R0)); | 2769 locs->set_out(0, Location::RegisterLocation(R0)); |
| 2770 return locs; | 2770 return locs; |
| 2771 } | 2771 } |
| 2772 | 2772 |
| 2773 | 2773 |
| 2774 void CloneContextInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 2774 void CloneContextInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
| 2775 const Register context_value = locs()->in(0).reg(); | 2775 const Register context_value = locs()->in(0).reg(); |
| 2776 const Register result = locs()->out(0).reg(); | 2776 const Register result = locs()->out(0).reg(); |
| 2777 | 2777 |
| 2778 __ PushObject(Object::ZoneHandle()); // Make room for the result. | 2778 __ PushObject(Object::null_object()); // Make room for the result. |
| 2779 __ Push(context_value); | 2779 __ Push(context_value); |
| 2780 compiler->GenerateRuntimeCall(token_pos(), | 2780 compiler->GenerateRuntimeCall(token_pos(), |
| 2781 deopt_id(), | 2781 deopt_id(), |
| 2782 kCloneContextRuntimeEntry, | 2782 kCloneContextRuntimeEntry, |
| 2783 1, | 2783 1, |
| 2784 locs()); | 2784 locs()); |
| 2785 __ Drop(1); // Remove argument. | 2785 __ Drop(1); // Remove argument. |
| 2786 __ Pop(result); // Get result (cloned context). | 2786 __ Pop(result); // Get result (cloned context). |
| 2787 } | 2787 } |
| 2788 | 2788 |
| (...skipping 3646 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6435 compiler->GenerateCall(token_pos(), &label, stub_kind_, locs()); | 6435 compiler->GenerateCall(token_pos(), &label, stub_kind_, locs()); |
| 6436 #if defined(DEBUG) | 6436 #if defined(DEBUG) |
| 6437 __ LoadImmediate(R4, kInvalidObjectPointer); | 6437 __ LoadImmediate(R4, kInvalidObjectPointer); |
| 6438 __ LoadImmediate(R5, kInvalidObjectPointer); | 6438 __ LoadImmediate(R5, kInvalidObjectPointer); |
| 6439 #endif | 6439 #endif |
| 6440 } | 6440 } |
| 6441 | 6441 |
| 6442 } // namespace dart | 6442 } // namespace dart |
| 6443 | 6443 |
| 6444 #endif // defined TARGET_ARCH_ARM | 6444 #endif // defined TARGET_ARCH_ARM |
| OLD | NEW |