blob: 9f470345b7d44f129155833fab8b41d4445a96f1 [file] [log] [blame]
Ian Rogers6f3dbba2014-10-14 17:41:57 -07001/*
2 * Copyright (C) 2012 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_RUNTIME_ENTRYPOINTS_RUNTIME_ASM_ENTRYPOINTS_H_
18#define ART_RUNTIME_ENTRYPOINTS_RUNTIME_ASM_ENTRYPOINTS_H_
19
Nicolas Geoffray4e92c3c2017-05-08 09:34:26 +010020#include "deoptimization_kind.h"
21
David Srbecky2f78a9c2020-01-17 15:53:42 +000022#include "jni.h"
23
Ian Rogers6f3dbba2014-10-14 17:41:57 -070024namespace art {
25
David Srbecky2f78a9c2020-01-17 15:53:42 +000026class ArtMethod;
27class Thread;
28
Ian Rogers6f3dbba2014-10-14 17:41:57 -070029#ifndef BUILDING_LIBART
30#error "File and symbols only for use within libart."
31#endif
32
33extern "C" void* art_jni_dlsym_lookup_stub(JNIEnv*, jobject);
34static inline const void* GetJniDlsymLookupStub() {
35 return reinterpret_cast<const void*>(art_jni_dlsym_lookup_stub);
36}
37
Vladimir Markofa458ac2020-02-12 14:08:07 +000038extern "C" void* art_jni_dlsym_lookup_critical_stub(JNIEnv*, jobject);
39static inline const void* GetJniDlsymLookupCriticalStub() {
40 return reinterpret_cast<const void*>(art_jni_dlsym_lookup_critical_stub);
41}
42
Ian Rogers6f3dbba2014-10-14 17:41:57 -070043// Return the address of quick stub code for handling IMT conflicts.
Mathieu Chartiere401d142015-04-22 13:56:20 -070044extern "C" void art_quick_imt_conflict_trampoline(ArtMethod*);
Ian Rogers6f3dbba2014-10-14 17:41:57 -070045static inline const void* GetQuickImtConflictStub() {
46 return reinterpret_cast<const void*>(art_quick_imt_conflict_trampoline);
47}
48
Ian Rogers6f3dbba2014-10-14 17:41:57 -070049// Return the address of quick stub code for bridging from quick code to the interpreter.
Mathieu Chartiere401d142015-04-22 13:56:20 -070050extern "C" void art_quick_to_interpreter_bridge(ArtMethod*);
Ian Rogers6f3dbba2014-10-14 17:41:57 -070051static inline const void* GetQuickToInterpreterBridge() {
52 return reinterpret_cast<const void*>(art_quick_to_interpreter_bridge);
53}
54
Alex Lightdb01a092017-04-03 15:39:55 -070055// Return the address of stub code for attempting to invoke an obsolete method.
56extern "C" void art_invoke_obsolete_method_stub(ArtMethod*);
57static inline const void* GetInvokeObsoleteMethodStub() {
58 return reinterpret_cast<const void*>(art_invoke_obsolete_method_stub);
59}
60
Ian Rogers6f3dbba2014-10-14 17:41:57 -070061// Return the address of quick stub code for handling JNI calls.
Mathieu Chartiere401d142015-04-22 13:56:20 -070062extern "C" void art_quick_generic_jni_trampoline(ArtMethod*);
Ian Rogers6f3dbba2014-10-14 17:41:57 -070063static inline const void* GetQuickGenericJniStub() {
64 return reinterpret_cast<const void*>(art_quick_generic_jni_trampoline);
65}
66
Ian Rogers6f3dbba2014-10-14 17:41:57 -070067// Return the address of quick stub code for handling transitions into the proxy invoke handler.
68extern "C" void art_quick_proxy_invoke_handler();
69static inline const void* GetQuickProxyInvokeHandler() {
70 return reinterpret_cast<const void*>(art_quick_proxy_invoke_handler);
71}
72
Ian Rogers6f3dbba2014-10-14 17:41:57 -070073// Return the address of quick stub code for resolving a method at first call.
Mathieu Chartiere401d142015-04-22 13:56:20 -070074extern "C" void art_quick_resolution_trampoline(ArtMethod*);
Ian Rogers6f3dbba2014-10-14 17:41:57 -070075static inline const void* GetQuickResolutionStub() {
76 return reinterpret_cast<const void*>(art_quick_resolution_trampoline);
77}
78
79// Entry point for quick code that performs deoptimization.
80extern "C" void art_quick_deoptimize();
81static inline const void* GetQuickDeoptimizationEntryPoint() {
82 return reinterpret_cast<const void*>(art_quick_deoptimize);
83}
84
85// Return address of instrumentation entry point used by non-interpreter based tracing.
86extern "C" void art_quick_instrumentation_entry(void*);
87static inline const void* GetQuickInstrumentationEntryPoint() {
88 return reinterpret_cast<const void*>(art_quick_instrumentation_entry);
89}
90
Sebastien Hertz07474662015-08-25 15:12:33 +000091// Stub to deoptimize from compiled code.
Nicolas Geoffray4e92c3c2017-05-08 09:34:26 +010092extern "C" void art_quick_deoptimize_from_compiled_code(DeoptimizationKind);
Mingyao Yangd43b3ac2015-04-01 14:03:04 -070093
Ian Rogers6f3dbba2014-10-14 17:41:57 -070094// The return_pc of instrumentation exit stub.
95extern "C" void art_quick_instrumentation_exit();
96static inline const void* GetQuickInstrumentationExitPc() {
97 return reinterpret_cast<const void*>(art_quick_instrumentation_exit);
98}
99
Vladimir Marko552a1342017-10-31 10:56:47 +0000100extern "C" void* art_quick_string_builder_append(uint32_t format);
Nicolas Geoffraya59af8a2019-11-27 17:42:32 +0000101extern "C" void art_quick_compile_optimized(ArtMethod*, Thread*);
Vladimir Marko552a1342017-10-31 10:56:47 +0000102
Ian Rogers6f3dbba2014-10-14 17:41:57 -0700103} // namespace art
104
105#endif // ART_RUNTIME_ENTRYPOINTS_RUNTIME_ASM_ENTRYPOINTS_H_