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

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

Issue 1409733009: ARM: Fix double use of IP when storing object fields with large offsets. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 1 month 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 | no next file » | 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 1863 matching lines...) Expand 10 before | Expand all | Expand 10 after
1874 1874
1875 void Assembler::StoreIntoObjectNoBarrierOffset(Register object, 1875 void Assembler::StoreIntoObjectNoBarrierOffset(Register object,
1876 int32_t offset, 1876 int32_t offset,
1877 Register value, 1877 Register value,
1878 FieldContent old_content) { 1878 FieldContent old_content) {
1879 int32_t ignored = 0; 1879 int32_t ignored = 0;
1880 if (Address::CanHoldStoreOffset(kWord, offset - kHeapObjectTag, &ignored)) { 1880 if (Address::CanHoldStoreOffset(kWord, offset - kHeapObjectTag, &ignored)) {
1881 StoreIntoObjectNoBarrier(object, FieldAddress(object, offset), value, 1881 StoreIntoObjectNoBarrier(object, FieldAddress(object, offset), value,
1882 old_content); 1882 old_content);
1883 } else { 1883 } else {
1884 AddImmediate(IP, object, offset - kHeapObjectTag); 1884 AddImmediate(IP, object, offset - kHeapObjectTag);
Florian Schneider 2015/11/04 20:58:01 Same issue here?
1885 StoreIntoObjectNoBarrier(object, Address(IP), value, old_content); 1885 StoreIntoObjectNoBarrier(object, Address(IP), value, old_content);
1886 } 1886 }
1887 } 1887 }
1888 1888
1889 1889
1890 void Assembler::StoreIntoObjectNoBarrier(Register object, 1890 void Assembler::StoreIntoObjectNoBarrier(Register object,
1891 const Address& dest, 1891 const Address& dest,
1892 const Object& value, 1892 const Object& value,
1893 FieldContent old_content) { 1893 FieldContent old_content) {
1894 ASSERT(value.IsSmi() || value.InVMHeap() || 1894 ASSERT(value.IsSmi() || value.InVMHeap() ||
1895 (value.IsOld() && value.IsNotTemporaryScopedHandle())); 1895 (value.IsOld() && value.IsNotTemporaryScopedHandle()));
1896 // No store buffer update. 1896 // No store buffer update.
1897 LoadObject(IP, value); 1897 LoadObject(IP, value);
Florian Schneider 2015/11/04 20:58:01 Would it work to select in DEBUG mode a temp regis
1898 VerifiedWrite(dest, IP, old_content); 1898 VerifiedWrite(dest, IP, old_content);
1899 } 1899 }
1900 1900
1901 1901
1902 void Assembler::StoreIntoObjectNoBarrierOffset(Register object, 1902 void Assembler::StoreIntoObjectNoBarrierOffset(Register object,
1903 int32_t offset, 1903 int32_t offset,
1904 const Object& value, 1904 const Object& value,
1905 FieldContent old_content) { 1905 FieldContent old_content) {
1906 int32_t ignored = 0; 1906 int32_t ignored = 0;
1907 if (Address::CanHoldStoreOffset(kWord, offset - kHeapObjectTag, &ignored)) { 1907 if (Address::CanHoldStoreOffset(kWord, offset - kHeapObjectTag, &ignored)) {
1908 StoreIntoObjectNoBarrier(object, FieldAddress(object, offset), value, 1908 StoreIntoObjectNoBarrier(object, FieldAddress(object, offset), value,
1909 old_content); 1909 old_content);
1910 } else { 1910 } else {
1911 AddImmediate(IP, object, offset - kHeapObjectTag); 1911 ASSERT(object != R9);
Florian Schneider 2015/11/04 20:58:01 Not sure if this is always guaranteed: I think you
1912 StoreIntoObjectNoBarrier(object, Address(IP), value, old_content); 1912 Push(R9);
1913 AddImmediate(R9, object, offset - kHeapObjectTag);
1914 StoreIntoObjectNoBarrier(object, Address(R9), value, old_content);
1915 Pop(R9);
1913 } 1916 }
1914 } 1917 }
1915 1918
1916 1919
1917 void Assembler::InitializeFieldsNoBarrier(Register object, 1920 void Assembler::InitializeFieldsNoBarrier(Register object,
1918 Register begin, 1921 Register begin,
1919 Register end, 1922 Register end,
1920 Register value_even, 1923 Register value_even,
1921 Register value_odd) { 1924 Register value_odd) {
1922 ASSERT(value_odd == value_even + 1); 1925 ASSERT(value_odd == value_even + 1);
(...skipping 1720 matching lines...) Expand 10 before | Expand all | Expand 10 after
3643 3646
3644 3647
3645 const char* Assembler::FpuRegisterName(FpuRegister reg) { 3648 const char* Assembler::FpuRegisterName(FpuRegister reg) {
3646 ASSERT((0 <= reg) && (reg < kNumberOfFpuRegisters)); 3649 ASSERT((0 <= reg) && (reg < kNumberOfFpuRegisters));
3647 return fpu_reg_names[reg]; 3650 return fpu_reg_names[reg];
3648 } 3651 }
3649 3652
3650 } // namespace dart 3653 } // namespace dart
3651 3654
3652 #endif // defined TARGET_ARCH_ARM 3655 #endif // defined TARGET_ARCH_ARM
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698