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...) 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 1222 matching lines...) Loading... |
2019 // block of registers. | 2029 // block of registers. |
2020 // | 2030 // |
2021 // Note that size is per register, and is specified in bytes. | 2031 // Note that size is per register, and is specified in bytes. |
2022 void PushHelper(int count, int size, | 2032 void PushHelper(int count, int size, |
2023 const CPURegister& src0, const CPURegister& src1, | 2033 const CPURegister& src0, const CPURegister& src1, |
2024 const CPURegister& src2, const CPURegister& src3); | 2034 const CPURegister& src2, const CPURegister& src3); |
2025 void PopHelper(int count, int size, | 2035 void PopHelper(int count, int size, |
2026 const CPURegister& dst0, const CPURegister& dst1, | 2036 const CPURegister& dst0, const CPURegister& dst1, |
2027 const CPURegister& dst2, const CPURegister& dst3); | 2037 const CPURegister& dst2, const CPURegister& dst3); |
2028 | 2038 |
2029 // Perform necessary maintenance operations before a push or pop. | 2039 // Perform necessary maintenance operations before a push or after a pop. |
2030 // | 2040 // |
2031 // Note that size is specified in bytes. | 2041 // Note that size is specified in bytes. |
2032 void PrepareForPush(Operand total_size); | 2042 void PushPreamble(Operand total_size); |
2033 void PrepareForPop(Operand total_size); | 2043 void PopPostamble(Operand total_size); |
2034 | 2044 |
2035 void PrepareForPush(int count, int size) { PrepareForPush(count * size); } | 2045 void PushPreamble(int count, int size) { PushPreamble(count * size); } |
2036 void PrepareForPop(int count, int size) { PrepareForPop(count * size); } | 2046 void PopPostamble(int count, int size) { PopPostamble(count * size); } |
2037 | 2047 |
2038 // Call Printf. On a native build, a simple call will be generated, but if the | 2048 // Call Printf. On a native build, a simple call will be generated, but if the |
2039 // simulator is being used then a suitable pseudo-instruction is used. The | 2049 // simulator is being used then a suitable pseudo-instruction is used. The |
2040 // arguments and stack (csp) must be prepared by the caller as for a normal | 2050 // arguments and stack (csp) must be prepared by the caller as for a normal |
2041 // AAPCS64 call to 'printf'. | 2051 // AAPCS64 call to 'printf'. |
2042 // | 2052 // |
2043 // The 'type' argument specifies the type of the optional arguments. | 2053 // The 'type' argument specifies the type of the optional arguments. |
2044 void CallPrintf(CPURegister::RegisterType type = CPURegister::kNoRegister); | 2054 void CallPrintf(CPURegister::RegisterType type = CPURegister::kNoRegister); |
2045 | 2055 |
2046 // Helper for throwing exceptions. Compute a handler address and jump to | 2056 // Helper for throwing exceptions. Compute a handler address and jump to |
(...skipping 243 matching lines...) Loading... |
2290 #error "Unsupported option" | 2300 #error "Unsupported option" |
2291 #define CODE_COVERAGE_STRINGIFY(x) #x | 2301 #define CODE_COVERAGE_STRINGIFY(x) #x |
2292 #define CODE_COVERAGE_TOSTRING(x) CODE_COVERAGE_STRINGIFY(x) | 2302 #define CODE_COVERAGE_TOSTRING(x) CODE_COVERAGE_STRINGIFY(x) |
2293 #define __FILE_LINE__ __FILE__ ":" CODE_COVERAGE_TOSTRING(__LINE__) | 2303 #define __FILE_LINE__ __FILE__ ":" CODE_COVERAGE_TOSTRING(__LINE__) |
2294 #define ACCESS_MASM(masm) masm->stop(__FILE_LINE__); masm-> | 2304 #define ACCESS_MASM(masm) masm->stop(__FILE_LINE__); masm-> |
2295 #else | 2305 #else |
2296 #define ACCESS_MASM(masm) masm-> | 2306 #define ACCESS_MASM(masm) masm-> |
2297 #endif | 2307 #endif |
2298 | 2308 |
2299 #endif // V8_ARM64_MACRO_ASSEMBLER_ARM64_H_ | 2309 #endif // V8_ARM64_MACRO_ASSEMBLER_ARM64_H_ |
OLD | NEW |