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 #include "deoptimization_kind.h" 21 22 namespace art { 23 24 #ifndef BUILDING_LIBART 25 #error "File and symbols only for use within libart." 26 #endif 27 28 extern "C" void* art_jni_dlsym_lookup_stub(JNIEnv*, jobject); GetJniDlsymLookupStub()29static inline const void* GetJniDlsymLookupStub() { 30 return reinterpret_cast<const void*>(art_jni_dlsym_lookup_stub); 31 } 32 33 // Return the address of quick stub code for handling IMT conflicts. 34 extern "C" void art_quick_imt_conflict_trampoline(ArtMethod*); GetQuickImtConflictStub()35static inline const void* GetQuickImtConflictStub() { 36 return reinterpret_cast<const void*>(art_quick_imt_conflict_trampoline); 37 } 38 39 // Return the address of quick stub code for bridging from quick code to the interpreter. 40 extern "C" void art_quick_to_interpreter_bridge(ArtMethod*); GetQuickToInterpreterBridge()41static inline const void* GetQuickToInterpreterBridge() { 42 return reinterpret_cast<const void*>(art_quick_to_interpreter_bridge); 43 } 44 45 // Return the address of stub code for attempting to invoke an obsolete method. 46 extern "C" void art_invoke_obsolete_method_stub(ArtMethod*); GetInvokeObsoleteMethodStub()47static inline const void* GetInvokeObsoleteMethodStub() { 48 return reinterpret_cast<const void*>(art_invoke_obsolete_method_stub); 49 } 50 51 // Return the address of quick stub code for handling JNI calls. 52 extern "C" void art_quick_generic_jni_trampoline(ArtMethod*); GetQuickGenericJniStub()53static inline const void* GetQuickGenericJniStub() { 54 return reinterpret_cast<const void*>(art_quick_generic_jni_trampoline); 55 } 56 57 // Return the address of quick stub code for handling transitions into the proxy invoke handler. 58 extern "C" void art_quick_proxy_invoke_handler(); GetQuickProxyInvokeHandler()59static inline const void* GetQuickProxyInvokeHandler() { 60 return reinterpret_cast<const void*>(art_quick_proxy_invoke_handler); 61 } 62 63 // Return the address of quick stub code for resolving a method at first call. 64 extern "C" void art_quick_resolution_trampoline(ArtMethod*); GetQuickResolutionStub()65static inline const void* GetQuickResolutionStub() { 66 return reinterpret_cast<const void*>(art_quick_resolution_trampoline); 67 } 68 69 // Entry point for quick code that performs deoptimization. 70 extern "C" void art_quick_deoptimize(); GetQuickDeoptimizationEntryPoint()71static inline const void* GetQuickDeoptimizationEntryPoint() { 72 return reinterpret_cast<const void*>(art_quick_deoptimize); 73 } 74 75 // Return address of instrumentation entry point used by non-interpreter based tracing. 76 extern "C" void art_quick_instrumentation_entry(void*); GetQuickInstrumentationEntryPoint()77static inline const void* GetQuickInstrumentationEntryPoint() { 78 return reinterpret_cast<const void*>(art_quick_instrumentation_entry); 79 } 80 81 // Stub to deoptimize from compiled code. 82 extern "C" void art_quick_deoptimize_from_compiled_code(DeoptimizationKind); 83 84 // The return_pc of instrumentation exit stub. 85 extern "C" void art_quick_instrumentation_exit(); GetQuickInstrumentationExitPc()86static inline const void* GetQuickInstrumentationExitPc() { 87 return reinterpret_cast<const void*>(art_quick_instrumentation_exit); 88 } 89 90 } // namespace art 91 92 #endif // ART_RUNTIME_ENTRYPOINTS_RUNTIME_ASM_ENTRYPOINTS_H_ 93