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 | |
| 20 | namespace art { |
| 21 | |
| 22 | #ifndef BUILDING_LIBART |
| 23 | #error "File and symbols only for use within libart." |
| 24 | #endif |
| 25 | |
| 26 | extern "C" void* art_jni_dlsym_lookup_stub(JNIEnv*, jobject); |
| 27 | static inline const void* GetJniDlsymLookupStub() { |
| 28 | return reinterpret_cast<const void*>(art_jni_dlsym_lookup_stub); |
| 29 | } |
| 30 | |
| 31 | // Return the address of portable stub code for handling IMT conflicts. |
| 32 | extern "C" void art_portable_imt_conflict_trampoline(mirror::ArtMethod*); |
| 33 | static inline const void* GetPortableImtConflictStub() { |
| 34 | return reinterpret_cast<const void*>(art_portable_imt_conflict_trampoline); |
| 35 | } |
| 36 | |
| 37 | // Return the address of quick stub code for handling IMT conflicts. |
| 38 | extern "C" void art_quick_imt_conflict_trampoline(mirror::ArtMethod*); |
| 39 | static inline const void* GetQuickImtConflictStub() { |
| 40 | return reinterpret_cast<const void*>(art_quick_imt_conflict_trampoline); |
| 41 | } |
| 42 | |
| 43 | // Return the address of portable stub code for bridging from portable code to the interpreter. |
| 44 | extern "C" void art_portable_to_interpreter_bridge(mirror::ArtMethod*); |
| 45 | static inline const void* GetPortableToInterpreterBridge() { |
| 46 | return reinterpret_cast<const void*>(art_portable_to_interpreter_bridge); |
| 47 | } |
| 48 | |
| 49 | // Return the address of quick stub code for bridging from quick code to the interpreter. |
| 50 | extern "C" void art_quick_to_interpreter_bridge(mirror::ArtMethod*); |
| 51 | static inline const void* GetQuickToInterpreterBridge() { |
| 52 | return reinterpret_cast<const void*>(art_quick_to_interpreter_bridge); |
| 53 | } |
| 54 | |
| 55 | // Return the address of portable stub code for bridging from portable code to quick. |
| 56 | static inline const void* GetPortableToQuickBridge() { |
| 57 | // TODO: portable to quick bridge. Bug: 8196384 |
| 58 | return GetPortableToInterpreterBridge(); |
| 59 | } |
| 60 | |
| 61 | // Return the address of quick stub code for bridging from quick code to portable. |
| 62 | static inline const void* GetQuickToPortableBridge() { |
| 63 | // TODO: quick to portable bridge. Bug: 8196384 |
| 64 | return GetQuickToInterpreterBridge(); |
| 65 | } |
| 66 | |
| 67 | // Return the address of quick stub code for handling JNI calls. |
| 68 | extern "C" void art_quick_generic_jni_trampoline(mirror::ArtMethod*); |
| 69 | static inline const void* GetQuickGenericJniStub() { |
| 70 | return reinterpret_cast<const void*>(art_quick_generic_jni_trampoline); |
| 71 | } |
| 72 | |
| 73 | // Return the address of portable stub code for handling transitions into the proxy invoke handler. |
| 74 | extern "C" void art_portable_proxy_invoke_handler(); |
| 75 | static inline const void* GetPortableProxyInvokeHandler() { |
| 76 | return reinterpret_cast<const void*>(art_portable_proxy_invoke_handler); |
| 77 | } |
| 78 | |
| 79 | // Return the address of quick stub code for handling transitions into the proxy invoke handler. |
| 80 | extern "C" void art_quick_proxy_invoke_handler(); |
| 81 | static inline const void* GetQuickProxyInvokeHandler() { |
| 82 | return reinterpret_cast<const void*>(art_quick_proxy_invoke_handler); |
| 83 | } |
| 84 | |
| 85 | // Return the address of portable stub code for resolving a method at first call. |
| 86 | extern "C" void art_portable_resolution_trampoline(mirror::ArtMethod*); |
| 87 | static inline const void* GetPortableResolutionStub() { |
| 88 | return reinterpret_cast<const void*>(art_portable_resolution_trampoline); |
| 89 | } |
| 90 | |
| 91 | // Return the address of quick stub code for resolving a method at first call. |
| 92 | extern "C" void art_quick_resolution_trampoline(mirror::ArtMethod*); |
| 93 | static inline const void* GetQuickResolutionStub() { |
| 94 | return reinterpret_cast<const void*>(art_quick_resolution_trampoline); |
| 95 | } |
| 96 | |
| 97 | // Entry point for quick code that performs deoptimization. |
| 98 | extern "C" void art_quick_deoptimize(); |
| 99 | static inline const void* GetQuickDeoptimizationEntryPoint() { |
| 100 | return reinterpret_cast<const void*>(art_quick_deoptimize); |
| 101 | } |
| 102 | |
| 103 | // Return address of instrumentation entry point used by non-interpreter based tracing. |
| 104 | extern "C" void art_quick_instrumentation_entry(void*); |
| 105 | static inline const void* GetQuickInstrumentationEntryPoint() { |
| 106 | return reinterpret_cast<const void*>(art_quick_instrumentation_entry); |
| 107 | } |
| 108 | |
| 109 | // The return_pc of instrumentation exit stub. |
| 110 | extern "C" void art_quick_instrumentation_exit(); |
| 111 | static inline const void* GetQuickInstrumentationExitPc() { |
| 112 | return reinterpret_cast<const void*>(art_quick_instrumentation_exit); |
| 113 | } |
| 114 | |
| 115 | } // namespace art |
| 116 | |
| 117 | #endif // ART_RUNTIME_ENTRYPOINTS_RUNTIME_ASM_ENTRYPOINTS_H_ |