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

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

Issue 1544583002: For background compilation we copy ICData so that it is immutable during comnpilation. However, we … (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: remove flag Created 5 years 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
« no previous file with comments | « no previous file | runtime/vm/assembler_arm64.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" // 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 1544 matching lines...) Expand 10 before | Expand all | Expand 10 after
1555 set_constant_pool_allowed(reg == PP); 1555 set_constant_pool_allowed(reg == PP);
1556 } 1556 }
1557 1557
1558 1558
1559 void Assembler::LoadIsolate(Register rd) { 1559 void Assembler::LoadIsolate(Register rd) {
1560 ldr(rd, Address(THR, Thread::isolate_offset())); 1560 ldr(rd, Address(THR, Thread::isolate_offset()));
1561 } 1561 }
1562 1562
1563 1563
1564 bool Assembler::CanLoadFromObjectPool(const Object& object) const { 1564 bool Assembler::CanLoadFromObjectPool(const Object& object) const {
1565 ASSERT(!object.IsICData() || ICData::Cast(object).IsOriginal());
1565 ASSERT(!Thread::CanLoadFromThread(object)); 1566 ASSERT(!Thread::CanLoadFromThread(object));
1566 if (!constant_pool_allowed()) { 1567 if (!constant_pool_allowed()) {
1567 return false; 1568 return false;
1568 } 1569 }
1569 1570
1570 ASSERT(object.IsNotTemporaryScopedHandle()); 1571 ASSERT(object.IsNotTemporaryScopedHandle());
1571 ASSERT(object.IsOld()); 1572 ASSERT(object.IsOld());
1572 return true; 1573 return true;
1573 } 1574 }
1574 1575
1575 1576
1576 void Assembler::LoadObjectHelper(Register rd, 1577 void Assembler::LoadObjectHelper(Register rd,
1577 const Object& object, 1578 const Object& object,
1578 Condition cond, 1579 Condition cond,
1579 bool is_unique, 1580 bool is_unique,
1580 Register pp) { 1581 Register pp) {
1582 ASSERT(!object.IsICData() || ICData::Cast(object).IsOriginal());
1581 // Load common VM constants from the thread. This works also in places where 1583 // Load common VM constants from the thread. This works also in places where
1582 // no constant pool is set up (e.g. intrinsic code). 1584 // no constant pool is set up (e.g. intrinsic code).
1583 if (Thread::CanLoadFromThread(object)) { 1585 if (Thread::CanLoadFromThread(object)) {
1584 // Load common VM constants from the thread. This works also in places where 1586 // Load common VM constants from the thread. This works also in places where
1585 // no constant pool is set up (e.g. intrinsic code). 1587 // no constant pool is set up (e.g. intrinsic code).
1586 ldr(rd, Address(THR, Thread::OffsetFromThread(object)), cond); 1588 ldr(rd, Address(THR, Thread::OffsetFromThread(object)), cond);
1587 } else if (object.IsSmi()) { 1589 } else if (object.IsSmi()) {
1588 // Relocation doesn't apply to Smis. 1590 // Relocation doesn't apply to Smis.
1589 LoadImmediate(rd, reinterpret_cast<int32_t>(object.raw()), cond); 1591 LoadImmediate(rd, reinterpret_cast<int32_t>(object.raw()), cond);
1590 } else if (CanLoadFromObjectPool(object)) { 1592 } else if (CanLoadFromObjectPool(object)) {
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
1629 const ExternalLabel* label, 1631 const ExternalLabel* label,
1630 Patchability patchable, 1632 Patchability patchable,
1631 Condition cond) { 1633 Condition cond) {
1632 const int32_t offset = ObjectPool::element_offset( 1634 const int32_t offset = ObjectPool::element_offset(
1633 object_pool_wrapper_.FindNativeEntry(label, patchable)); 1635 object_pool_wrapper_.FindNativeEntry(label, patchable));
1634 LoadWordFromPoolOffset(rd, offset - kHeapObjectTag, PP, cond); 1636 LoadWordFromPoolOffset(rd, offset - kHeapObjectTag, PP, cond);
1635 } 1637 }
1636 1638
1637 1639
1638 void Assembler::PushObject(const Object& object) { 1640 void Assembler::PushObject(const Object& object) {
1641 ASSERT(!object.IsICData() || ICData::Cast(object).IsOriginal());
1639 LoadObject(IP, object); 1642 LoadObject(IP, object);
1640 Push(IP); 1643 Push(IP);
1641 } 1644 }
1642 1645
1643 1646
1644 void Assembler::CompareObject(Register rn, const Object& object) { 1647 void Assembler::CompareObject(Register rn, const Object& object) {
1648 ASSERT(!object.IsICData() || ICData::Cast(object).IsOriginal());
1645 ASSERT(rn != IP); 1649 ASSERT(rn != IP);
1646 if (object.IsSmi()) { 1650 if (object.IsSmi()) {
1647 CompareImmediate(rn, reinterpret_cast<int32_t>(object.raw())); 1651 CompareImmediate(rn, reinterpret_cast<int32_t>(object.raw()));
1648 } else { 1652 } else {
1649 LoadObject(IP, object); 1653 LoadObject(IP, object);
1650 cmp(rn, Operand(IP)); 1654 cmp(rn, Operand(IP));
1651 } 1655 }
1652 } 1656 }
1653 1657
1654 1658
(...skipping 238 matching lines...) Expand 10 before | Expand all | Expand 10 after
1893 AddImmediate(IP, object, offset - kHeapObjectTag); 1897 AddImmediate(IP, object, offset - kHeapObjectTag);
1894 StoreIntoObjectNoBarrier(object, Address(IP), value, old_content); 1898 StoreIntoObjectNoBarrier(object, Address(IP), value, old_content);
1895 } 1899 }
1896 } 1900 }
1897 1901
1898 1902
1899 void Assembler::StoreIntoObjectNoBarrier(Register object, 1903 void Assembler::StoreIntoObjectNoBarrier(Register object,
1900 const Address& dest, 1904 const Address& dest,
1901 const Object& value, 1905 const Object& value,
1902 FieldContent old_content) { 1906 FieldContent old_content) {
1907 ASSERT(!value.IsICData() || ICData::Cast(value).IsOriginal());
1903 ASSERT(value.IsSmi() || value.InVMHeap() || 1908 ASSERT(value.IsSmi() || value.InVMHeap() ||
1904 (value.IsOld() && value.IsNotTemporaryScopedHandle())); 1909 (value.IsOld() && value.IsNotTemporaryScopedHandle()));
1905 // No store buffer update. 1910 // No store buffer update.
1906 LoadObject(IP, value); 1911 LoadObject(IP, value);
1907 VerifiedWrite(object, dest, IP, old_content); 1912 VerifiedWrite(object, dest, IP, old_content);
1908 } 1913 }
1909 1914
1910 1915
1911 void Assembler::StoreIntoObjectNoBarrierOffset(Register object, 1916 void Assembler::StoreIntoObjectNoBarrierOffset(Register object,
1912 int32_t offset, 1917 int32_t offset,
1913 const Object& value, 1918 const Object& value,
1914 FieldContent old_content) { 1919 FieldContent old_content) {
1920 ASSERT(!value.IsICData() || ICData::Cast(value).IsOriginal());
1915 int32_t ignored = 0; 1921 int32_t ignored = 0;
1916 if (Address::CanHoldStoreOffset(kWord, offset - kHeapObjectTag, &ignored)) { 1922 if (Address::CanHoldStoreOffset(kWord, offset - kHeapObjectTag, &ignored)) {
1917 StoreIntoObjectNoBarrier(object, FieldAddress(object, offset), value, 1923 StoreIntoObjectNoBarrier(object, FieldAddress(object, offset), value,
1918 old_content); 1924 old_content);
1919 } else { 1925 } else {
1920 Register base = object == R9 ? R8 : R9; 1926 Register base = object == R9 ? R8 : R9;
1921 Push(base); 1927 Push(base);
1922 AddImmediate(base, object, offset - kHeapObjectTag); 1928 AddImmediate(base, object, offset - kHeapObjectTag);
1923 StoreIntoObjectNoBarrier(object, Address(base), value, old_content); 1929 StoreIntoObjectNoBarrier(object, Address(base), value, old_content);
1924 Pop(base); 1930 Pop(base);
(...skipping 1731 matching lines...) Expand 10 before | Expand all | Expand 10 after
3656 3662
3657 3663
3658 const char* Assembler::FpuRegisterName(FpuRegister reg) { 3664 const char* Assembler::FpuRegisterName(FpuRegister reg) {
3659 ASSERT((0 <= reg) && (reg < kNumberOfFpuRegisters)); 3665 ASSERT((0 <= reg) && (reg < kNumberOfFpuRegisters));
3660 return fpu_reg_names[reg]; 3666 return fpu_reg_names[reg];
3661 } 3667 }
3662 3668
3663 } // namespace dart 3669 } // namespace dart
3664 3670
3665 #endif // defined TARGET_ARCH_ARM 3671 #endif // defined TARGET_ARCH_ARM
OLDNEW
« no previous file with comments | « no previous file | runtime/vm/assembler_arm64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698