| OLD | NEW |
| 1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 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_ARM64_MACRO_ASSEMBLER_ARM64_H_ | 5 #ifndef V8_ARM64_MACRO_ASSEMBLER_ARM64_H_ |
| 6 #define V8_ARM64_MACRO_ASSEMBLER_ARM64_H_ | 6 #define V8_ARM64_MACRO_ASSEMBLER_ARM64_H_ |
| 7 | 7 |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "v8globals.h" | 10 #include "v8globals.h" |
| (...skipping 760 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 771 Bic(csp, StackPointer(), sp_alignment - 1); | 771 Bic(csp, StackPointer(), sp_alignment - 1); |
| 772 SetStackPointer(csp); | 772 SetStackPointer(csp); |
| 773 } | 773 } |
| 774 | 774 |
| 775 // Push the system stack pointer (csp) down to allow the same to be done to | 775 // Push the system stack pointer (csp) down to allow the same to be done to |
| 776 // the current stack pointer (according to StackPointer()). This must be | 776 // the current stack pointer (according to StackPointer()). This must be |
| 777 // called _before_ accessing the memory. | 777 // called _before_ accessing the memory. |
| 778 // | 778 // |
| 779 // This is necessary when pushing or otherwise adding things to the stack, to | 779 // This is necessary when pushing or otherwise adding things to the stack, to |
| 780 // satisfy the AAPCS64 constraint that the memory below the system stack | 780 // satisfy the AAPCS64 constraint that the memory below the system stack |
| 781 // pointer is not accessed. | 781 // pointer is not accessed. The amount pushed will be increased as necessary |
| 782 // to ensure csp remains aligned to 16 bytes. |
| 782 // | 783 // |
| 783 // This method asserts that StackPointer() is not csp, since the call does | 784 // This method asserts that StackPointer() is not csp, since the call does |
| 784 // not make sense in that context. | 785 // not make sense in that context. |
| 785 inline void BumpSystemStackPointer(const Operand& space); | 786 inline void BumpSystemStackPointer(const Operand& space); |
| 786 | 787 |
| 788 // Re-synchronizes the system stack pointer (csp) with the current stack |
| 789 // pointer (according to StackPointer()). This function will ensure the |
| 790 // new value of the system stack pointer is remains aligned to 16 bytes, and |
| 791 // is lower than or equal to the value of the current stack pointer. |
| 792 // |
| 793 // This method asserts that StackPointer() is not csp, since the call does |
| 794 // not make sense in that context. |
| 795 inline void SyncSystemStackPointer(); |
| 796 |
| 787 // Helpers ------------------------------------------------------------------ | 797 // Helpers ------------------------------------------------------------------ |
| 788 // Root register. | 798 // Root register. |
| 789 inline void InitializeRootRegister(); | 799 inline void InitializeRootRegister(); |
| 790 | 800 |
| 791 void AssertFPCRState(Register fpcr = NoReg); | 801 void AssertFPCRState(Register fpcr = NoReg); |
| 792 void ConfigureFPCR(); | 802 void ConfigureFPCR(); |
| 793 void CanonicalizeNaN(const FPRegister& dst, const FPRegister& src); | 803 void CanonicalizeNaN(const FPRegister& dst, const FPRegister& src); |
| 794 void CanonicalizeNaN(const FPRegister& reg) { | 804 void CanonicalizeNaN(const FPRegister& reg) { |
| 795 CanonicalizeNaN(reg, reg); | 805 CanonicalizeNaN(reg, reg); |
| 796 } | 806 } |
| (...skipping 1216 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2013 // block of registers. | 2023 // block of registers. |
| 2014 // | 2024 // |
| 2015 // Note that size is per register, and is specified in bytes. | 2025 // Note that size is per register, and is specified in bytes. |
| 2016 void PushHelper(int count, int size, | 2026 void PushHelper(int count, int size, |
| 2017 const CPURegister& src0, const CPURegister& src1, | 2027 const CPURegister& src0, const CPURegister& src1, |
| 2018 const CPURegister& src2, const CPURegister& src3); | 2028 const CPURegister& src2, const CPURegister& src3); |
| 2019 void PopHelper(int count, int size, | 2029 void PopHelper(int count, int size, |
| 2020 const CPURegister& dst0, const CPURegister& dst1, | 2030 const CPURegister& dst0, const CPURegister& dst1, |
| 2021 const CPURegister& dst2, const CPURegister& dst3); | 2031 const CPURegister& dst2, const CPURegister& dst3); |
| 2022 | 2032 |
| 2023 // Perform necessary maintenance operations before a push or pop. | 2033 // Perform necessary maintenance operations before a push or after a pop. |
| 2024 // | 2034 // |
| 2025 // Note that size is specified in bytes. | 2035 // Note that size is specified in bytes. |
| 2026 void PrepareForPush(Operand total_size); | 2036 void PushPreamble(Operand total_size); |
| 2027 void PrepareForPop(Operand total_size); | 2037 void PopPostamble(Operand total_size); |
| 2028 | 2038 |
| 2029 void PrepareForPush(int count, int size) { PrepareForPush(count * size); } | 2039 void PushPreamble(int count, int size) { PushPreamble(count * size); } |
| 2030 void PrepareForPop(int count, int size) { PrepareForPop(count * size); } | 2040 void PopPostamble(int count, int size) { PopPostamble(count * size); } |
| 2031 | 2041 |
| 2032 // Call Printf. On a native build, a simple call will be generated, but if the | 2042 // Call Printf. On a native build, a simple call will be generated, but if the |
| 2033 // simulator is being used then a suitable pseudo-instruction is used. The | 2043 // simulator is being used then a suitable pseudo-instruction is used. The |
| 2034 // arguments and stack (csp) must be prepared by the caller as for a normal | 2044 // arguments and stack (csp) must be prepared by the caller as for a normal |
| 2035 // AAPCS64 call to 'printf'. | 2045 // AAPCS64 call to 'printf'. |
| 2036 // | 2046 // |
| 2037 // The 'type' argument specifies the type of the optional arguments. | 2047 // The 'type' argument specifies the type of the optional arguments. |
| 2038 void CallPrintf(CPURegister::RegisterType type = CPURegister::kNoRegister); | 2048 void CallPrintf(CPURegister::RegisterType type = CPURegister::kNoRegister); |
| 2039 | 2049 |
| 2040 // Helper for throwing exceptions. Compute a handler address and jump to | 2050 // Helper for throwing exceptions. Compute a handler address and jump to |
| (...skipping 243 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2284 #error "Unsupported option" | 2294 #error "Unsupported option" |
| 2285 #define CODE_COVERAGE_STRINGIFY(x) #x | 2295 #define CODE_COVERAGE_STRINGIFY(x) #x |
| 2286 #define CODE_COVERAGE_TOSTRING(x) CODE_COVERAGE_STRINGIFY(x) | 2296 #define CODE_COVERAGE_TOSTRING(x) CODE_COVERAGE_STRINGIFY(x) |
| 2287 #define __FILE_LINE__ __FILE__ ":" CODE_COVERAGE_TOSTRING(__LINE__) | 2297 #define __FILE_LINE__ __FILE__ ":" CODE_COVERAGE_TOSTRING(__LINE__) |
| 2288 #define ACCESS_MASM(masm) masm->stop(__FILE_LINE__); masm-> | 2298 #define ACCESS_MASM(masm) masm->stop(__FILE_LINE__); masm-> |
| 2289 #else | 2299 #else |
| 2290 #define ACCESS_MASM(masm) masm-> | 2300 #define ACCESS_MASM(masm) masm-> |
| 2291 #endif | 2301 #endif |
| 2292 | 2302 |
| 2293 #endif // V8_ARM64_MACRO_ASSEMBLER_ARM64_H_ | 2303 #endif // V8_ARM64_MACRO_ASSEMBLER_ARM64_H_ |
| OLD | NEW |