| 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_IA32. | 5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_IA32. |
| 6 #if defined(TARGET_ARCH_IA32) | 6 #if defined(TARGET_ARCH_IA32) |
| 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 1741 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1752 } else { | 1752 } else { |
| 1753 Register value_reg = locs()->in(1).reg(); | 1753 Register value_reg = locs()->in(1).reg(); |
| 1754 __ StoreIntoObjectNoBarrier(instance_reg, | 1754 __ StoreIntoObjectNoBarrier(instance_reg, |
| 1755 FieldAddress(instance_reg, field().Offset()), value_reg); | 1755 FieldAddress(instance_reg, field().Offset()), value_reg); |
| 1756 } | 1756 } |
| 1757 } | 1757 } |
| 1758 } | 1758 } |
| 1759 | 1759 |
| 1760 | 1760 |
| 1761 LocationSummary* LoadStaticFieldInstr::MakeLocationSummary() const { | 1761 LocationSummary* LoadStaticFieldInstr::MakeLocationSummary() const { |
| 1762 return LocationSummary::Make(0, | 1762 const intptr_t kNumInputs = 1; |
| 1763 Location::RequiresRegister(), | 1763 const intptr_t kNumTemps = 0; |
| 1764 LocationSummary::kNoCall); | 1764 LocationSummary* summary = |
| 1765 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kNoCall); |
| 1766 summary->set_in(0, Location::RequiresRegister()); |
| 1767 // By specifying same register as input, our simple register allocator can |
| 1768 // generate better code. |
| 1769 summary->set_out(Location::SameAsFirstInput()); |
| 1770 return summary; |
| 1765 } | 1771 } |
| 1766 | 1772 |
| 1767 | 1773 |
| 1768 void LoadStaticFieldInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 1774 void LoadStaticFieldInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
| 1775 Register field = locs()->in(0).reg(); |
| 1769 Register result = locs()->out().reg(); | 1776 Register result = locs()->out().reg(); |
| 1770 __ LoadObject(result, field()); | 1777 __ movl(result, FieldAddress(field, Field::value_offset())); |
| 1771 __ movl(result, FieldAddress(result, Field::value_offset())); | |
| 1772 } | 1778 } |
| 1773 | 1779 |
| 1774 | 1780 |
| 1775 LocationSummary* StoreStaticFieldInstr::MakeLocationSummary() const { | 1781 LocationSummary* StoreStaticFieldInstr::MakeLocationSummary() const { |
| 1776 LocationSummary* locs = new LocationSummary(1, 1, LocationSummary::kNoCall); | 1782 LocationSummary* locs = new LocationSummary(1, 1, LocationSummary::kNoCall); |
| 1777 locs->set_in(0, value()->NeedsStoreBuffer() ? Location::WritableRegister() | 1783 locs->set_in(0, value()->NeedsStoreBuffer() ? Location::WritableRegister() |
| 1778 : Location::RequiresRegister()); | 1784 : Location::RequiresRegister()); |
| 1779 locs->set_temp(0, Location::RequiresRegister()); | 1785 locs->set_temp(0, Location::RequiresRegister()); |
| 1780 return locs; | 1786 return locs; |
| 1781 } | 1787 } |
| (...skipping 2955 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4737 PcDescriptors::kOther, | 4743 PcDescriptors::kOther, |
| 4738 locs()); | 4744 locs()); |
| 4739 __ Drop(2); // Discard type arguments and receiver. | 4745 __ Drop(2); // Discard type arguments and receiver. |
| 4740 } | 4746 } |
| 4741 | 4747 |
| 4742 } // namespace dart | 4748 } // namespace dart |
| 4743 | 4749 |
| 4744 #undef __ | 4750 #undef __ |
| 4745 | 4751 |
| 4746 #endif // defined TARGET_ARCH_IA32 | 4752 #endif // defined TARGET_ARCH_IA32 |
| OLD | NEW |