| 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 15 matching lines...) Expand all Loading... |
| 26 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 26 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
| 27 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 27 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 28 | 28 |
| 29 #include "src/v8.h" | 29 #include "src/v8.h" |
| 30 | 30 |
| 31 #if V8_TARGET_ARCH_ARM64 | 31 #if V8_TARGET_ARCH_ARM64 |
| 32 | 32 |
| 33 #define ARM64_DEFINE_REG_STATICS | 33 #define ARM64_DEFINE_REG_STATICS |
| 34 | 34 |
| 35 #include "src/arm64/assembler-arm64-inl.h" | 35 #include "src/arm64/assembler-arm64-inl.h" |
| 36 #include "src/base/cpu.h" |
| 36 | 37 |
| 37 namespace v8 { | 38 namespace v8 { |
| 38 namespace internal { | 39 namespace internal { |
| 39 | 40 |
| 40 | 41 |
| 41 // ----------------------------------------------------------------------------- | 42 // ----------------------------------------------------------------------------- |
| 42 // CpuFeatures implementation. | 43 // CpuFeatures implementation. |
| 43 | 44 |
| 44 void CpuFeatures::ProbeImpl(bool cross_compile) { | 45 void CpuFeatures::ProbeImpl(bool cross_compile) { |
| 45 if (cross_compile) { | 46 if (cross_compile) { |
| 46 // Always align csp in cross compiled code - this is safe and ensures that | 47 // Always align csp in cross compiled code - this is safe and ensures that |
| 47 // csp will always be aligned if it is enabled by probing at runtime. | 48 // csp will always be aligned if it is enabled by probing at runtime. |
| 48 if (FLAG_enable_always_align_csp) supported_ |= 1u << ALWAYS_ALIGN_CSP; | 49 if (FLAG_enable_always_align_csp) supported_ |= 1u << ALWAYS_ALIGN_CSP; |
| 49 } else { | 50 } else { |
| 50 CPU cpu; | 51 base::CPU cpu; |
| 51 if (FLAG_enable_always_align_csp && (cpu.implementer() == CPU::NVIDIA || | 52 if (FLAG_enable_always_align_csp && |
| 52 FLAG_debug_code)) { | 53 (cpu.implementer() == base::CPU::NVIDIA || FLAG_debug_code)) { |
| 53 supported_ |= 1u << ALWAYS_ALIGN_CSP; | 54 supported_ |= 1u << ALWAYS_ALIGN_CSP; |
| 54 } | 55 } |
| 55 } | 56 } |
| 56 } | 57 } |
| 57 | 58 |
| 58 | 59 |
| 59 void CpuFeatures::PrintTarget() { } | 60 void CpuFeatures::PrintTarget() { } |
| 60 void CpuFeatures::PrintFeatures() { } | 61 void CpuFeatures::PrintFeatures() { } |
| 61 | 62 |
| 62 | 63 |
| (...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 183 | 184 |
| 184 void RelocInfo::PatchCode(byte* instructions, int instruction_count) { | 185 void RelocInfo::PatchCode(byte* instructions, int instruction_count) { |
| 185 // Patch the code at the current address with the supplied instructions. | 186 // Patch the code at the current address with the supplied instructions. |
| 186 Instr* pc = reinterpret_cast<Instr*>(pc_); | 187 Instr* pc = reinterpret_cast<Instr*>(pc_); |
| 187 Instr* instr = reinterpret_cast<Instr*>(instructions); | 188 Instr* instr = reinterpret_cast<Instr*>(instructions); |
| 188 for (int i = 0; i < instruction_count; i++) { | 189 for (int i = 0; i < instruction_count; i++) { |
| 189 *(pc + i) = *(instr + i); | 190 *(pc + i) = *(instr + i); |
| 190 } | 191 } |
| 191 | 192 |
| 192 // Indicate that code has changed. | 193 // Indicate that code has changed. |
| 193 CPU::FlushICache(pc_, instruction_count * kInstructionSize); | 194 CpuFeatures::FlushICache(pc_, instruction_count * kInstructionSize); |
| 194 } | 195 } |
| 195 | 196 |
| 196 | 197 |
| 197 // Patch the code at the current PC with a call to the target address. | 198 // Patch the code at the current PC with a call to the target address. |
| 198 // Additional guard instructions can be added if required. | 199 // Additional guard instructions can be added if required. |
| 199 void RelocInfo::PatchCodeWithCall(Address target, int guard_bytes) { | 200 void RelocInfo::PatchCodeWithCall(Address target, int guard_bytes) { |
| 200 UNIMPLEMENTED(); | 201 UNIMPLEMENTED(); |
| 201 } | 202 } |
| 202 | 203 |
| 203 | 204 |
| (...skipping 2833 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3037 adr(rd, 0); | 3038 adr(rd, 0); |
| 3038 MovInt64(scratch, target_offset); | 3039 MovInt64(scratch, target_offset); |
| 3039 add(rd, rd, scratch); | 3040 add(rd, rd, scratch); |
| 3040 } | 3041 } |
| 3041 } | 3042 } |
| 3042 | 3043 |
| 3043 | 3044 |
| 3044 } } // namespace v8::internal | 3045 } } // namespace v8::internal |
| 3045 | 3046 |
| 3046 #endif // V8_TARGET_ARCH_ARM64 | 3047 #endif // V8_TARGET_ARCH_ARM64 |
| OLD | NEW |