Ian Rogers | 6f3dbba | 2014-10-14 17:41:57 -0700 | [diff] [blame] | 1 | /* |
| 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 Geoffray | 4e92c3c | 2017-05-08 09:34:26 +0100 | [diff] [blame] | 20 | #include "deoptimization_kind.h" |
| 21 | |
Vladimir Marko | 8ffaef9 | 2021-05-13 12:51:30 +0000 | [diff] [blame] | 22 | #include "base/macros.h" |
David Srbecky | 2f78a9c | 2020-01-17 15:53:42 +0000 | [diff] [blame] | 23 | #include "jni.h" |
| 24 | |
Vladimir Marko | 8ffaef9 | 2021-05-13 12:51:30 +0000 | [diff] [blame] | 25 | namespace art HIDDEN { |
Ian Rogers | 6f3dbba | 2014-10-14 17:41:57 -0700 | [diff] [blame] | 26 | |
David Srbecky | 2f78a9c | 2020-01-17 15:53:42 +0000 | [diff] [blame] | 27 | class ArtMethod; |
| 28 | class Thread; |
| 29 | |
Ian Rogers | 6f3dbba | 2014-10-14 17:41:57 -0700 | [diff] [blame] | 30 | extern "C" void* art_jni_dlsym_lookup_stub(JNIEnv*, jobject); |
| 31 | static inline const void* GetJniDlsymLookupStub() { |
| 32 | return reinterpret_cast<const void*>(art_jni_dlsym_lookup_stub); |
| 33 | } |
| 34 | |
Vladimir Marko | fa458ac | 2020-02-12 14:08:07 +0000 | [diff] [blame] | 35 | extern "C" void* art_jni_dlsym_lookup_critical_stub(JNIEnv*, jobject); |
| 36 | static inline const void* GetJniDlsymLookupCriticalStub() { |
| 37 | return reinterpret_cast<const void*>(art_jni_dlsym_lookup_critical_stub); |
| 38 | } |
| 39 | |
Ian Rogers | 6f3dbba | 2014-10-14 17:41:57 -0700 | [diff] [blame] | 40 | // Return the address of quick stub code for handling IMT conflicts. |
Mathieu Chartier | e401d14 | 2015-04-22 13:56:20 -0700 | [diff] [blame] | 41 | extern "C" void art_quick_imt_conflict_trampoline(ArtMethod*); |
Ian Rogers | 6f3dbba | 2014-10-14 17:41:57 -0700 | [diff] [blame] | 42 | static inline const void* GetQuickImtConflictStub() { |
| 43 | return reinterpret_cast<const void*>(art_quick_imt_conflict_trampoline); |
| 44 | } |
| 45 | |
Ian Rogers | 6f3dbba | 2014-10-14 17:41:57 -0700 | [diff] [blame] | 46 | // Return the address of quick stub code for bridging from quick code to the interpreter. |
Mathieu Chartier | e401d14 | 2015-04-22 13:56:20 -0700 | [diff] [blame] | 47 | extern "C" void art_quick_to_interpreter_bridge(ArtMethod*); |
Ian Rogers | 6f3dbba | 2014-10-14 17:41:57 -0700 | [diff] [blame] | 48 | static inline const void* GetQuickToInterpreterBridge() { |
| 49 | return reinterpret_cast<const void*>(art_quick_to_interpreter_bridge); |
| 50 | } |
| 51 | |
Alex Light | db01a09 | 2017-04-03 15:39:55 -0700 | [diff] [blame] | 52 | // Return the address of stub code for attempting to invoke an obsolete method. |
| 53 | extern "C" void art_invoke_obsolete_method_stub(ArtMethod*); |
| 54 | static inline const void* GetInvokeObsoleteMethodStub() { |
| 55 | return reinterpret_cast<const void*>(art_invoke_obsolete_method_stub); |
| 56 | } |
| 57 | |
Ian Rogers | 6f3dbba | 2014-10-14 17:41:57 -0700 | [diff] [blame] | 58 | // Return the address of quick stub code for handling JNI calls. |
Mathieu Chartier | e401d14 | 2015-04-22 13:56:20 -0700 | [diff] [blame] | 59 | extern "C" void art_quick_generic_jni_trampoline(ArtMethod*); |
Ian Rogers | 6f3dbba | 2014-10-14 17:41:57 -0700 | [diff] [blame] | 60 | static inline const void* GetQuickGenericJniStub() { |
| 61 | return reinterpret_cast<const void*>(art_quick_generic_jni_trampoline); |
| 62 | } |
| 63 | |
Ian Rogers | 6f3dbba | 2014-10-14 17:41:57 -0700 | [diff] [blame] | 64 | // Return the address of quick stub code for handling transitions into the proxy invoke handler. |
| 65 | extern "C" void art_quick_proxy_invoke_handler(); |
| 66 | static inline const void* GetQuickProxyInvokeHandler() { |
| 67 | return reinterpret_cast<const void*>(art_quick_proxy_invoke_handler); |
| 68 | } |
| 69 | |
Ian Rogers | 6f3dbba | 2014-10-14 17:41:57 -0700 | [diff] [blame] | 70 | // Return the address of quick stub code for resolving a method at first call. |
Mathieu Chartier | e401d14 | 2015-04-22 13:56:20 -0700 | [diff] [blame] | 71 | extern "C" void art_quick_resolution_trampoline(ArtMethod*); |
Ian Rogers | 6f3dbba | 2014-10-14 17:41:57 -0700 | [diff] [blame] | 72 | static 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. |
| 77 | extern "C" void art_quick_deoptimize(); |
| 78 | static inline const void* GetQuickDeoptimizationEntryPoint() { |
| 79 | return reinterpret_cast<const void*>(art_quick_deoptimize); |
| 80 | } |
| 81 | |
Sebastien Hertz | 0747466 | 2015-08-25 15:12:33 +0000 | [diff] [blame] | 82 | // Stub to deoptimize from compiled code. |
Nicolas Geoffray | 4e92c3c | 2017-05-08 09:34:26 +0100 | [diff] [blame] | 83 | extern "C" void art_quick_deoptimize_from_compiled_code(DeoptimizationKind); |
Mingyao Yang | d43b3ac | 2015-04-01 14:03:04 -0700 | [diff] [blame] | 84 | |
Vladimir Marko | 552a134 | 2017-10-31 10:56:47 +0000 | [diff] [blame] | 85 | extern "C" void* art_quick_string_builder_append(uint32_t format); |
Nicolas Geoffray | a59af8a | 2019-11-27 17:42:32 +0000 | [diff] [blame] | 86 | extern "C" void art_quick_compile_optimized(ArtMethod*, Thread*); |
Mythri Alle | 5097f83 | 2021-11-02 14:52:30 +0000 | [diff] [blame] | 87 | extern "C" void art_quick_method_entry_hook(ArtMethod*, Thread*); |
| 88 | extern "C" int32_t art_quick_method_exit_hook(Thread*, ArtMethod*, uint64_t*, uint64_t*); |
Vladimir Marko | 552a134 | 2017-10-31 10:56:47 +0000 | [diff] [blame] | 89 | |
Ian Rogers | 6f3dbba | 2014-10-14 17:41:57 -0700 | [diff] [blame] | 90 | } // namespace art |
| 91 | |
| 92 | #endif // ART_RUNTIME_ENTRYPOINTS_RUNTIME_ASM_ENTRYPOINTS_H_ |