OLD | NEW |
---|---|
1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 the V8 project authors. All rights reserved. |
2 // | 2 // |
3 // Redistribution and use in source and binary forms, with or without | 3 // Redistribution and use in source and binary forms, with or without |
4 // modification, are permitted provided that the following conditions are | 4 // modification, are permitted provided that the following conditions are |
5 // met: | 5 // met: |
6 // | 6 // |
7 // * Redistributions of source code must retain the above copyright | 7 // * Redistributions of source code must retain the above copyright |
8 // notice, this list of conditions and the following disclaimer. | 8 // notice, this list of conditions and the following disclaimer. |
9 // * Redistributions in binary form must reproduce the above | 9 // * Redistributions in binary form must reproduce the above |
10 // copyright notice, this list of conditions and the following | 10 // copyright notice, this list of conditions and the following |
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
173 } | 173 } |
174 | 174 |
175 | 175 |
176 // Patch the code at the current PC with a call to the target address. | 176 // Patch the code at the current PC with a call to the target address. |
177 // Additional guard instructions can be added if required. | 177 // Additional guard instructions can be added if required. |
178 void RelocInfo::PatchCodeWithCall(Address target, int guard_bytes) { | 178 void RelocInfo::PatchCodeWithCall(Address target, int guard_bytes) { |
179 UNIMPLEMENTED(); | 179 UNIMPLEMENTED(); |
180 } | 180 } |
181 | 181 |
182 | 182 |
183 Register GetRegisterThatIsNotOneOf(Register reg1, Register reg2, | |
jbramley
2014/02/13 14:20:14
I'd call it GetAllocatableRegisterThatIsNotOneOf(.
rmcilroy
2014/02/14 12:45:07
Done.
| |
184 Register reg3, Register reg4, | |
185 Register reg5, Register reg6) { | |
186 RegList regs = 0; | |
187 if (reg1.IsValid()) regs |= reg1.Bit(); | |
188 if (reg2.IsValid()) regs |= reg2.Bit(); | |
189 if (reg3.IsValid()) regs |= reg3.Bit(); | |
190 if (reg4.IsValid()) regs |= reg4.Bit(); | |
191 if (reg5.IsValid()) regs |= reg5.Bit(); | |
192 if (reg6.IsValid()) regs |= reg6.Bit(); | |
jbramley
2014/02/13 14:20:14
CPURegList can do a lot of this for you:
CPURegLi
rmcilroy
2014/02/14 12:45:07
Done.
| |
193 | |
194 for (int i = 0; i < Register::NumAllocatableRegisters(); i++) { | |
195 Register candidate = Register::FromAllocationIndex(i); | |
196 if (regs & candidate.Bit()) continue; | |
197 return candidate; | |
198 } | |
199 UNREACHABLE(); | |
200 return NoReg; | |
201 } | |
202 | |
203 | |
183 bool AreAliased(const CPURegister& reg1, const CPURegister& reg2, | 204 bool AreAliased(const CPURegister& reg1, const CPURegister& reg2, |
184 const CPURegister& reg3, const CPURegister& reg4, | 205 const CPURegister& reg3, const CPURegister& reg4, |
185 const CPURegister& reg5, const CPURegister& reg6, | 206 const CPURegister& reg5, const CPURegister& reg6, |
186 const CPURegister& reg7, const CPURegister& reg8) { | 207 const CPURegister& reg7, const CPURegister& reg8) { |
187 int number_of_valid_regs = 0; | 208 int number_of_valid_regs = 0; |
188 int number_of_valid_fpregs = 0; | 209 int number_of_valid_fpregs = 0; |
189 | 210 |
190 RegList unique_regs = 0; | 211 RegList unique_regs = 0; |
191 RegList unique_fpregs = 0; | 212 RegList unique_fpregs = 0; |
192 | 213 |
(...skipping 2293 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2486 // code. | 2507 // code. |
2487 #ifdef ENABLE_DEBUGGER_SUPPORT | 2508 #ifdef ENABLE_DEBUGGER_SUPPORT |
2488 RecordRelocInfo(RelocInfo::CONST_POOL, static_cast<intptr_t>(size)); | 2509 RecordRelocInfo(RelocInfo::CONST_POOL, static_cast<intptr_t>(size)); |
2489 #endif | 2510 #endif |
2490 } | 2511 } |
2491 | 2512 |
2492 | 2513 |
2493 } } // namespace v8::internal | 2514 } } // namespace v8::internal |
2494 | 2515 |
2495 #endif // V8_TARGET_ARCH_A64 | 2516 #endif // V8_TARGET_ARCH_A64 |
OLD | NEW |