runtime_asm_entrypoints.h revision 6f3dbbadf4ce66982eb3d400e0a74cb73eb034f3
16f3dbbadf4ce66982eb3d400e0a74cb73eb034f3Ian Rogers/*
26f3dbbadf4ce66982eb3d400e0a74cb73eb034f3Ian Rogers * Copyright (C) 2012 The Android Open Source Project
36f3dbbadf4ce66982eb3d400e0a74cb73eb034f3Ian Rogers *
46f3dbbadf4ce66982eb3d400e0a74cb73eb034f3Ian Rogers * Licensed under the Apache License, Version 2.0 (the "License");
56f3dbbadf4ce66982eb3d400e0a74cb73eb034f3Ian Rogers * you may not use this file except in compliance with the License.
66f3dbbadf4ce66982eb3d400e0a74cb73eb034f3Ian Rogers * You may obtain a copy of the License at
76f3dbbadf4ce66982eb3d400e0a74cb73eb034f3Ian Rogers *
86f3dbbadf4ce66982eb3d400e0a74cb73eb034f3Ian Rogers *      http://www.apache.org/licenses/LICENSE-2.0
96f3dbbadf4ce66982eb3d400e0a74cb73eb034f3Ian Rogers *
106f3dbbadf4ce66982eb3d400e0a74cb73eb034f3Ian Rogers * Unless required by applicable law or agreed to in writing, software
116f3dbbadf4ce66982eb3d400e0a74cb73eb034f3Ian Rogers * distributed under the License is distributed on an "AS IS" BASIS,
126f3dbbadf4ce66982eb3d400e0a74cb73eb034f3Ian Rogers * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
136f3dbbadf4ce66982eb3d400e0a74cb73eb034f3Ian Rogers * See the License for the specific language governing permissions and
146f3dbbadf4ce66982eb3d400e0a74cb73eb034f3Ian Rogers * limitations under the License.
156f3dbbadf4ce66982eb3d400e0a74cb73eb034f3Ian Rogers */
166f3dbbadf4ce66982eb3d400e0a74cb73eb034f3Ian Rogers
176f3dbbadf4ce66982eb3d400e0a74cb73eb034f3Ian Rogers#ifndef ART_RUNTIME_ENTRYPOINTS_RUNTIME_ASM_ENTRYPOINTS_H_
186f3dbbadf4ce66982eb3d400e0a74cb73eb034f3Ian Rogers#define ART_RUNTIME_ENTRYPOINTS_RUNTIME_ASM_ENTRYPOINTS_H_
196f3dbbadf4ce66982eb3d400e0a74cb73eb034f3Ian Rogers
206f3dbbadf4ce66982eb3d400e0a74cb73eb034f3Ian Rogersnamespace art {
216f3dbbadf4ce66982eb3d400e0a74cb73eb034f3Ian Rogers
226f3dbbadf4ce66982eb3d400e0a74cb73eb034f3Ian Rogers#ifndef BUILDING_LIBART
236f3dbbadf4ce66982eb3d400e0a74cb73eb034f3Ian Rogers#error "File and symbols only for use within libart."
246f3dbbadf4ce66982eb3d400e0a74cb73eb034f3Ian Rogers#endif
256f3dbbadf4ce66982eb3d400e0a74cb73eb034f3Ian Rogers
266f3dbbadf4ce66982eb3d400e0a74cb73eb034f3Ian Rogersextern "C" void* art_jni_dlsym_lookup_stub(JNIEnv*, jobject);
276f3dbbadf4ce66982eb3d400e0a74cb73eb034f3Ian Rogersstatic inline const void* GetJniDlsymLookupStub() {
286f3dbbadf4ce66982eb3d400e0a74cb73eb034f3Ian Rogers  return reinterpret_cast<const void*>(art_jni_dlsym_lookup_stub);
296f3dbbadf4ce66982eb3d400e0a74cb73eb034f3Ian Rogers}
306f3dbbadf4ce66982eb3d400e0a74cb73eb034f3Ian Rogers
316f3dbbadf4ce66982eb3d400e0a74cb73eb034f3Ian Rogers// Return the address of portable stub code for handling IMT conflicts.
326f3dbbadf4ce66982eb3d400e0a74cb73eb034f3Ian Rogersextern "C" void art_portable_imt_conflict_trampoline(mirror::ArtMethod*);
336f3dbbadf4ce66982eb3d400e0a74cb73eb034f3Ian Rogersstatic inline const void* GetPortableImtConflictStub() {
346f3dbbadf4ce66982eb3d400e0a74cb73eb034f3Ian Rogers  return reinterpret_cast<const void*>(art_portable_imt_conflict_trampoline);
356f3dbbadf4ce66982eb3d400e0a74cb73eb034f3Ian Rogers}
366f3dbbadf4ce66982eb3d400e0a74cb73eb034f3Ian Rogers
376f3dbbadf4ce66982eb3d400e0a74cb73eb034f3Ian Rogers// Return the address of quick stub code for handling IMT conflicts.
386f3dbbadf4ce66982eb3d400e0a74cb73eb034f3Ian Rogersextern "C" void art_quick_imt_conflict_trampoline(mirror::ArtMethod*);
396f3dbbadf4ce66982eb3d400e0a74cb73eb034f3Ian Rogersstatic inline const void* GetQuickImtConflictStub() {
406f3dbbadf4ce66982eb3d400e0a74cb73eb034f3Ian Rogers  return reinterpret_cast<const void*>(art_quick_imt_conflict_trampoline);
416f3dbbadf4ce66982eb3d400e0a74cb73eb034f3Ian Rogers}
426f3dbbadf4ce66982eb3d400e0a74cb73eb034f3Ian Rogers
436f3dbbadf4ce66982eb3d400e0a74cb73eb034f3Ian Rogers// Return the address of portable stub code for bridging from portable code to the interpreter.
446f3dbbadf4ce66982eb3d400e0a74cb73eb034f3Ian Rogersextern "C" void art_portable_to_interpreter_bridge(mirror::ArtMethod*);
456f3dbbadf4ce66982eb3d400e0a74cb73eb034f3Ian Rogersstatic inline const void* GetPortableToInterpreterBridge() {
466f3dbbadf4ce66982eb3d400e0a74cb73eb034f3Ian Rogers  return reinterpret_cast<const void*>(art_portable_to_interpreter_bridge);
476f3dbbadf4ce66982eb3d400e0a74cb73eb034f3Ian Rogers}
486f3dbbadf4ce66982eb3d400e0a74cb73eb034f3Ian Rogers
496f3dbbadf4ce66982eb3d400e0a74cb73eb034f3Ian Rogers// Return the address of quick stub code for bridging from quick code to the interpreter.
506f3dbbadf4ce66982eb3d400e0a74cb73eb034f3Ian Rogersextern "C" void art_quick_to_interpreter_bridge(mirror::ArtMethod*);
516f3dbbadf4ce66982eb3d400e0a74cb73eb034f3Ian Rogersstatic inline const void* GetQuickToInterpreterBridge() {
526f3dbbadf4ce66982eb3d400e0a74cb73eb034f3Ian Rogers  return reinterpret_cast<const void*>(art_quick_to_interpreter_bridge);
536f3dbbadf4ce66982eb3d400e0a74cb73eb034f3Ian Rogers}
546f3dbbadf4ce66982eb3d400e0a74cb73eb034f3Ian Rogers
556f3dbbadf4ce66982eb3d400e0a74cb73eb034f3Ian Rogers// Return the address of portable stub code for bridging from portable code to quick.
566f3dbbadf4ce66982eb3d400e0a74cb73eb034f3Ian Rogersstatic inline const void* GetPortableToQuickBridge() {
576f3dbbadf4ce66982eb3d400e0a74cb73eb034f3Ian Rogers  // TODO: portable to quick bridge. Bug: 8196384
586f3dbbadf4ce66982eb3d400e0a74cb73eb034f3Ian Rogers  return GetPortableToInterpreterBridge();
596f3dbbadf4ce66982eb3d400e0a74cb73eb034f3Ian Rogers}
606f3dbbadf4ce66982eb3d400e0a74cb73eb034f3Ian Rogers
616f3dbbadf4ce66982eb3d400e0a74cb73eb034f3Ian Rogers// Return the address of quick stub code for bridging from quick code to portable.
626f3dbbadf4ce66982eb3d400e0a74cb73eb034f3Ian Rogersstatic inline const void* GetQuickToPortableBridge() {
636f3dbbadf4ce66982eb3d400e0a74cb73eb034f3Ian Rogers  // TODO: quick to portable bridge. Bug: 8196384
646f3dbbadf4ce66982eb3d400e0a74cb73eb034f3Ian Rogers  return GetQuickToInterpreterBridge();
656f3dbbadf4ce66982eb3d400e0a74cb73eb034f3Ian Rogers}
666f3dbbadf4ce66982eb3d400e0a74cb73eb034f3Ian Rogers
676f3dbbadf4ce66982eb3d400e0a74cb73eb034f3Ian Rogers// Return the address of quick stub code for handling JNI calls.
686f3dbbadf4ce66982eb3d400e0a74cb73eb034f3Ian Rogersextern "C" void art_quick_generic_jni_trampoline(mirror::ArtMethod*);
696f3dbbadf4ce66982eb3d400e0a74cb73eb034f3Ian Rogersstatic inline const void* GetQuickGenericJniStub() {
706f3dbbadf4ce66982eb3d400e0a74cb73eb034f3Ian Rogers  return reinterpret_cast<const void*>(art_quick_generic_jni_trampoline);
716f3dbbadf4ce66982eb3d400e0a74cb73eb034f3Ian Rogers}
726f3dbbadf4ce66982eb3d400e0a74cb73eb034f3Ian Rogers
736f3dbbadf4ce66982eb3d400e0a74cb73eb034f3Ian Rogers// Return the address of portable stub code for handling transitions into the proxy invoke handler.
746f3dbbadf4ce66982eb3d400e0a74cb73eb034f3Ian Rogersextern "C" void art_portable_proxy_invoke_handler();
756f3dbbadf4ce66982eb3d400e0a74cb73eb034f3Ian Rogersstatic inline const void* GetPortableProxyInvokeHandler() {
766f3dbbadf4ce66982eb3d400e0a74cb73eb034f3Ian Rogers  return reinterpret_cast<const void*>(art_portable_proxy_invoke_handler);
776f3dbbadf4ce66982eb3d400e0a74cb73eb034f3Ian Rogers}
786f3dbbadf4ce66982eb3d400e0a74cb73eb034f3Ian Rogers
796f3dbbadf4ce66982eb3d400e0a74cb73eb034f3Ian Rogers// Return the address of quick stub code for handling transitions into the proxy invoke handler.
806f3dbbadf4ce66982eb3d400e0a74cb73eb034f3Ian Rogersextern "C" void art_quick_proxy_invoke_handler();
816f3dbbadf4ce66982eb3d400e0a74cb73eb034f3Ian Rogersstatic inline const void* GetQuickProxyInvokeHandler() {
826f3dbbadf4ce66982eb3d400e0a74cb73eb034f3Ian Rogers  return reinterpret_cast<const void*>(art_quick_proxy_invoke_handler);
836f3dbbadf4ce66982eb3d400e0a74cb73eb034f3Ian Rogers}
846f3dbbadf4ce66982eb3d400e0a74cb73eb034f3Ian Rogers
856f3dbbadf4ce66982eb3d400e0a74cb73eb034f3Ian Rogers// Return the address of portable stub code for resolving a method at first call.
866f3dbbadf4ce66982eb3d400e0a74cb73eb034f3Ian Rogersextern "C" void art_portable_resolution_trampoline(mirror::ArtMethod*);
876f3dbbadf4ce66982eb3d400e0a74cb73eb034f3Ian Rogersstatic inline const void* GetPortableResolutionStub() {
886f3dbbadf4ce66982eb3d400e0a74cb73eb034f3Ian Rogers  return reinterpret_cast<const void*>(art_portable_resolution_trampoline);
896f3dbbadf4ce66982eb3d400e0a74cb73eb034f3Ian Rogers}
906f3dbbadf4ce66982eb3d400e0a74cb73eb034f3Ian Rogers
916f3dbbadf4ce66982eb3d400e0a74cb73eb034f3Ian Rogers// Return the address of quick stub code for resolving a method at first call.
926f3dbbadf4ce66982eb3d400e0a74cb73eb034f3Ian Rogersextern "C" void art_quick_resolution_trampoline(mirror::ArtMethod*);
936f3dbbadf4ce66982eb3d400e0a74cb73eb034f3Ian Rogersstatic inline const void* GetQuickResolutionStub() {
946f3dbbadf4ce66982eb3d400e0a74cb73eb034f3Ian Rogers  return reinterpret_cast<const void*>(art_quick_resolution_trampoline);
956f3dbbadf4ce66982eb3d400e0a74cb73eb034f3Ian Rogers}
966f3dbbadf4ce66982eb3d400e0a74cb73eb034f3Ian Rogers
976f3dbbadf4ce66982eb3d400e0a74cb73eb034f3Ian Rogers// Entry point for quick code that performs deoptimization.
986f3dbbadf4ce66982eb3d400e0a74cb73eb034f3Ian Rogersextern "C" void art_quick_deoptimize();
996f3dbbadf4ce66982eb3d400e0a74cb73eb034f3Ian Rogersstatic inline const void* GetQuickDeoptimizationEntryPoint() {
1006f3dbbadf4ce66982eb3d400e0a74cb73eb034f3Ian Rogers  return reinterpret_cast<const void*>(art_quick_deoptimize);
1016f3dbbadf4ce66982eb3d400e0a74cb73eb034f3Ian Rogers}
1026f3dbbadf4ce66982eb3d400e0a74cb73eb034f3Ian Rogers
1036f3dbbadf4ce66982eb3d400e0a74cb73eb034f3Ian Rogers// Return address of instrumentation entry point used by non-interpreter based tracing.
1046f3dbbadf4ce66982eb3d400e0a74cb73eb034f3Ian Rogersextern "C" void art_quick_instrumentation_entry(void*);
1056f3dbbadf4ce66982eb3d400e0a74cb73eb034f3Ian Rogersstatic inline const void* GetQuickInstrumentationEntryPoint() {
1066f3dbbadf4ce66982eb3d400e0a74cb73eb034f3Ian Rogers  return reinterpret_cast<const void*>(art_quick_instrumentation_entry);
1076f3dbbadf4ce66982eb3d400e0a74cb73eb034f3Ian Rogers}
1086f3dbbadf4ce66982eb3d400e0a74cb73eb034f3Ian Rogers
1096f3dbbadf4ce66982eb3d400e0a74cb73eb034f3Ian Rogers// The return_pc of instrumentation exit stub.
1106f3dbbadf4ce66982eb3d400e0a74cb73eb034f3Ian Rogersextern "C" void art_quick_instrumentation_exit();
1116f3dbbadf4ce66982eb3d400e0a74cb73eb034f3Ian Rogersstatic inline const void* GetQuickInstrumentationExitPc() {
1126f3dbbadf4ce66982eb3d400e0a74cb73eb034f3Ian Rogers  return reinterpret_cast<const void*>(art_quick_instrumentation_exit);
1136f3dbbadf4ce66982eb3d400e0a74cb73eb034f3Ian Rogers}
1146f3dbbadf4ce66982eb3d400e0a74cb73eb034f3Ian Rogers
1156f3dbbadf4ce66982eb3d400e0a74cb73eb034f3Ian Rogers}  // namespace art
1166f3dbbadf4ce66982eb3d400e0a74cb73eb034f3Ian Rogers
1176f3dbbadf4ce66982eb3d400e0a74cb73eb034f3Ian Rogers#endif  // ART_RUNTIME_ENTRYPOINTS_RUNTIME_ASM_ENTRYPOINTS_H_
118