| 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 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 135 void LoadRootIndexed(Register destination, | 135 void LoadRootIndexed(Register destination, |
| 136 Register variable_offset, | 136 Register variable_offset, |
| 137 int fixed_offset); | 137 int fixed_offset); |
| 138 void CompareRoot(Register with, Heap::RootListIndex index); | 138 void CompareRoot(Register with, Heap::RootListIndex index); |
| 139 void CompareRoot(const Operand& with, Heap::RootListIndex index); | 139 void CompareRoot(const Operand& with, Heap::RootListIndex index); |
| 140 void PushRoot(Heap::RootListIndex index); | 140 void PushRoot(Heap::RootListIndex index); |
| 141 | 141 |
| 142 // --------------------------------------------------------------------------- | 142 // --------------------------------------------------------------------------- |
| 143 // GC Support | 143 // GC Support |
| 144 | 144 |
| 145 // For page containing |object| mark region covering |addr| dirty. | 145 enum RememberedSetFinalAction { |
| 146 // RecordWriteHelper only works if the object is not in new | 146 kReturnAtEnd, |
| 147 // space. | 147 kFallThroughAtEnd |
| 148 void RecordWriteHelper(Register object, | 148 }; |
| 149 Register addr, | 149 |
| 150 Register scratch, | 150 // Record in the remembered set the fact that we have a pointer to new space |
| 151 SaveFPRegsMode save_fp); | 151 // at the address pointed to by the addr register. Only works if addr is not |
| 152 // in new space. |
| 153 void RememberedSetHelper(Register addr, |
| 154 Register scratch, |
| 155 SaveFPRegsMode save_fp, |
| 156 RememberedSetFinalAction and_then); |
| 157 |
| 158 void CheckPageFlag(Register object, |
| 159 Register scratch, |
| 160 MemoryChunk::MemoryChunkFlags flag, |
| 161 Condition cc, |
| 162 Label* condition_met, |
| 163 Label::Distance condition_met_distance = Label::kFar); |
| 152 | 164 |
| 153 // Check if object is in new space. The condition cc can be equal or | 165 // Check if object is in new space. The condition cc can be equal or |
| 154 // not_equal. If it is equal a jump will be done if the object is on new | 166 // not_equal. If it is equal a jump will be done if the object is on new |
| 155 // space. The register scratch can be object itself, but it will be clobbered. | 167 // space. The register scratch can be object itself, but it will be clobbered. |
| 156 void InNewSpace(Register object, | 168 void InNewSpace(Register object, |
| 157 Register scratch, | 169 Register scratch, |
| 158 Condition cc, | 170 Condition cc, |
| 159 Label* branch, | 171 Label* branch, |
| 160 Label::Distance near_jump = Label::kFar); | 172 Label::Distance near_jump = Label::kFar); |
| 161 | 173 |
| 162 // For page containing |object| mark region covering [object+offset] | 174 // Notify the garbage collector that we wrote a pointer into an object. |
| 163 // dirty. |object| is the object being stored into, |value| is the | 175 // |object| is the object being stored into, |value| is the object being |
| 164 // object being stored. If |offset| is zero, then the |scratch| | 176 // stored. value and scratch registers are clobbered by the operation. |
| 165 // register contains the array index into the elements array | 177 // The offset is the offset from the start of the object, not the offset from |
| 166 // represented as an untagged 32-bit integer. All registers are | 178 // the tagged HeapObject pointer. For use with FieldOperand(reg, off). |
| 167 // clobbered by the operation. RecordWrite filters out smis so it | 179 void RecordWriteField( |
| 168 // does not update the write barrier if the value is a smi. | 180 Register object, |
| 169 void RecordWrite(Register object, | 181 int offset, |
| 170 int offset, | 182 Register value, |
| 171 Register value, | 183 Register scratch, |
| 172 Register scratch, | 184 SaveFPRegsMode save_fp, |
| 173 SaveFPRegsMode save_fp); | 185 RememberedSetAction remembered_set_action = EMIT_REMEMBERED_SET, |
| 186 SmiCheck smi_check = INLINE_SMI_CHECK); |
| 187 |
| 188 // As above, but the offset has the tag presubtracted. For use with |
| 189 // Operand(reg, off). |
| 190 void RecordWriteContextSlot( |
| 191 Register context, |
| 192 int offset, |
| 193 Register value, |
| 194 Register scratch, |
| 195 SaveFPRegsMode save_fp, |
| 196 RememberedSetAction remembered_set_action = EMIT_REMEMBERED_SET, |
| 197 SmiCheck smi_check = INLINE_SMI_CHECK) { |
| 198 RecordWriteField(context, |
| 199 offset + kHeapObjectTag, |
| 200 value, |
| 201 scratch, |
| 202 save_fp, |
| 203 remembered_set_action, |
| 204 smi_check); |
| 205 } |
| 206 |
| 207 // Notify the garbage collector that we wrote a pointer into a fixed array. |
| 208 // |array| is the array being stored into, |value| is the |
| 209 // object being stored. |index| is the array index represented as a |
| 210 // Smi. All registers are clobbered by the operation RecordWriteArray |
| 211 // filters out smis so it does not update the write barrier if the |
| 212 // value is a smi. |
| 213 void RecordWriteArray( |
| 214 Register array, |
| 215 Register value, |
| 216 Register index, |
| 217 SaveFPRegsMode save_fp, |
| 218 RememberedSetAction remembered_set_action = EMIT_REMEMBERED_SET, |
| 219 SmiCheck smi_check = INLINE_SMI_CHECK); |
| 174 | 220 |
| 175 // For page containing |object| mark region covering [address] | 221 // For page containing |object| mark region covering [address] |
| 176 // dirty. |object| is the object being stored into, |value| is the | 222 // dirty. |object| is the object being stored into, |value| is the |
| 177 // object being stored. All registers are clobbered by the | 223 // object being stored. All registers are clobbered by the |
| 178 // operation. RecordWrite filters out smis so it does not update | 224 // operation. RecordWrite filters out smis so it does not update |
| 179 // the write barrier if the value is a smi. | 225 // the write barrier if the value is a smi. |
| 180 void RecordWrite(Register object, | 226 void RecordWrite( |
| 181 Register address, | 227 Register object, |
| 182 Register value, | 228 Register address, |
| 183 SaveFPRegsMode save_fp); | 229 Register value, |
| 184 | 230 SaveFPRegsMode save_fp, |
| 185 // For page containing |object| mark region covering [object+offset] dirty. | 231 RememberedSetAction remembered_set_action = EMIT_REMEMBERED_SET, |
| 186 // The value is known to not be a smi. | 232 SmiCheck smi_check = INLINE_SMI_CHECK); |
| 187 // object is the object being stored into, value is the object being stored. | |
| 188 // If offset is zero, then the scratch register contains the array index into | |
| 189 // the elements array represented as an untagged 32-bit integer. | |
| 190 // All registers are clobbered by the operation. | |
| 191 void RecordWriteNonSmi(Register object, | |
| 192 int offset, | |
| 193 Register value, | |
| 194 Register scratch, | |
| 195 SaveFPRegsMode save_fp); | |
| 196 | 233 |
| 197 #ifdef ENABLE_DEBUGGER_SUPPORT | 234 #ifdef ENABLE_DEBUGGER_SUPPORT |
| 198 // --------------------------------------------------------------------------- | 235 // --------------------------------------------------------------------------- |
| 199 // Debugger Support | 236 // Debugger Support |
| 200 | 237 |
| 201 void DebugBreak(); | 238 void DebugBreak(); |
| 202 #endif | 239 #endif |
| 203 | 240 |
| 204 // --------------------------------------------------------------------------- | 241 // --------------------------------------------------------------------------- |
| 205 // Activation frames | 242 // Activation frames |
| (...skipping 1084 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1290 masm->popfd(); \ | 1327 masm->popfd(); \ |
| 1291 } \ | 1328 } \ |
| 1292 masm-> | 1329 masm-> |
| 1293 #else | 1330 #else |
| 1294 #define ACCESS_MASM(masm) masm-> | 1331 #define ACCESS_MASM(masm) masm-> |
| 1295 #endif | 1332 #endif |
| 1296 | 1333 |
| 1297 } } // namespace v8::internal | 1334 } } // namespace v8::internal |
| 1298 | 1335 |
| 1299 #endif // V8_X64_MACRO_ASSEMBLER_X64_H_ | 1336 #endif // V8_X64_MACRO_ASSEMBLER_X64_H_ |
| OLD | NEW |