Debian Codegraph @

compiler/jni/quick/arm64/calling_convention_arm64.h

raw symbols SCIP
1 /*
2 * Copyright (C) 2014 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17 #ifndef ART_COMPILER_JNI_QUICK_ARM64_CALLING_CONVENTION_ARM64_H_
18 #define ART_COMPILER_JNI_QUICK_ARM64_CALLING_CONVENTION_ARM64_H_
19
20 #include "base/enums.h"
21 #include "base/macros.h"
22 #include "jni/quick/calling_convention.h"
23
24 namespace art HIDDEN {
25 namespace arm64 {
26
27 class Arm64ManagedRuntimeCallingConvention final : public ManagedRuntimeCallingConvention {
28 public:
29 Arm64ManagedRuntimeCallingConvention(bool is_static, bool is_synchronized, const char* shorty)
30 : ManagedRuntimeCallingConvention(is_static,
31 is_synchronized,
32 shorty,
33 PointerSize::k64) {}
34 ~Arm64ManagedRuntimeCallingConvention() override {}
35 // Calling convention
36 ManagedRegister ReturnRegister() const override;
37 // Managed runtime calling convention
38 ManagedRegister MethodRegister() override;
39 ManagedRegister ArgumentRegisterForMethodExitHook() override;
40 bool IsCurrentParamInRegister() override;
41 bool IsCurrentParamOnStack() override;
42 ManagedRegister CurrentParamRegister() override;
43 FrameOffset CurrentParamStackOffset() override;
44
45 private:
46 DISALLOW_COPY_AND_ASSIGN(Arm64ManagedRuntimeCallingConvention);
47 };
48
49 class Arm64JniCallingConvention final : public JniCallingConvention {
50 public:
51 Arm64JniCallingConvention(bool is_static,
52 bool is_synchronized,
53 bool is_fast_native,
54 bool is_critical_native,
55 const char* shorty);
56 ~Arm64JniCallingConvention() override {}
57 // Calling convention
58 ManagedRegister ReturnRegister() const override;
59 ManagedRegister IntReturnRegister() const override;
60 // JNI calling convention
61 size_t FrameSize() const override;
62 size_t OutFrameSize() const override;
63 ArrayRef<const ManagedRegister> CalleeSaveRegisters() const override;
64 ArrayRef<const ManagedRegister> CalleeSaveScratchRegisters() const override;
65 ArrayRef<const ManagedRegister> ArgumentScratchRegisters() const override;
66 uint32_t CoreSpillMask() const override;
67 uint32_t FpSpillMask() const override;
68 bool IsCurrentParamInRegister() override;
69 bool IsCurrentParamOnStack() override;
70 ManagedRegister CurrentParamRegister() override;
71 FrameOffset CurrentParamStackOffset() override;
72
73 // aarch64 calling convention leaves upper bits undefined.
74 bool RequiresSmallResultTypeExtension() const override {
75 return HasSmallReturnType();
76 }
77
78 // Locking argument register, used to pass the synchronization object for calls
79 // to `JniLockObject()` and `JniUnlockObject()`.
80 ManagedRegister LockingArgumentRegister() const override;
81
82 // Hidden argument register, used to pass the method pointer for @CriticalNative call.
83 ManagedRegister HiddenArgumentRegister() const override;
84
85 // Whether to use tail call (used only for @CriticalNative).
86 bool UseTailCall() const override;
87
88 private:
89 DISALLOW_COPY_AND_ASSIGN(Arm64JniCallingConvention);
90 };
91
92 } // namespace arm64
93 } // namespace art
94
95 #endif // ART_COMPILER_JNI_QUICK_ARM64_CALLING_CONVENTION_ARM64_H_