Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(13)

Side by Side Diff: runtime/vm/assembler_arm.cc

Issue 339593002: Fix bug in ARM instance field stores. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « runtime/vm/assembler_arm.h ('k') | runtime/vm/flow_graph_compiler_arm.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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" 5 #include "vm/globals.h"
6 #if defined(TARGET_ARCH_ARM) 6 #if defined(TARGET_ARCH_ARM)
7 7
8 #include "vm/assembler.h" 8 #include "vm/assembler.h"
9 #include "vm/cpu.h" 9 #include "vm/cpu.h"
10 #include "vm/longjump.h" 10 #include "vm/longjump.h"
(...skipping 1603 matching lines...) Expand 10 before | Expand all | Expand 10 after
1614 PushList(regs); 1614 PushList(regs);
1615 if (object != R0) { 1615 if (object != R0) {
1616 mov(R0, Operand(object)); 1616 mov(R0, Operand(object));
1617 } 1617 }
1618 BranchLink(&StubCode::UpdateStoreBufferLabel()); 1618 BranchLink(&StubCode::UpdateStoreBufferLabel());
1619 PopList(regs); 1619 PopList(regs);
1620 Bind(&done); 1620 Bind(&done);
1621 } 1621 }
1622 1622
1623 1623
1624 void Assembler::StoreIntoObjectOffset(Register object,
1625 int32_t offset,
1626 Register value,
1627 bool can_value_be_smi) {
1628 int32_t ignored = 0;
1629 if (Address::CanHoldStoreOffset(kWord, offset - kHeapObjectTag, &ignored)) {
1630 StoreIntoObject(
1631 object, FieldAddress(object, offset), value, can_value_be_smi);
1632 } else {
1633 AddImmediate(IP, object, offset - kHeapObjectTag);
1634 StoreIntoObject(object, Address(IP), value, can_value_be_smi);
1635 }
1636 }
1637
1638
1624 void Assembler::StoreIntoObjectNoBarrier(Register object, 1639 void Assembler::StoreIntoObjectNoBarrier(Register object,
1625 const Address& dest, 1640 const Address& dest,
1626 Register value) { 1641 Register value) {
1627 str(value, dest); 1642 str(value, dest);
1628 #if defined(DEBUG) 1643 #if defined(DEBUG)
1629 Label done; 1644 Label done;
1630 StoreIntoObjectFilter(object, value, &done); 1645 StoreIntoObjectFilter(object, value, &done);
1631 Stop("Store buffer update is required"); 1646 Stop("Store buffer update is required");
1632 Bind(&done); 1647 Bind(&done);
1633 #endif // defined(DEBUG) 1648 #endif // defined(DEBUG)
1634 // No store buffer update. 1649 // No store buffer update.
1635 } 1650 }
1636 1651
1637 1652
1653 void Assembler::StoreIntoObjectNoBarrierOffset(Register object,
1654 int32_t offset,
1655 Register value) {
1656 int32_t ignored = 0;
1657 if (Address::CanHoldStoreOffset(kWord, offset - kHeapObjectTag, &ignored)) {
1658 StoreIntoObjectNoBarrier(object, FieldAddress(object, offset), value);
1659 } else {
1660 AddImmediate(IP, object, offset - kHeapObjectTag);
1661 StoreIntoObjectNoBarrier(object, Address(IP), value);
1662 }
1663 }
1664
1665
1638 void Assembler::StoreIntoObjectNoBarrier(Register object, 1666 void Assembler::StoreIntoObjectNoBarrier(Register object,
1639 const Address& dest, 1667 const Address& dest,
1640 const Object& value) { 1668 const Object& value) {
1641 ASSERT(value.IsSmi() || value.InVMHeap() || 1669 ASSERT(value.IsSmi() || value.InVMHeap() ||
1642 (value.IsOld() && value.IsNotTemporaryScopedHandle())); 1670 (value.IsOld() && value.IsNotTemporaryScopedHandle()));
1643 // No store buffer update. 1671 // No store buffer update.
1644 LoadObject(IP, value); 1672 LoadObject(IP, value);
1645 str(IP, dest); 1673 str(IP, dest);
1646 } 1674 }
1647 1675
1648 1676
1677 void Assembler::StoreIntoObjectNoBarrierOffset(Register object,
1678 int32_t offset,
1679 const Object& value) {
1680 int32_t ignored = 0;
1681 if (Address::CanHoldStoreOffset(kWord, offset - kHeapObjectTag, &ignored)) {
1682 StoreIntoObjectNoBarrier(object, FieldAddress(object, offset), value);
1683 } else {
1684 AddImmediate(IP, object, offset - kHeapObjectTag);
1685 StoreIntoObjectNoBarrier(object, Address(IP), value);
1686 }
1687 }
1688
1689
1649 void Assembler::LoadClassId(Register result, Register object, Condition cond) { 1690 void Assembler::LoadClassId(Register result, Register object, Condition cond) {
1650 ASSERT(RawObject::kClassIdTagPos == 16); 1691 ASSERT(RawObject::kClassIdTagPos == 16);
1651 ASSERT(RawObject::kClassIdTagSize == 16); 1692 ASSERT(RawObject::kClassIdTagSize == 16);
1652 const intptr_t class_id_offset = Object::tags_offset() + 1693 const intptr_t class_id_offset = Object::tags_offset() +
1653 RawObject::kClassIdTagPos / kBitsPerByte; 1694 RawObject::kClassIdTagPos / kBitsPerByte;
1654 ldrh(result, FieldAddress(object, class_id_offset), cond); 1695 ldrh(result, FieldAddress(object, class_id_offset), cond);
1655 } 1696 }
1656 1697
1657 1698
1658 void Assembler::LoadClassById(Register result, Register class_id) { 1699 void Assembler::LoadClassById(Register result, Register class_id) {
(...skipping 1540 matching lines...) Expand 10 before | Expand all | Expand 10 after
3199 3240
3200 3241
3201 const char* Assembler::FpuRegisterName(FpuRegister reg) { 3242 const char* Assembler::FpuRegisterName(FpuRegister reg) {
3202 ASSERT((0 <= reg) && (reg < kNumberOfFpuRegisters)); 3243 ASSERT((0 <= reg) && (reg < kNumberOfFpuRegisters));
3203 return fpu_reg_names[reg]; 3244 return fpu_reg_names[reg];
3204 } 3245 }
3205 3246
3206 } // namespace dart 3247 } // namespace dart
3207 3248
3208 #endif // defined TARGET_ARCH_ARM 3249 #endif // defined TARGET_ARCH_ARM
OLDNEW
« no previous file with comments | « runtime/vm/assembler_arm.h ('k') | runtime/vm/flow_graph_compiler_arm.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698