| OLD | NEW |
| 1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 the V8 project authors. All rights reserved. |
| 2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
| 3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
| 4 // met: | 4 // met: |
| 5 // | 5 // |
| 6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
| 7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
| 8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
| 9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
| 10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
| (...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 74 NO_OBJECT_TO_DOUBLE_FLAGS = 0, | 74 NO_OBJECT_TO_DOUBLE_FLAGS = 0, |
| 75 // Object is known to be a non smi. | 75 // Object is known to be a non smi. |
| 76 OBJECT_NOT_SMI = 1 << 0, | 76 OBJECT_NOT_SMI = 1 << 0, |
| 77 // Don't load NaNs or infinities, branch to the non number case instead. | 77 // Don't load NaNs or infinities, branch to the non number case instead. |
| 78 AVOID_NANS_AND_INFINITIES = 1 << 1 | 78 AVOID_NANS_AND_INFINITIES = 1 << 1 |
| 79 }; | 79 }; |
| 80 | 80 |
| 81 | 81 |
| 82 enum RememberedSetAction { EMIT_REMEMBERED_SET, OMIT_REMEMBERED_SET }; | 82 enum RememberedSetAction { EMIT_REMEMBERED_SET, OMIT_REMEMBERED_SET }; |
| 83 enum SmiCheck { INLINE_SMI_CHECK, OMIT_SMI_CHECK }; | 83 enum SmiCheck { INLINE_SMI_CHECK, OMIT_SMI_CHECK }; |
| 84 enum LinkRegisterStatus { kLRHasNotBeenSaved, kLRHasBeenSaved }; |
| 84 | 85 |
| 85 | 86 |
| 86 bool Aliasing(Register r1, Register r2, Register r3, Register r4); | 87 bool Aliasing(Register r1, Register r2, Register r3, Register r4); |
| 87 | 88 |
| 88 | 89 |
| 89 // MacroAssembler implements a collection of frequently used macros. | 90 // MacroAssembler implements a collection of frequently used macros. |
| 90 class MacroAssembler: public Assembler { | 91 class MacroAssembler: public Assembler { |
| 91 public: | 92 public: |
| 92 // The isolate parameter can be NULL if the macro assembler should | 93 // The isolate parameter can be NULL if the macro assembler should |
| 93 // not use isolate-dependent functionality. In this case, it's the | 94 // not use isolate-dependent functionality. In this case, it's the |
| (...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 157 void SmiJumpTable(Register index, Vector<Label*> targets); | 158 void SmiJumpTable(Register index, Vector<Label*> targets); |
| 158 // Load an object from the root table. | 159 // Load an object from the root table. |
| 159 void LoadRoot(Register destination, | 160 void LoadRoot(Register destination, |
| 160 Heap::RootListIndex index, | 161 Heap::RootListIndex index, |
| 161 Condition cond = al); | 162 Condition cond = al); |
| 162 // Store an object to the root table. | 163 // Store an object to the root table. |
| 163 void StoreRoot(Register source, | 164 void StoreRoot(Register source, |
| 164 Heap::RootListIndex index, | 165 Heap::RootListIndex index, |
| 165 Condition cond = al); | 166 Condition cond = al); |
| 166 | 167 |
| 167 // Enters the address into the store buffer. RememberedSetHelper only works | 168 // --------------------------------------------------------------------------- |
| 168 // if the address is not in new space. | 169 // GC Support |
| 169 void RememberedSetHelper(Register address, | 170 |
| 171 void IncrementalMarkingRecordWriteHelper(Register object, |
| 172 Register value, |
| 173 Register address); |
| 174 |
| 175 enum RememberedSetFinalAction { |
| 176 kReturnAtEnd, |
| 177 kFallThroughAtEnd |
| 178 }; |
| 179 |
| 180 // For page containing |object| mark region covering |addr| dirty. |
| 181 // RememberedSetHelper only works if the object is not in new |
| 182 // space. |
| 183 void RememberedSetHelper(Register addr, |
| 170 Register scratch, | 184 Register scratch, |
| 171 SaveFPRegsMode save_fp); | 185 SaveFPRegsMode save_fp, |
| 186 RememberedSetFinalAction and_then); |
| 187 |
| 188 void CheckPageFlag(Register object, |
| 189 Register scratch, |
| 190 MemoryChunk::MemoryChunkFlags flag, |
| 191 Condition cc, |
| 192 Label* condition_met); |
| 172 | 193 |
| 173 // Check if object is in new space. | 194 // Check if object is in new space. |
| 174 // scratch can be object itself, but it will be clobbered. | 195 // scratch can be object itself, but it will be clobbered. |
| 175 void InNewSpace(Register object, | 196 void InNewSpace(Register object, |
| 176 Register scratch, | 197 Register scratch, |
| 177 Condition cond, // eq for new space, ne otherwise. | 198 Condition cond, // eq for new space, ne otherwise. |
| 178 Label* branch); | 199 Label* branch); |
| 179 | 200 |
| 180 void CheckPageFlag(Register object, | 201 // Check if an object has a given incremental marking color. Also uses ecx! |
| 181 Register scratch, | 202 // The color bits are found by splitting the address at the bit offset |
| 182 MemoryChunk::MemoryChunkFlags flag, | 203 // indicated by the mask: bits that are zero in the mask are used for the |
| 183 Condition cc, | 204 // address of the bitmap, and bits that are one in the mask are used for the |
| 184 Label* condition_met); | 205 // index of the bit. |
| 206 void HasColor(Register object, |
| 207 Register scratch0, |
| 208 Register scratch1, |
| 209 Label* has_color, |
| 210 int first_bit, |
| 211 int second_bit); |
| 212 |
| 213 void IsBlack(Register object, |
| 214 Register scratch0, |
| 215 Register scratch1, |
| 216 Label* is_black); |
| 217 |
| 218 // Checks the color of an object. If the object is already grey or black |
| 219 // then we just fall through, since it is already live. If it is white and |
| 220 // we can determine that it doesn't need to be scanned, then we just mark it |
| 221 // black and fall through. For the rest we jump to the label so the |
| 222 // incremental marker can fix its assumptions. |
| 223 void EnsureNotWhite(Register object, |
| 224 Register scratch1, |
| 225 Register scratch2, |
| 226 Label* object_is_white_and_not_data, |
| 227 Label::Distance distance); |
| 228 |
| 229 // Checks whether an object is data-only, ie it does need to be scanned by the |
| 230 // garbage collector. |
| 231 void IsDataObject(Register value, |
| 232 Register scratch, |
| 233 Label* not_data_object, |
| 234 Label::Distance not_data_object_distance); |
| 185 | 235 |
| 186 // Notify the garbage collector that we wrote a pointer into an object. | 236 // Notify the garbage collector that we wrote a pointer into an object. |
| 187 // |object| is the object being stored into, |value| is the object being | 237 // |object| is the object being stored into, |value| is the object being |
| 188 // stored. All registers are clobbered by the operation. RecordWriteField | 238 // stored. All registers are clobbered by the operation. RecordWriteField |
| 189 // filters out smis so it does not update the write barrier if the value is a | 239 // filters out smis so it does not update the write barrier if the value is a |
| 190 // smi. The offset is the offset from the start of the object, not the offset | 240 // smi. The offset is the offset from the start of the object, not the offset |
| 191 // from the tagged HeapObject pointer. For use with | 241 // from the tagged HeapObject pointer. For use with |
| 192 // FieldMemOperand(reg, off) | 242 // FieldMemOperand(reg, off) |
| 193 void RecordWriteField( | 243 void RecordWriteField( |
| 194 Register object, | 244 Register object, |
| 195 int offset, | 245 int offset, |
| 196 Register value, | 246 Register value, |
| 197 Register scratch, | 247 Register scratch, |
| 248 LinkRegisterStatus lr_status, |
| 198 SaveFPRegsMode save_fp, | 249 SaveFPRegsMode save_fp, |
| 199 RememberedSetAction remembered_set_action = EMIT_REMEMBERED_SET, | 250 RememberedSetAction remembered_set_action = EMIT_REMEMBERED_SET, |
| 200 SmiCheck smi_check = INLINE_SMI_CHECK); | 251 SmiCheck smi_check = INLINE_SMI_CHECK); |
| 201 | 252 |
| 202 // As above, but the offset has the tag presubtracted. For use with | 253 // As above, but the offset has the tag presubtracted. For use with |
| 203 // MemOperand(reg, off). | 254 // MemOperand(reg, off). |
| 204 inline void RecordWriteContextSlot( | 255 inline void RecordWriteContextSlot( |
| 205 Register context, | 256 Register context, |
| 206 int offset, | 257 int offset, |
| 207 Register value, | 258 Register value, |
| 208 Register scratch, | 259 Register scratch, |
| 260 LinkRegisterStatus lr_status, |
| 209 SaveFPRegsMode save_fp, | 261 SaveFPRegsMode save_fp, |
| 210 RememberedSetAction remembered_set_action = EMIT_REMEMBERED_SET, | 262 RememberedSetAction remembered_set_action = EMIT_REMEMBERED_SET, |
| 211 SmiCheck smi_check = INLINE_SMI_CHECK) { | 263 SmiCheck smi_check = INLINE_SMI_CHECK) { |
| 212 RecordWriteField(context, | 264 RecordWriteField(context, |
| 213 offset + kHeapObjectTag, | 265 offset + kHeapObjectTag, |
| 214 value, | 266 value, |
| 215 scratch, | 267 scratch, |
| 268 lr_status, |
| 216 save_fp, | 269 save_fp, |
| 217 remembered_set_action, | 270 remembered_set_action, |
| 218 smi_check); | 271 smi_check); |
| 219 } | 272 } |
| 220 | 273 |
| 221 // For a given |object| notify the garbage collector that the slot |address| | 274 // For a given |object| notify the garbage collector that the slot |address| |
| 222 // has been written. |value| is the object being stored. The value and | 275 // has been written. |value| is the object being stored. The value and |
| 223 // address registers are clobbered by the operation. | 276 // address registers are clobbered by the operation. |
| 224 void RecordWrite( | 277 void RecordWrite( |
| 225 Register object, | 278 Register object, |
| 226 Register address, | 279 Register address, |
| 227 Register value, | 280 Register value, |
| 281 LinkRegisterStatus lr_status, |
| 228 SaveFPRegsMode save_fp, | 282 SaveFPRegsMode save_fp, |
| 229 RememberedSetAction remembered_set_action = EMIT_REMEMBERED_SET, | 283 RememberedSetAction remembered_set_action = EMIT_REMEMBERED_SET, |
| 230 SmiCheck smi_check = INLINE_SMI_CHECK); | 284 SmiCheck smi_check = INLINE_SMI_CHECK); |
| 231 | 285 |
| 232 // Push two registers. Pushes leftmost register first (to highest address). | 286 // Push two registers. Pushes leftmost register first (to highest address). |
| 233 void Push(Register src1, Register src2, Condition cond = al) { | 287 void Push(Register src1, Register src2, Condition cond = al) { |
| 234 ASSERT(!src1.is(src2)); | 288 ASSERT(!src1.is(src2)); |
| 235 if (src1.code() > src2.code()) { | 289 if (src1.code() > src2.code()) { |
| 236 stm(db_w, sp, src1.bit() | src2.bit(), cond); | 290 stm(db_w, sp, src1.bit() | src2.bit(), cond); |
| 237 } else { | 291 } else { |
| (...skipping 841 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1079 // Activation support. | 1133 // Activation support. |
| 1080 void EnterFrame(StackFrame::Type type); | 1134 void EnterFrame(StackFrame::Type type); |
| 1081 void LeaveFrame(StackFrame::Type type); | 1135 void LeaveFrame(StackFrame::Type type); |
| 1082 | 1136 |
| 1083 void InitializeNewString(Register string, | 1137 void InitializeNewString(Register string, |
| 1084 Register length, | 1138 Register length, |
| 1085 Heap::RootListIndex map_index, | 1139 Heap::RootListIndex map_index, |
| 1086 Register scratch1, | 1140 Register scratch1, |
| 1087 Register scratch2); | 1141 Register scratch2); |
| 1088 | 1142 |
| 1143 // Helper for finding the mark bits for an address. Afterwards, the |
| 1144 // bitmap register points at the word with the mark bits and the mask |
| 1145 // the position of the first bit. Uses ecx as scratch and leaves addr_reg |
| 1146 // unchanged. |
| 1147 inline void GetMarkBits(Register addr_reg, |
| 1148 Register bitmap_reg, |
| 1149 Register mask_reg); |
| 1150 |
| 1089 // Compute memory operands for safepoint stack slots. | 1151 // Compute memory operands for safepoint stack slots. |
| 1090 static int SafepointRegisterStackIndex(int reg_code); | 1152 static int SafepointRegisterStackIndex(int reg_code); |
| 1091 MemOperand SafepointRegisterSlot(Register reg); | 1153 MemOperand SafepointRegisterSlot(Register reg); |
| 1092 MemOperand SafepointRegistersAndDoublesSlot(Register reg); | 1154 MemOperand SafepointRegistersAndDoublesSlot(Register reg); |
| 1093 | 1155 |
| 1094 bool generating_stub_; | 1156 bool generating_stub_; |
| 1095 bool allow_stub_calls_; | 1157 bool allow_stub_calls_; |
| 1096 // This handle will be patched with the code object on installation. | 1158 // This handle will be patched with the code object on installation. |
| 1097 Handle<Object> code_object_; | 1159 Handle<Object> code_object_; |
| 1098 | 1160 |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1154 #define __FILE_LINE__ __FILE__ ":" CODE_COVERAGE_TOSTRING(__LINE__) | 1216 #define __FILE_LINE__ __FILE__ ":" CODE_COVERAGE_TOSTRING(__LINE__) |
| 1155 #define ACCESS_MASM(masm) masm->stop(__FILE_LINE__); masm-> | 1217 #define ACCESS_MASM(masm) masm->stop(__FILE_LINE__); masm-> |
| 1156 #else | 1218 #else |
| 1157 #define ACCESS_MASM(masm) masm-> | 1219 #define ACCESS_MASM(masm) masm-> |
| 1158 #endif | 1220 #endif |
| 1159 | 1221 |
| 1160 | 1222 |
| 1161 } } // namespace v8::internal | 1223 } } // namespace v8::internal |
| 1162 | 1224 |
| 1163 #endif // V8_ARM_MACRO_ASSEMBLER_ARM_H_ | 1225 #endif // V8_ARM_MACRO_ASSEMBLER_ARM_H_ |
| OLD | NEW |