| 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 #ifndef VM_ASSEMBLER_ARM_H_ | 5 #ifndef VM_ASSEMBLER_ARM_H_ |
| 6 #define VM_ASSEMBLER_ARM_H_ | 6 #define VM_ASSEMBLER_ARM_H_ |
| 7 | 7 |
| 8 #ifndef VM_ASSEMBLER_H_ | 8 #ifndef VM_ASSEMBLER_H_ |
| 9 #error Do not include assembler_arm.h directly; use assembler.h instead. | 9 #error Do not include assembler_arm.h directly; use assembler.h instead. |
| 10 #endif | 10 #endif |
| (...skipping 726 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 737 void LoadFunctionFromCalleePool(Register dst, | 737 void LoadFunctionFromCalleePool(Register dst, |
| 738 const Function& function, | 738 const Function& function, |
| 739 Register new_pp); | 739 Register new_pp); |
| 740 void LoadNativeEntry(Register dst, | 740 void LoadNativeEntry(Register dst, |
| 741 const ExternalLabel* label, | 741 const ExternalLabel* label, |
| 742 Patchability patchable, | 742 Patchability patchable, |
| 743 Condition cond = AL); | 743 Condition cond = AL); |
| 744 void PushObject(const Object& object); | 744 void PushObject(const Object& object); |
| 745 void CompareObject(Register rn, const Object& object); | 745 void CompareObject(Register rn, const Object& object); |
| 746 | 746 |
| 747 // When storing into a heap object field, knowledge of the previous content | |
| 748 // is expressed through these constants. | |
| 749 enum FieldContent { | |
| 750 kEmptyOrSmiOrNull, // Empty = garbage/zapped in release/debug mode. | |
| 751 kHeapObjectOrSmi, | |
| 752 kOnlySmi, | |
| 753 }; | |
| 754 | |
| 755 void StoreIntoObject(Register object, // Object we are storing into. | 747 void StoreIntoObject(Register object, // Object we are storing into. |
| 756 const Address& dest, // Where we are storing into. | 748 const Address& dest, // Where we are storing into. |
| 757 Register value, // Value we are storing. | 749 Register value, // Value we are storing. |
| 758 bool can_value_be_smi = true); | 750 bool can_value_be_smi = true); |
| 759 void StoreIntoObjectOffset(Register object, | 751 void StoreIntoObjectOffset(Register object, |
| 760 int32_t offset, | 752 int32_t offset, |
| 761 Register value, | 753 Register value, |
| 762 bool can_value_be_smi = true); | 754 bool can_value_be_smi = true); |
| 763 | 755 |
| 764 void StoreIntoObjectNoBarrier(Register object, | 756 void StoreIntoObjectNoBarrier(Register object, |
| 765 const Address& dest, | 757 const Address& dest, |
| 766 Register value, | 758 Register value); |
| 767 FieldContent old_content = kHeapObjectOrSmi); | |
| 768 void InitializeFieldNoBarrier(Register object, | |
| 769 const Address& dest, | |
| 770 Register value) { | |
| 771 StoreIntoObjectNoBarrier(object, dest, value, kEmptyOrSmiOrNull); | |
| 772 } | |
| 773 void StoreIntoObjectNoBarrierOffset( | |
| 774 Register object, | |
| 775 int32_t offset, | |
| 776 Register value, | |
| 777 FieldContent old_content = kHeapObjectOrSmi); | |
| 778 void StoreIntoObjectNoBarrier(Register object, | 759 void StoreIntoObjectNoBarrier(Register object, |
| 779 const Address& dest, | 760 const Address& dest, |
| 780 const Object& value, | 761 const Object& value); |
| 781 FieldContent old_content = kHeapObjectOrSmi); | 762 void StoreIntoObjectNoBarrierOffset(Register object, |
| 782 void StoreIntoObjectNoBarrierOffset( | 763 int32_t offset, |
| 783 Register object, | 764 Register value); |
| 784 int32_t offset, | 765 void StoreIntoObjectNoBarrierOffset(Register object, |
| 785 const Object& value, | 766 int32_t offset, |
| 786 FieldContent old_content = kHeapObjectOrSmi); | 767 const Object& value); |
| 787 | 768 |
| 788 // Store value_even, value_odd, value_even, ... into the words in the address | 769 // Store value_even, value_odd, value_even, ... into the words in the address |
| 789 // range [begin, end), assumed to be uninitialized fields in object (tagged). | 770 // range [begin, end), assumed to be uninitialized fields in object (tagged). |
| 790 // The stores must not need a generational store barrier (e.g., smi/null), | 771 // The stores must not need a generational store barrier (e.g., smi/null), |
| 791 // and (value_even, value_odd) must be a valid register pair. | 772 // and (value_even, value_odd) must be a valid register pair. |
| 792 // Destroys register 'begin'. | 773 // Destroys register 'begin'. |
| 793 void InitializeFieldsNoBarrier(Register object, | 774 void InitializeFieldsNoBarrier(Register object, |
| 794 Register begin, | 775 Register begin, |
| 795 Register end, | 776 Register end, |
| 796 Register value_even, | 777 Register value_even, |
| (...skipping 389 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1186 int32_t EncodeTstOffset(int32_t offset, int32_t inst); | 1167 int32_t EncodeTstOffset(int32_t offset, int32_t inst); |
| 1187 int32_t DecodeTstOffset(int32_t inst); | 1168 int32_t DecodeTstOffset(int32_t inst); |
| 1188 | 1169 |
| 1189 void StoreIntoObjectFilter(Register object, Register value, Label* no_update); | 1170 void StoreIntoObjectFilter(Register object, Register value, Label* no_update); |
| 1190 | 1171 |
| 1191 // Shorter filtering sequence that assumes that value is not a smi. | 1172 // Shorter filtering sequence that assumes that value is not a smi. |
| 1192 void StoreIntoObjectFilterNoSmi(Register object, | 1173 void StoreIntoObjectFilterNoSmi(Register object, |
| 1193 Register value, | 1174 Register value, |
| 1194 Label* no_update); | 1175 Label* no_update); |
| 1195 | 1176 |
| 1196 // Helpers for write-barrier verification. | |
| 1197 | |
| 1198 // Returns VerifiedMemory::offset() as an Operand. | |
| 1199 Operand GetVerifiedMemoryShadow(); | |
| 1200 // Writes value to [base + offset] and also its shadow location, if enabled. | |
| 1201 void WriteShadowedField(Register base, | |
| 1202 intptr_t offset, | |
| 1203 Register value, | |
| 1204 Condition cond = AL); | |
| 1205 void WriteShadowedFieldPair(Register base, | |
| 1206 intptr_t offset, | |
| 1207 Register value_even, | |
| 1208 Register value_odd, | |
| 1209 Condition cond = AL); | |
| 1210 // Writes new_value to address and its shadow location, if enabled, after | |
| 1211 // verifying that its old value matches its shadow. | |
| 1212 void VerifiedWrite(Register object, | |
| 1213 const Address& address, | |
| 1214 Register new_value, | |
| 1215 FieldContent old_content); | |
| 1216 | |
| 1217 DISALLOW_ALLOCATION(); | 1177 DISALLOW_ALLOCATION(); |
| 1218 DISALLOW_COPY_AND_ASSIGN(Assembler); | 1178 DISALLOW_COPY_AND_ASSIGN(Assembler); |
| 1219 }; | 1179 }; |
| 1220 | 1180 |
| 1221 } // namespace dart | 1181 } // namespace dart |
| 1222 | 1182 |
| 1223 #endif // VM_ASSEMBLER_ARM_H_ | 1183 #endif // VM_ASSEMBLER_ARM_H_ |
| OLD | NEW |