Chromium Code Reviews| 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 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 132 // Load a root value where the index (or part of it) is variable. | 132 // Load a root value where the index (or part of it) is variable. |
| 133 // The variable_offset register is added to the fixed_offset value | 133 // The variable_offset register is added to the fixed_offset value |
| 134 // to get the index into the root-array. | 134 // to get the index into the root-array. |
| 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 // These functions do not arrange the registers in any particular order so | |
| 143 // they are not useful for calls that can cause a GC. The caller can | |
| 144 // exclude up to 3 registers that do not need to be saved and restored. | |
| 145 void PushCallerSaved(SaveFPRegsMode fp_mode, | |
| 146 Register exclusion1 = no_reg, | |
| 147 Register exclusion2 = no_reg, | |
| 148 Register exclusion3 = no_reg); | |
| 149 void PopCallerSaved(SaveFPRegsMode fp_mode, | |
| 150 Register exclusion1 = no_reg, | |
| 151 Register exclusion2 = no_reg, | |
| 152 Register exclusion3 = no_reg); | |
| 153 | |
| 142 // --------------------------------------------------------------------------- | 154 // --------------------------------------------------------------------------- |
| 143 // GC Support | 155 // GC Support |
| 144 | 156 |
| 145 enum RememberedSetFinalAction { | 157 enum RememberedSetFinalAction { |
| 146 kReturnAtEnd, | 158 kReturnAtEnd, |
| 147 kFallThroughAtEnd | 159 kFallThroughAtEnd |
| 148 }; | 160 }; |
| 149 | 161 |
| 150 // Record in the remembered set the fact that we have a pointer to new space | 162 // Record in the remembered set the fact that we have a pointer to new space |
| 151 // at the address pointed to by the addr register. Only works if addr is not | 163 // at the address pointed to by the addr register. Only works if addr is not |
| 152 // in new space. | 164 // in new space. |
| 153 void RememberedSetHelper(Register addr, | 165 void RememberedSetHelper(Register addr, |
| 154 Register scratch, | 166 Register scratch, |
| 155 SaveFPRegsMode save_fp, | 167 SaveFPRegsMode save_fp, |
| 156 RememberedSetFinalAction and_then); | 168 RememberedSetFinalAction and_then); |
| 157 | 169 |
| 158 void CheckPageFlag(Register object, | 170 void CheckPageFlag(Register object, |
| 159 Register scratch, | 171 Register scratch, |
| 160 MemoryChunk::MemoryChunkFlags flag, | 172 MemoryChunk::MemoryChunkFlags flag, |
| 161 Condition cc, | 173 Condition cc, |
| 162 Label* condition_met, | 174 Label* condition_met, |
| 163 Label::Distance condition_met_distance = Label::kFar); | 175 Label::Distance condition_met_distance = Label::kFar); |
| 164 | 176 |
| 165 // Check if object is in new space. The condition cc can be equal or | 177 // Check if object is in new space. Jumps if the object is not in new space. |
| 166 // not_equal. If it is equal a jump will be done if the object is on new | 178 // 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. | 179 void JumpIfNotInNewSpace(Register object, |
| 168 void InNewSpace(Register object, | 180 Register scratch, |
| 169 Register scratch, | 181 Label* branch, |
| 170 Condition cc, | 182 Label::Distance distance = Label::kFar) { |
| 171 Label* branch, | 183 InNewSpace(object, scratch, not_equal, branch, distance); |
| 172 Label::Distance near_jump = Label::kFar); | 184 } |
| 185 | |
| 186 // Check if object is in new space. Jumps if the object is in new space. | |
| 187 // The register scratch can be object itself, but it will be clobbered. | |
| 188 void JumpIfInNewSpace(Register object, | |
| 189 Register scratch, | |
| 190 Label* branch, | |
| 191 Label::Distance distance = Label::kFar) { | |
| 192 InNewSpace(object, scratch, equal, branch, distance); | |
| 193 } | |
| 194 | |
| 195 // Check if an object has the black incremental marking color. Also uses ecx! | |
|
Lasse Reichstein
2011/06/10 13:55:44
ecx->rcx (if still true - I assume it's for shifti
Erik Corry
2011/06/10 21:57:29
Done.
| |
| 196 void IsBlack(Register object, | |
|
Lasse Reichstein
2011/06/10 13:55:44
IsBlack -> JumpIfBlack
Erik Corry
2011/06/10 21:57:29
Done.
| |
| 197 Register scratch0, | |
| 198 Register scratch1, | |
| 199 Label* is_black, | |
|
Lasse Reichstein
2011/06/10 13:55:44
is_black -> on_black
Erik Corry
2011/06/10 21:57:29
Done.
| |
| 200 Label::Distance is_black_distance = Label::kFar); | |
| 201 | |
| 202 // Checks whether an object is data-only, ie it does need to be scanned by the | |
| 203 // garbage collector. | |
| 204 void IsDataObject(Register value, | |
| 205 Register scratch, | |
| 206 Label* not_data_object, | |
| 207 Label::Distance not_data_object_distance); | |
| 173 | 208 |
| 174 // Notify the garbage collector that we wrote a pointer into an object. | 209 // Notify the garbage collector that we wrote a pointer into an object. |
| 175 // |object| is the object being stored into, |value| is the object being | 210 // |object| is the object being stored into, |value| is the object being |
| 176 // stored. value and scratch registers are clobbered by the operation. | 211 // stored. value and scratch registers are clobbered by the operation. |
| 177 // The offset is the offset from the start of the object, not the offset from | 212 // The offset is the offset from the start of the object, not the offset from |
| 178 // the tagged HeapObject pointer. For use with FieldOperand(reg, off). | 213 // the tagged HeapObject pointer. For use with FieldOperand(reg, off). |
| 179 void RecordWriteField( | 214 void RecordWriteField( |
| 180 Register object, | 215 Register object, |
| 181 int offset, | 216 int offset, |
| 182 Register value, | 217 Register value, |
| (...skipping 1047 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1230 // If scratch is valid, it contains the address of the allocation top. | 1265 // If scratch is valid, it contains the address of the allocation top. |
| 1231 void UpdateAllocationTopHelper(Register result_end, Register scratch); | 1266 void UpdateAllocationTopHelper(Register result_end, Register scratch); |
| 1232 | 1267 |
| 1233 // Helper for PopHandleScope. Allowed to perform a GC and returns | 1268 // Helper for PopHandleScope. Allowed to perform a GC and returns |
| 1234 // NULL if gc_allowed. Does not perform a GC if !gc_allowed, and | 1269 // NULL if gc_allowed. Does not perform a GC if !gc_allowed, and |
| 1235 // possibly returns a failure object indicating an allocation failure. | 1270 // possibly returns a failure object indicating an allocation failure. |
| 1236 Object* PopHandleScopeHelper(Register saved, | 1271 Object* PopHandleScopeHelper(Register saved, |
| 1237 Register scratch, | 1272 Register scratch, |
| 1238 bool gc_allowed); | 1273 bool gc_allowed); |
| 1239 | 1274 |
| 1275 // Helper for implementing JumpIfNotInNewSpace and JumpIfInNewSpace. | |
| 1276 void InNewSpace(Register object, | |
| 1277 Register scratch, | |
| 1278 Condition cc, | |
| 1279 Label* branch, | |
| 1280 Label::Distance distance = Label::kFar); | |
| 1281 | |
| 1282 // Helper for finding the mark bits for an address. Afterwards, the | |
| 1283 // bitmap register points at the word with the mark bits and the mask | |
| 1284 // the position of the first bit. Uses rcx as scratch and leaves addr_reg | |
| 1285 // unchanged. | |
| 1286 inline void GetMarkBits(Register addr_reg, | |
| 1287 Register bitmap_reg, | |
| 1288 Register mask_reg); | |
| 1240 | 1289 |
| 1241 // Compute memory operands for safepoint stack slots. | 1290 // Compute memory operands for safepoint stack slots. |
| 1242 Operand SafepointRegisterSlot(Register reg); | 1291 Operand SafepointRegisterSlot(Register reg); |
| 1243 static int SafepointRegisterStackIndex(int reg_code) { | 1292 static int SafepointRegisterStackIndex(int reg_code) { |
| 1244 return kNumSafepointRegisters - kSafepointPushRegisterIndices[reg_code] - 1; | 1293 return kNumSafepointRegisters - kSafepointPushRegisterIndices[reg_code] - 1; |
| 1245 } | 1294 } |
| 1246 | 1295 |
| 1247 // Needs access to SafepointRegisterStackIndex for optimized frame | 1296 // Needs access to SafepointRegisterStackIndex for optimized frame |
| 1248 // traversal. | 1297 // traversal. |
| 1249 friend class OptimizedFrame; | 1298 friend class OptimizedFrame; |
| (...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1327 masm->popfd(); \ | 1376 masm->popfd(); \ |
| 1328 } \ | 1377 } \ |
| 1329 masm-> | 1378 masm-> |
| 1330 #else | 1379 #else |
| 1331 #define ACCESS_MASM(masm) masm-> | 1380 #define ACCESS_MASM(masm) masm-> |
| 1332 #endif | 1381 #endif |
| 1333 | 1382 |
| 1334 } } // namespace v8::internal | 1383 } } // namespace v8::internal |
| 1335 | 1384 |
| 1336 #endif // V8_X64_MACRO_ASSEMBLER_X64_H_ | 1385 #endif // V8_X64_MACRO_ASSEMBLER_X64_H_ |
| OLD | NEW |