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" // NOLINT | 5 #include "vm/globals.h" // NOLINT |
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 1547 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1558 } | 1558 } |
1559 | 1559 |
1560 | 1560 |
1561 void Assembler::LoadIsolate(Register rd) { | 1561 void Assembler::LoadIsolate(Register rd) { |
1562 ldr(rd, Address(THR, Thread::isolate_offset())); | 1562 ldr(rd, Address(THR, Thread::isolate_offset())); |
1563 } | 1563 } |
1564 | 1564 |
1565 | 1565 |
1566 bool Assembler::CanLoadFromObjectPool(const Object& object) const { | 1566 bool Assembler::CanLoadFromObjectPool(const Object& object) const { |
1567 ASSERT(!object.IsICData() || ICData::Cast(object).IsOriginal()); | 1567 ASSERT(!object.IsICData() || ICData::Cast(object).IsOriginal()); |
| 1568 ASSERT(!object.IsField() || Field::Cast(object).IsOriginal()); |
1568 ASSERT(!Thread::CanLoadFromThread(object)); | 1569 ASSERT(!Thread::CanLoadFromThread(object)); |
1569 if (!constant_pool_allowed()) { | 1570 if (!constant_pool_allowed()) { |
1570 return false; | 1571 return false; |
1571 } | 1572 } |
1572 | 1573 |
1573 ASSERT(object.IsNotTemporaryScopedHandle()); | 1574 ASSERT(object.IsNotTemporaryScopedHandle()); |
1574 ASSERT(object.IsOld()); | 1575 ASSERT(object.IsOld()); |
1575 return true; | 1576 return true; |
1576 } | 1577 } |
1577 | 1578 |
1578 | 1579 |
1579 void Assembler::LoadObjectHelper(Register rd, | 1580 void Assembler::LoadObjectHelper(Register rd, |
1580 const Object& object, | 1581 const Object& object, |
1581 Condition cond, | 1582 Condition cond, |
1582 bool is_unique, | 1583 bool is_unique, |
1583 Register pp) { | 1584 Register pp) { |
1584 ASSERT(!object.IsICData() || ICData::Cast(object).IsOriginal()); | 1585 ASSERT(!object.IsICData() || ICData::Cast(object).IsOriginal()); |
| 1586 ASSERT(!object.IsField() || Field::Cast(object).IsOriginal()); |
1585 // Load common VM constants from the thread. This works also in places where | 1587 // Load common VM constants from the thread. This works also in places where |
1586 // no constant pool is set up (e.g. intrinsic code). | 1588 // no constant pool is set up (e.g. intrinsic code). |
1587 if (Thread::CanLoadFromThread(object)) { | 1589 if (Thread::CanLoadFromThread(object)) { |
1588 // Load common VM constants from the thread. This works also in places where | 1590 // Load common VM constants from the thread. This works also in places where |
1589 // no constant pool is set up (e.g. intrinsic code). | 1591 // no constant pool is set up (e.g. intrinsic code). |
1590 ldr(rd, Address(THR, Thread::OffsetFromThread(object)), cond); | 1592 ldr(rd, Address(THR, Thread::OffsetFromThread(object)), cond); |
1591 } else if (object.IsSmi()) { | 1593 } else if (object.IsSmi()) { |
1592 // Relocation doesn't apply to Smis. | 1594 // Relocation doesn't apply to Smis. |
1593 LoadImmediate(rd, reinterpret_cast<int32_t>(object.raw()), cond); | 1595 LoadImmediate(rd, reinterpret_cast<int32_t>(object.raw()), cond); |
1594 } else if (CanLoadFromObjectPool(object)) { | 1596 } else if (CanLoadFromObjectPool(object)) { |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1634 Patchability patchable, | 1636 Patchability patchable, |
1635 Condition cond) { | 1637 Condition cond) { |
1636 const int32_t offset = ObjectPool::element_offset( | 1638 const int32_t offset = ObjectPool::element_offset( |
1637 object_pool_wrapper_.FindNativeEntry(label, patchable)); | 1639 object_pool_wrapper_.FindNativeEntry(label, patchable)); |
1638 LoadWordFromPoolOffset(rd, offset - kHeapObjectTag, PP, cond); | 1640 LoadWordFromPoolOffset(rd, offset - kHeapObjectTag, PP, cond); |
1639 } | 1641 } |
1640 | 1642 |
1641 | 1643 |
1642 void Assembler::PushObject(const Object& object) { | 1644 void Assembler::PushObject(const Object& object) { |
1643 ASSERT(!object.IsICData() || ICData::Cast(object).IsOriginal()); | 1645 ASSERT(!object.IsICData() || ICData::Cast(object).IsOriginal()); |
| 1646 ASSERT(!object.IsField() || Field::Cast(object).IsOriginal()); |
1644 LoadObject(IP, object); | 1647 LoadObject(IP, object); |
1645 Push(IP); | 1648 Push(IP); |
1646 } | 1649 } |
1647 | 1650 |
1648 | 1651 |
1649 void Assembler::CompareObject(Register rn, const Object& object) { | 1652 void Assembler::CompareObject(Register rn, const Object& object) { |
1650 ASSERT(!object.IsICData() || ICData::Cast(object).IsOriginal()); | 1653 ASSERT(!object.IsICData() || ICData::Cast(object).IsOriginal()); |
| 1654 ASSERT(!object.IsField() || Field::Cast(object).IsOriginal()); |
1651 ASSERT(rn != IP); | 1655 ASSERT(rn != IP); |
1652 if (object.IsSmi()) { | 1656 if (object.IsSmi()) { |
1653 CompareImmediate(rn, reinterpret_cast<int32_t>(object.raw())); | 1657 CompareImmediate(rn, reinterpret_cast<int32_t>(object.raw())); |
1654 } else { | 1658 } else { |
1655 LoadObject(IP, object); | 1659 LoadObject(IP, object); |
1656 cmp(rn, Operand(IP)); | 1660 cmp(rn, Operand(IP)); |
1657 } | 1661 } |
1658 } | 1662 } |
1659 | 1663 |
1660 | 1664 |
(...skipping 239 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1900 StoreIntoObjectNoBarrier(object, Address(IP), value, old_content); | 1904 StoreIntoObjectNoBarrier(object, Address(IP), value, old_content); |
1901 } | 1905 } |
1902 } | 1906 } |
1903 | 1907 |
1904 | 1908 |
1905 void Assembler::StoreIntoObjectNoBarrier(Register object, | 1909 void Assembler::StoreIntoObjectNoBarrier(Register object, |
1906 const Address& dest, | 1910 const Address& dest, |
1907 const Object& value, | 1911 const Object& value, |
1908 FieldContent old_content) { | 1912 FieldContent old_content) { |
1909 ASSERT(!value.IsICData() || ICData::Cast(value).IsOriginal()); | 1913 ASSERT(!value.IsICData() || ICData::Cast(value).IsOriginal()); |
| 1914 ASSERT(!value.IsField() || Field::Cast(value).IsOriginal()); |
1910 ASSERT(value.IsSmi() || value.InVMHeap() || | 1915 ASSERT(value.IsSmi() || value.InVMHeap() || |
1911 (value.IsOld() && value.IsNotTemporaryScopedHandle())); | 1916 (value.IsOld() && value.IsNotTemporaryScopedHandle())); |
1912 // No store buffer update. | 1917 // No store buffer update. |
1913 LoadObject(IP, value); | 1918 LoadObject(IP, value); |
1914 VerifiedWrite(object, dest, IP, old_content); | 1919 VerifiedWrite(object, dest, IP, old_content); |
1915 } | 1920 } |
1916 | 1921 |
1917 | 1922 |
1918 void Assembler::StoreIntoObjectNoBarrierOffset(Register object, | 1923 void Assembler::StoreIntoObjectNoBarrierOffset(Register object, |
1919 int32_t offset, | 1924 int32_t offset, |
1920 const Object& value, | 1925 const Object& value, |
1921 FieldContent old_content) { | 1926 FieldContent old_content) { |
1922 ASSERT(!value.IsICData() || ICData::Cast(value).IsOriginal()); | 1927 ASSERT(!value.IsICData() || ICData::Cast(value).IsOriginal()); |
| 1928 ASSERT(!value.IsField() || Field::Cast(value).IsOriginal()); |
1923 int32_t ignored = 0; | 1929 int32_t ignored = 0; |
1924 if (Address::CanHoldStoreOffset(kWord, offset - kHeapObjectTag, &ignored)) { | 1930 if (Address::CanHoldStoreOffset(kWord, offset - kHeapObjectTag, &ignored)) { |
1925 StoreIntoObjectNoBarrier(object, FieldAddress(object, offset), value, | 1931 StoreIntoObjectNoBarrier(object, FieldAddress(object, offset), value, |
1926 old_content); | 1932 old_content); |
1927 } else { | 1933 } else { |
1928 Register base = object == R9 ? R8 : R9; | 1934 Register base = object == R9 ? R8 : R9; |
1929 Push(base); | 1935 Push(base); |
1930 AddImmediate(base, object, offset - kHeapObjectTag); | 1936 AddImmediate(base, object, offset - kHeapObjectTag); |
1931 StoreIntoObjectNoBarrier(object, Address(base), value, old_content); | 1937 StoreIntoObjectNoBarrier(object, Address(base), value, old_content); |
1932 Pop(base); | 1938 Pop(base); |
(...skipping 1746 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3679 | 3685 |
3680 | 3686 |
3681 const char* Assembler::FpuRegisterName(FpuRegister reg) { | 3687 const char* Assembler::FpuRegisterName(FpuRegister reg) { |
3682 ASSERT((0 <= reg) && (reg < kNumberOfFpuRegisters)); | 3688 ASSERT((0 <= reg) && (reg < kNumberOfFpuRegisters)); |
3683 return fpu_reg_names[reg]; | 3689 return fpu_reg_names[reg]; |
3684 } | 3690 } |
3685 | 3691 |
3686 } // namespace dart | 3692 } // namespace dart |
3687 | 3693 |
3688 #endif // defined TARGET_ARCH_ARM | 3694 #endif // defined TARGET_ARCH_ARM |
OLD | NEW |