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 2614 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2625 __ LoadImmediate(R1, num_context_variables()); | 2625 __ LoadImmediate(R1, num_context_variables()); |
2626 StubCode* stub_code = compiler->isolate()->stub_code(); | 2626 StubCode* stub_code = compiler->isolate()->stub_code(); |
2627 const ExternalLabel label(stub_code->AllocateContextEntryPoint()); | 2627 const ExternalLabel label(stub_code->AllocateContextEntryPoint()); |
2628 compiler->GenerateCall(token_pos(), | 2628 compiler->GenerateCall(token_pos(), |
2629 &label, | 2629 &label, |
2630 RawPcDescriptors::kOther, | 2630 RawPcDescriptors::kOther, |
2631 locs()); | 2631 locs()); |
2632 } | 2632 } |
2633 | 2633 |
2634 | 2634 |
| 2635 LocationSummary* InitStaticFieldInstr::MakeLocationSummary(Isolate* isolate, |
| 2636 bool opt) const { |
| 2637 const intptr_t kNumInputs = 1; |
| 2638 const intptr_t kNumTemps = 1; |
| 2639 LocationSummary* locs = new(isolate) LocationSummary( |
| 2640 isolate, kNumInputs, kNumTemps, LocationSummary::kCall); |
| 2641 locs->set_in(0, Location::RegisterLocation(R0)); |
| 2642 locs->set_temp(0, Location::RegisterLocation(R1)); |
| 2643 return locs; |
| 2644 } |
| 2645 |
| 2646 |
| 2647 void InitStaticFieldInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
| 2648 Register field = locs()->in(0).reg(); |
| 2649 Register temp = locs()->temp(0).reg(); |
| 2650 Label call_runtime, no_call; |
| 2651 |
| 2652 __ ldr(temp, FieldAddress(field, Field::value_offset())); |
| 2653 __ CompareObject(temp, Object::sentinel()); |
| 2654 __ b(&call_runtime, EQ); |
| 2655 |
| 2656 __ CompareObject(temp, Object::transition_sentinel()); |
| 2657 __ b(&no_call, NE); |
| 2658 |
| 2659 __ Bind(&call_runtime); |
| 2660 __ PushObject(Object::null_object()); // Make room for (unused) result. |
| 2661 __ Push(field); |
| 2662 compiler->GenerateRuntimeCall(token_pos(), |
| 2663 deopt_id(), |
| 2664 kInitStaticFieldRuntimeEntry, |
| 2665 1, |
| 2666 locs()); |
| 2667 __ Drop(2); // Remove argument and result placeholder. |
| 2668 __ Bind(&no_call); |
| 2669 } |
| 2670 |
| 2671 |
2635 LocationSummary* CloneContextInstr::MakeLocationSummary(Isolate* isolate, | 2672 LocationSummary* CloneContextInstr::MakeLocationSummary(Isolate* isolate, |
2636 bool opt) const { | 2673 bool opt) const { |
2637 const intptr_t kNumInputs = 1; | 2674 const intptr_t kNumInputs = 1; |
2638 const intptr_t kNumTemps = 0; | 2675 const intptr_t kNumTemps = 0; |
2639 LocationSummary* locs = new(isolate) LocationSummary( | 2676 LocationSummary* locs = new(isolate) LocationSummary( |
2640 isolate, kNumInputs, kNumTemps, LocationSummary::kCall); | 2677 isolate, kNumInputs, kNumTemps, LocationSummary::kCall); |
2641 locs->set_in(0, Location::RegisterLocation(R0)); | 2678 locs->set_in(0, Location::RegisterLocation(R0)); |
2642 locs->set_out(0, Location::RegisterLocation(R0)); | 2679 locs->set_out(0, Location::RegisterLocation(R0)); |
2643 return locs; | 2680 return locs; |
2644 } | 2681 } |
(...skipping 4065 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6710 compiler->GenerateCall(token_pos(), &label, stub_kind_, locs()); | 6747 compiler->GenerateCall(token_pos(), &label, stub_kind_, locs()); |
6711 #if defined(DEBUG) | 6748 #if defined(DEBUG) |
6712 __ LoadImmediate(R4, kInvalidObjectPointer); | 6749 __ LoadImmediate(R4, kInvalidObjectPointer); |
6713 __ LoadImmediate(R5, kInvalidObjectPointer); | 6750 __ LoadImmediate(R5, kInvalidObjectPointer); |
6714 #endif | 6751 #endif |
6715 } | 6752 } |
6716 | 6753 |
6717 } // namespace dart | 6754 } // namespace dart |
6718 | 6755 |
6719 #endif // defined TARGET_ARCH_ARM | 6756 #endif // defined TARGET_ARCH_ARM |
OLD | NEW |