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

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

Issue 746623002: Dedupe code for array/object initialization on ARM. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 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 | Annotate | Revision Log
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 1717 matching lines...) Expand 10 before | Expand all | Expand 10 after
1728 int32_t ignored = 0; 1728 int32_t ignored = 0;
1729 if (Address::CanHoldStoreOffset(kWord, offset - kHeapObjectTag, &ignored)) { 1729 if (Address::CanHoldStoreOffset(kWord, offset - kHeapObjectTag, &ignored)) {
1730 StoreIntoObjectNoBarrier(object, FieldAddress(object, offset), value); 1730 StoreIntoObjectNoBarrier(object, FieldAddress(object, offset), value);
1731 } else { 1731 } else {
1732 AddImmediate(IP, object, offset - kHeapObjectTag); 1732 AddImmediate(IP, object, offset - kHeapObjectTag);
1733 StoreIntoObjectNoBarrier(object, Address(IP), value); 1733 StoreIntoObjectNoBarrier(object, Address(IP), value);
1734 } 1734 }
1735 } 1735 }
1736 1736
1737 1737
1738 void Assembler::InitializeFieldsNoBarrier(Register object,
1739 Register begin,
1740 Register end,
1741 Register value_even,
1742 Register value_odd) {
1743 ASSERT(value_odd == value_even + 1);
1744 Label init_loop;
1745 Bind(&init_loop);
1746 AddImmediate(begin, 2 * kWordSize);
1747 cmp(begin, Operand(end));
1748 strd(value_even, Address(begin, -2 * kWordSize), LS);
1749 b(&init_loop, CC);
1750 str(value_even, Address(begin, -2 * kWordSize), HI);
1751 #if defined(DEBUG)
1752 Label done;
1753 StoreIntoObjectFilter(object, value_even, &done);
1754 StoreIntoObjectFilter(object, value_odd, &done);
1755 Stop("Store buffer update is required");
1756 Bind(&done);
1757 #endif // defined(DEBUG)
1758 // No store buffer update.
1759 }
1760
1761
1738 void Assembler::LoadClassId(Register result, Register object, Condition cond) { 1762 void Assembler::LoadClassId(Register result, Register object, Condition cond) {
1739 ASSERT(RawObject::kClassIdTagPos == 16); 1763 ASSERT(RawObject::kClassIdTagPos == 16);
1740 ASSERT(RawObject::kClassIdTagSize == 16); 1764 ASSERT(RawObject::kClassIdTagSize == 16);
1741 const intptr_t class_id_offset = Object::tags_offset() + 1765 const intptr_t class_id_offset = Object::tags_offset() +
1742 RawObject::kClassIdTagPos / kBitsPerByte; 1766 RawObject::kClassIdTagPos / kBitsPerByte;
1743 ldrh(result, FieldAddress(object, class_id_offset), cond); 1767 ldrh(result, FieldAddress(object, class_id_offset), cond);
1744 } 1768 }
1745 1769
1746 1770
1747 void Assembler::LoadClassById(Register result, Register class_id) { 1771 void Assembler::LoadClassById(Register result, Register class_id) {
(...skipping 1674 matching lines...) Expand 10 before | Expand all | Expand 10 after
3422 3446
3423 3447
3424 const char* Assembler::FpuRegisterName(FpuRegister reg) { 3448 const char* Assembler::FpuRegisterName(FpuRegister reg) {
3425 ASSERT((0 <= reg) && (reg < kNumberOfFpuRegisters)); 3449 ASSERT((0 <= reg) && (reg < kNumberOfFpuRegisters));
3426 return fpu_reg_names[reg]; 3450 return fpu_reg_names[reg];
3427 } 3451 }
3428 3452
3429 } // namespace dart 3453 } // namespace dart
3430 3454
3431 #endif // defined TARGET_ARCH_ARM 3455 #endif // defined TARGET_ARCH_ARM
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698