blob: 951398dc043d7c2566d6373e0dc2428958f998ac [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
Vladimir Marko8ffaef92021-05-13 12:51:30 +000022#include "base/macros.h"
David Srbecky2f78a9c2020-01-17 15:53:42 +000023#include "jni.h"
24
Vladimir Marko8ffaef92021-05-13 12:51:30 +000025namespace art HIDDEN {
Ian Rogers6f3dbba2014-10-14 17:41:57 -070026
David Srbecky2f78a9c2020-01-17 15:53:42 +000027class ArtMethod;
28class Thread;
29
Ian Rogers6f3dbba2014-10-14 17:41:57 -070030extern "C" void* art_jni_dlsym_lookup_stub(JNIEnv*, jobject);
31static inline const void* GetJniDlsymLookupStub() {
32 return reinterpret_cast<const void*>(art_jni_dlsym_lookup_stub);
33}
34
Vladimir Markofa458ac2020-02-12 14:08:07 +000035extern "C" void* art_jni_dlsym_lookup_critical_stub(JNIEnv*, jobject);
36static inline const void* GetJniDlsymLookupCriticalStub() {
37 return reinterpret_cast<const void*>(art_jni_dlsym_lookup_critical_stub);
38}
39
Ian Rogers6f3dbba2014-10-14 17:41:57 -070040// Return the address of quick stub code for handling IMT conflicts.
Mathieu Chartiere401d142015-04-22 13:56:20 -070041extern "C" void art_quick_imt_conflict_trampoline(ArtMethod*);
Ian Rogers6f3dbba2014-10-14 17:41:57 -070042static inline const void* GetQuickImtConflictStub() {
43 return reinterpret_cast<const void*>(art_quick_imt_conflict_trampoline);
44}
45
Ian Rogers6f3dbba2014-10-14 17:41:57 -070046// Return the address of quick stub code for bridging from quick code to the interpreter.
Mathieu Chartiere401d142015-04-22 13:56:20 -070047extern "C" void art_quick_to_interpreter_bridge(ArtMethod*);
Ian Rogers6f3dbba2014-10-14 17:41:57 -070048static inline const void* GetQuickToInterpreterBridge() {
49 return reinterpret_cast<const void*>(art_quick_to_interpreter_bridge);
50}
51
Alex Lightdb01a092017-04-03 15:39:55 -070052// Return the address of stub code for attempting to invoke an obsolete method.
53extern "C" void art_invoke_obsolete_method_stub(ArtMethod*);
54static inline const void* GetInvokeObsoleteMethodStub() {
55 return reinterpret_cast<const void*>(art_invoke_obsolete_method_stub);
56}
57
Ian Rogers6f3dbba2014-10-14 17:41:57 -070058// Return the address of quick stub code for handling JNI calls.
Mathieu Chartiere401d142015-04-22 13:56:20 -070059extern "C" void art_quick_generic_jni_trampoline(ArtMethod*);
Ian Rogers6f3dbba2014-10-14 17:41:57 -070060static inline const void* GetQuickGenericJniStub() {
61 return reinterpret_cast<const void*>(art_quick_generic_jni_trampoline);
62}
63
Ian Rogers6f3dbba2014-10-14 17:41:57 -070064// Return the address of quick stub code for handling transitions into the proxy invoke handler.
65extern "C" void art_quick_proxy_invoke_handler();
66static inline const void* GetQuickProxyInvokeHandler() {
67 return reinterpret_cast<const void*>(art_quick_proxy_invoke_handler);
68}
69
Ian Rogers6f3dbba2014-10-14 17:41:57 -070070// Return the address of quick stub code for resolving a method at first call.
Mathieu Chartiere401d142015-04-22 13:56:20 -070071extern "C" void art_quick_resolution_trampoline(ArtMethod*);
Ian Rogers6f3dbba2014-10-14 17:41:57 -070072static inline const void* GetQuickResolutionStub() {
73 return reinterpret_cast<const void*>(art_quick_resolution_trampoline);
74}
75
76// Entry point for quick code that performs deoptimization.
77extern "C" void art_quick_deoptimize();
78static inline const void* GetQuickDeoptimizationEntryPoint() {
79 return reinterpret_cast<const void*>(art_quick_deoptimize);
80}
81
Sebastien Hertz07474662015-08-25 15:12:33 +000082// Stub to deoptimize from compiled code.
Nicolas Geoffray4e92c3c2017-05-08 09:34:26 +010083extern "C" void art_quick_deoptimize_from_compiled_code(DeoptimizationKind);
Mingyao Yangd43b3ac2015-04-01 14:03:04 -070084
Vladimir Marko552a1342017-10-31 10:56:47 +000085extern "C" void* art_quick_string_builder_append(uint32_t format);
Nicolas Geoffraya59af8a2019-11-27 17:42:32 +000086extern "C" void art_quick_compile_optimized(ArtMethod*, Thread*);
Mythri Alle5097f832021-11-02 14:52:30 +000087extern "C" void art_quick_method_entry_hook(ArtMethod*, Thread*);
88extern "C" int32_t art_quick_method_exit_hook(Thread*, ArtMethod*, uint64_t*, uint64_t*);
Vladimir Marko552a1342017-10-31 10:56:47 +000089
Ian Rogers6f3dbba2014-10-14 17:41:57 -070090} // namespace art
91
92#endif // ART_RUNTIME_ENTRYPOINTS_RUNTIME_ASM_ENTRYPOINTS_H_