| OLD | NEW |
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef V8_X64_MACRO_ASSEMBLER_X64_H_ | 5 #ifndef V8_X64_MACRO_ASSEMBLER_X64_H_ |
| 6 #define V8_X64_MACRO_ASSEMBLER_X64_H_ | 6 #define V8_X64_MACRO_ASSEMBLER_X64_H_ |
| 7 | 7 |
| 8 #include "src/assembler.h" | 8 #include "src/assembler.h" |
| 9 #include "src/bailout-reason.h" | 9 #include "src/bailout-reason.h" |
| 10 #include "src/base/flags.h" | 10 #include "src/base/flags.h" |
| (...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 141 // Load a root value where the index (or part of it) is variable. | 141 // Load a root value where the index (or part of it) is variable. |
| 142 // The variable_offset register is added to the fixed_offset value | 142 // The variable_offset register is added to the fixed_offset value |
| 143 // to get the index into the root-array. | 143 // to get the index into the root-array. |
| 144 void LoadRootIndexed(Register destination, | 144 void LoadRootIndexed(Register destination, |
| 145 Register variable_offset, | 145 Register variable_offset, |
| 146 int fixed_offset); | 146 int fixed_offset); |
| 147 void CompareRoot(Register with, Heap::RootListIndex index); | 147 void CompareRoot(Register with, Heap::RootListIndex index); |
| 148 void CompareRoot(const Operand& with, Heap::RootListIndex index); | 148 void CompareRoot(const Operand& with, Heap::RootListIndex index); |
| 149 void PushRoot(Heap::RootListIndex index); | 149 void PushRoot(Heap::RootListIndex index); |
| 150 | 150 |
| 151 // Compare the object in a register to a value and jump if they are equal. | |
| 152 void JumpIfRoot(Register with, Heap::RootListIndex index, Label* if_equal, | |
| 153 Label::Distance if_equal_distance = Label::kNear) { | |
| 154 CompareRoot(with, index); | |
| 155 j(equal, if_equal, if_equal_distance); | |
| 156 } | |
| 157 | |
| 158 // Compare the object in a register to a value and jump if they are not equal. | |
| 159 void JumpIfNotRoot(Register with, Heap::RootListIndex index, | |
| 160 Label* if_not_equal, | |
| 161 Label::Distance if_not_equal_distance = Label::kNear) { | |
| 162 CompareRoot(with, index); | |
| 163 j(not_equal, if_not_equal, if_not_equal_distance); | |
| 164 } | |
| 165 | |
| 166 // These functions do not arrange the registers in any particular order so | 151 // These functions do not arrange the registers in any particular order so |
| 167 // they are not useful for calls that can cause a GC. The caller can | 152 // they are not useful for calls that can cause a GC. The caller can |
| 168 // exclude up to 3 registers that do not need to be saved and restored. | 153 // exclude up to 3 registers that do not need to be saved and restored. |
| 169 void PushCallerSaved(SaveFPRegsMode fp_mode, | 154 void PushCallerSaved(SaveFPRegsMode fp_mode, |
| 170 Register exclusion1 = no_reg, | 155 Register exclusion1 = no_reg, |
| 171 Register exclusion2 = no_reg, | 156 Register exclusion2 = no_reg, |
| 172 Register exclusion3 = no_reg); | 157 Register exclusion3 = no_reg); |
| 173 void PopCallerSaved(SaveFPRegsMode fp_mode, | 158 void PopCallerSaved(SaveFPRegsMode fp_mode, |
| 174 Register exclusion1 = no_reg, | 159 Register exclusion1 = no_reg, |
| 175 Register exclusion2 = no_reg, | 160 Register exclusion2 = no_reg, |
| (...skipping 933 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1109 // Abort execution if a 64 bit register containing a 32 bit payload does not | 1094 // Abort execution if a 64 bit register containing a 32 bit payload does not |
| 1110 // have zeros in the top 32 bits, enabled via --debug-code. | 1095 // have zeros in the top 32 bits, enabled via --debug-code. |
| 1111 void AssertZeroExtended(Register reg); | 1096 void AssertZeroExtended(Register reg); |
| 1112 | 1097 |
| 1113 // Abort execution if argument is not a string, enabled via --debug-code. | 1098 // Abort execution if argument is not a string, enabled via --debug-code. |
| 1114 void AssertString(Register object); | 1099 void AssertString(Register object); |
| 1115 | 1100 |
| 1116 // Abort execution if argument is not a name, enabled via --debug-code. | 1101 // Abort execution if argument is not a name, enabled via --debug-code. |
| 1117 void AssertName(Register object); | 1102 void AssertName(Register object); |
| 1118 | 1103 |
| 1119 // Abort execution if argument is not a JSFunction, enabled via --debug-code. | |
| 1120 void AssertFunction(Register object); | |
| 1121 | |
| 1122 // Abort execution if argument is not undefined or an AllocationSite, enabled | 1104 // Abort execution if argument is not undefined or an AllocationSite, enabled |
| 1123 // via --debug-code. | 1105 // via --debug-code. |
| 1124 void AssertUndefinedOrAllocationSite(Register object); | 1106 void AssertUndefinedOrAllocationSite(Register object); |
| 1125 | 1107 |
| 1126 // Abort execution if argument is not the root value with the given index, | 1108 // Abort execution if argument is not the root value with the given index, |
| 1127 // enabled via --debug-code. | 1109 // enabled via --debug-code. |
| 1128 void AssertRootValue(Register src, | 1110 void AssertRootValue(Register src, |
| 1129 Heap::RootListIndex root_value_index, | 1111 Heap::RootListIndex root_value_index, |
| 1130 BailoutReason reason); | 1112 BailoutReason reason); |
| 1131 | 1113 |
| (...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1264 | 1246 |
| 1265 // Picks out an array index from the hash field. | 1247 // Picks out an array index from the hash field. |
| 1266 // Register use: | 1248 // Register use: |
| 1267 // hash - holds the index's hash. Clobbered. | 1249 // hash - holds the index's hash. Clobbered. |
| 1268 // index - holds the overwritten index on exit. | 1250 // index - holds the overwritten index on exit. |
| 1269 void IndexFromHash(Register hash, Register index); | 1251 void IndexFromHash(Register hash, Register index); |
| 1270 | 1252 |
| 1271 // Find the function context up the context chain. | 1253 // Find the function context up the context chain. |
| 1272 void LoadContext(Register dst, int context_chain_length); | 1254 void LoadContext(Register dst, int context_chain_length); |
| 1273 | 1255 |
| 1274 // Load the global proxy from the current context. | |
| 1275 void LoadGlobalProxy(Register dst); | |
| 1276 | |
| 1277 // Conditionally load the cached Array transitioned map of type | 1256 // Conditionally load the cached Array transitioned map of type |
| 1278 // transitioned_kind from the native context if the map in register | 1257 // transitioned_kind from the native context if the map in register |
| 1279 // map_in_out is the cached Array map in the native context of | 1258 // map_in_out is the cached Array map in the native context of |
| 1280 // expected_kind. | 1259 // expected_kind. |
| 1281 void LoadTransitionedArrayMapConditional( | 1260 void LoadTransitionedArrayMapConditional( |
| 1282 ElementsKind expected_kind, | 1261 ElementsKind expected_kind, |
| 1283 ElementsKind transitioned_kind, | 1262 ElementsKind transitioned_kind, |
| 1284 Register map_in_out, | 1263 Register map_in_out, |
| 1285 Register scratch, | 1264 Register scratch, |
| 1286 Label* no_map_match); | 1265 Label* no_map_match); |
| (...skipping 357 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1644 masm->popfq(); \ | 1623 masm->popfq(); \ |
| 1645 } \ | 1624 } \ |
| 1646 masm-> | 1625 masm-> |
| 1647 #else | 1626 #else |
| 1648 #define ACCESS_MASM(masm) masm-> | 1627 #define ACCESS_MASM(masm) masm-> |
| 1649 #endif | 1628 #endif |
| 1650 | 1629 |
| 1651 } } // namespace v8::internal | 1630 } } // namespace v8::internal |
| 1652 | 1631 |
| 1653 #endif // V8_X64_MACRO_ASSEMBLER_X64_H_ | 1632 #endif // V8_X64_MACRO_ASSEMBLER_X64_H_ |
| OLD | NEW |