Elliott Hughes | 0f3c553 | 2012-03-30 14:51:51 -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 | */ |
buzbee | 5433072 | 2011-08-23 16:46:55 -0700 | [diff] [blame] | 16 | |
Ian Rogers | 7655f29 | 2013-07-29 11:07:13 -0700 | [diff] [blame] | 17 | #ifndef ART_RUNTIME_ENTRYPOINTS_ENTRYPOINT_UTILS_H_ |
| 18 | #define ART_RUNTIME_ENTRYPOINTS_ENTRYPOINT_UTILS_H_ |
Ian Rogers | 450dcb5 | 2013-09-20 17:36:02 -0700 | [diff] [blame] | 19 | |
Mingyao Yang | 98d1cc8 | 2014-05-15 17:02:16 -0700 | [diff] [blame^] | 20 | #include <jni.h> |
| 21 | #include <stdint.h> |
| 22 | |
Ian Rogers | 450dcb5 | 2013-09-20 17:36:02 -0700 | [diff] [blame] | 23 | #include "base/macros.h" |
Mingyao Yang | 98d1cc8 | 2014-05-15 17:02:16 -0700 | [diff] [blame^] | 24 | #include "base/mutex.h" |
| 25 | #include "gc/allocator_type.h" |
Elliott Hughes | 0f3c553 | 2012-03-30 14:51:51 -0700 | [diff] [blame] | 26 | #include "invoke_type.h" |
Mingyao Yang | 98d1cc8 | 2014-05-15 17:02:16 -0700 | [diff] [blame^] | 27 | #include "jvalue.h" |
Ian Rogers | 57b86d4 | 2012-03-27 16:05:41 -0700 | [diff] [blame] | 28 | |
Shih-wei Liao | 2d83101 | 2011-09-28 22:06:53 -0700 | [diff] [blame] | 29 | namespace art { |
Ian Rogers | 848871b | 2013-08-05 10:56:33 -0700 | [diff] [blame] | 30 | |
Ian Rogers | 2dd0e2c | 2013-01-24 12:42:14 -0800 | [diff] [blame] | 31 | namespace mirror { |
Ian Rogers | 848871b | 2013-08-05 10:56:33 -0700 | [diff] [blame] | 32 | class Class; |
Mingyao Yang | 98d1cc8 | 2014-05-15 17:02:16 -0700 | [diff] [blame^] | 33 | class Array; |
Brian Carlstrom | ea46f95 | 2013-07-30 01:26:50 -0700 | [diff] [blame] | 34 | class ArtField; |
Mingyao Yang | 98d1cc8 | 2014-05-15 17:02:16 -0700 | [diff] [blame^] | 35 | class ArtMethod; |
Ian Rogers | 848871b | 2013-08-05 10:56:33 -0700 | [diff] [blame] | 36 | class Object; |
Mingyao Yang | 98d1cc8 | 2014-05-15 17:02:16 -0700 | [diff] [blame^] | 37 | class String; |
Ian Rogers | 848871b | 2013-08-05 10:56:33 -0700 | [diff] [blame] | 38 | } // namespace mirror |
Ian Rogers | 57b86d4 | 2012-03-27 16:05:41 -0700 | [diff] [blame] | 39 | |
Mingyao Yang | 98d1cc8 | 2014-05-15 17:02:16 -0700 | [diff] [blame^] | 40 | class ScopedObjectAccessAlreadyRunnable; |
| 41 | class Thread; |
| 42 | |
Mathieu Chartier | cbb2d20 | 2013-11-14 17:45:16 -0800 | [diff] [blame] | 43 | // TODO: Fix no thread safety analysis when GCC can handle template specialization. |
| 44 | template <const bool kAccessCheck> |
| 45 | ALWAYS_INLINE static inline mirror::Class* CheckObjectAlloc(uint32_t type_idx, |
| 46 | mirror::ArtMethod* method, |
Mathieu Chartier | e6da9af | 2013-12-16 11:54:42 -0800 | [diff] [blame] | 47 | Thread* self, bool* slow_path) |
Mingyao Yang | 98d1cc8 | 2014-05-15 17:02:16 -0700 | [diff] [blame^] | 48 | NO_THREAD_SAFETY_ANALYSIS; |
Hiroshi Yamauchi | 3b4c189 | 2013-09-12 21:33:12 -0700 | [diff] [blame] | 49 | |
Hiroshi Yamauchi | be1ca55 | 2014-01-15 11:46:48 -0800 | [diff] [blame] | 50 | // TODO: Fix no thread safety analysis when annotalysis is smarter. |
| 51 | ALWAYS_INLINE static inline mirror::Class* CheckClassInitializedForObjectAlloc(mirror::Class* klass, |
| 52 | Thread* self, bool* slow_path) |
Mingyao Yang | 98d1cc8 | 2014-05-15 17:02:16 -0700 | [diff] [blame^] | 53 | NO_THREAD_SAFETY_ANALYSIS; |
Hiroshi Yamauchi | be1ca55 | 2014-01-15 11:46:48 -0800 | [diff] [blame] | 54 | |
Ian Rogers | 57b86d4 | 2012-03-27 16:05:41 -0700 | [diff] [blame] | 55 | // Given the context of a calling Method, use its DexCache to resolve a type to a Class. If it |
| 56 | // cannot be resolved, throw an error. If it can, use it to create an instance. |
| 57 | // When verification/compiler hasn't been able to verify access, optionally perform an access |
| 58 | // check. |
Mathieu Chartier | cbb2d20 | 2013-11-14 17:45:16 -0800 | [diff] [blame] | 59 | // TODO: Fix NO_THREAD_SAFETY_ANALYSIS when GCC is smarter. |
| 60 | template <bool kAccessCheck, bool kInstrumented> |
| 61 | ALWAYS_INLINE static inline mirror::Object* AllocObjectFromCode(uint32_t type_idx, |
| 62 | mirror::ArtMethod* method, |
| 63 | Thread* self, |
Mingyao Yang | 98d1cc8 | 2014-05-15 17:02:16 -0700 | [diff] [blame^] | 64 | gc::AllocatorType allocator_type); |
Hiroshi Yamauchi | 3b4c189 | 2013-09-12 21:33:12 -0700 | [diff] [blame] | 65 | |
Hiroshi Yamauchi | be1ca55 | 2014-01-15 11:46:48 -0800 | [diff] [blame] | 66 | // Given the context of a calling Method and a resolved class, create an instance. |
| 67 | // TODO: Fix NO_THREAD_SAFETY_ANALYSIS when GCC is smarter. |
| 68 | template <bool kInstrumented> |
| 69 | ALWAYS_INLINE static inline mirror::Object* AllocObjectFromCodeResolved(mirror::Class* klass, |
| 70 | mirror::ArtMethod* method, |
| 71 | Thread* self, |
| 72 | gc::AllocatorType allocator_type) |
Mingyao Yang | 98d1cc8 | 2014-05-15 17:02:16 -0700 | [diff] [blame^] | 73 | NO_THREAD_SAFETY_ANALYSIS; |
Hiroshi Yamauchi | be1ca55 | 2014-01-15 11:46:48 -0800 | [diff] [blame] | 74 | |
| 75 | // Given the context of a calling Method and an initialized class, create an instance. |
| 76 | // TODO: Fix NO_THREAD_SAFETY_ANALYSIS when GCC is smarter. |
| 77 | template <bool kInstrumented> |
| 78 | ALWAYS_INLINE static inline mirror::Object* AllocObjectFromCodeInitialized(mirror::Class* klass, |
| 79 | mirror::ArtMethod* method, |
| 80 | Thread* self, |
Mingyao Yang | 98d1cc8 | 2014-05-15 17:02:16 -0700 | [diff] [blame^] | 81 | gc::AllocatorType allocator_type); |
Hiroshi Yamauchi | be1ca55 | 2014-01-15 11:46:48 -0800 | [diff] [blame] | 82 | |
| 83 | |
Mathieu Chartier | cbb2d20 | 2013-11-14 17:45:16 -0800 | [diff] [blame] | 84 | // TODO: Fix no thread safety analysis when GCC can handle template specialization. |
| 85 | template <bool kAccessCheck> |
| 86 | ALWAYS_INLINE static inline mirror::Class* CheckArrayAlloc(uint32_t type_idx, |
| 87 | mirror::ArtMethod* method, |
Mathieu Chartier | e6da9af | 2013-12-16 11:54:42 -0800 | [diff] [blame] | 88 | int32_t component_count, |
| 89 | bool* slow_path) |
Mingyao Yang | 98d1cc8 | 2014-05-15 17:02:16 -0700 | [diff] [blame^] | 90 | NO_THREAD_SAFETY_ANALYSIS; |
Ian Rogers | 57b86d4 | 2012-03-27 16:05:41 -0700 | [diff] [blame] | 91 | |
| 92 | // Given the context of a calling Method, use its DexCache to resolve a type to an array Class. If |
| 93 | // it cannot be resolved, throw an error. If it can, use it to create an array. |
| 94 | // When verification/compiler hasn't been able to verify access, optionally perform an access |
| 95 | // check. |
Mathieu Chartier | cbb2d20 | 2013-11-14 17:45:16 -0800 | [diff] [blame] | 96 | // TODO: Fix no thread safety analysis when GCC can handle template specialization. |
| 97 | template <bool kAccessCheck, bool kInstrumented> |
| 98 | ALWAYS_INLINE static inline mirror::Array* AllocArrayFromCode(uint32_t type_idx, |
| 99 | mirror::ArtMethod* method, |
| 100 | int32_t component_count, |
| 101 | Thread* self, |
| 102 | gc::AllocatorType allocator_type) |
Mingyao Yang | 98d1cc8 | 2014-05-15 17:02:16 -0700 | [diff] [blame^] | 103 | NO_THREAD_SAFETY_ANALYSIS; |
Ian Rogers | 57b86d4 | 2012-03-27 16:05:41 -0700 | [diff] [blame] | 104 | |
Hiroshi Yamauchi | bb8f0ab | 2014-01-27 16:50:29 -0800 | [diff] [blame] | 105 | template <bool kAccessCheck, bool kInstrumented> |
| 106 | ALWAYS_INLINE static inline mirror::Array* AllocArrayFromCodeResolved(mirror::Class* klass, |
| 107 | mirror::ArtMethod* method, |
| 108 | int32_t component_count, |
| 109 | Thread* self, |
| 110 | gc::AllocatorType allocator_type) |
Mingyao Yang | 98d1cc8 | 2014-05-15 17:02:16 -0700 | [diff] [blame^] | 111 | NO_THREAD_SAFETY_ANALYSIS; |
Hiroshi Yamauchi | bb8f0ab | 2014-01-27 16:50:29 -0800 | [diff] [blame] | 112 | |
Brian Carlstrom | ea46f95 | 2013-07-30 01:26:50 -0700 | [diff] [blame] | 113 | extern mirror::Array* CheckAndAllocArrayFromCode(uint32_t type_idx, mirror::ArtMethod* method, |
Mathieu Chartier | cbb2d20 | 2013-11-14 17:45:16 -0800 | [diff] [blame] | 114 | int32_t component_count, Thread* self, |
| 115 | bool access_check, |
| 116 | gc::AllocatorType allocator_type) |
Ian Rogers | b726dcb | 2012-09-05 08:57:23 -0700 | [diff] [blame] | 117 | SHARED_LOCKS_REQUIRED(Locks::mutator_lock_); |
Ian Rogers | 57b86d4 | 2012-03-27 16:05:41 -0700 | [diff] [blame] | 118 | |
Mathieu Chartier | cbb2d20 | 2013-11-14 17:45:16 -0800 | [diff] [blame] | 119 | extern mirror::Array* CheckAndAllocArrayFromCodeInstrumented(uint32_t type_idx, |
| 120 | mirror::ArtMethod* method, |
| 121 | int32_t component_count, Thread* self, |
| 122 | bool access_check, |
| 123 | gc::AllocatorType allocator_type) |
Hiroshi Yamauchi | 3b4c189 | 2013-09-12 21:33:12 -0700 | [diff] [blame] | 124 | SHARED_LOCKS_REQUIRED(Locks::mutator_lock_); |
| 125 | |
Ian Rogers | 08f753d | 2012-08-24 14:35:25 -0700 | [diff] [blame] | 126 | // Type of find field operation for fast and slow case. |
| 127 | enum FindFieldType { |
| 128 | InstanceObjectRead, |
| 129 | InstanceObjectWrite, |
| 130 | InstancePrimitiveRead, |
| 131 | InstancePrimitiveWrite, |
| 132 | StaticObjectRead, |
| 133 | StaticObjectWrite, |
| 134 | StaticPrimitiveRead, |
| 135 | StaticPrimitiveWrite, |
| 136 | }; |
| 137 | |
Sebastien Hertz | d4beb6b | 2013-10-02 17:07:20 +0200 | [diff] [blame] | 138 | template<FindFieldType type, bool access_check> |
Ian Rogers | ef7d42f | 2014-01-06 12:55:46 -0800 | [diff] [blame] | 139 | static inline mirror::ArtField* FindFieldFromCode(uint32_t field_idx, mirror::ArtMethod* referrer, |
Mingyao Yang | 98d1cc8 | 2014-05-15 17:02:16 -0700 | [diff] [blame^] | 140 | Thread* self, size_t expected_size) |
| 141 | SHARED_LOCKS_REQUIRED(Locks::mutator_lock_); |
Sebastien Hertz | d4beb6b | 2013-10-02 17:07:20 +0200 | [diff] [blame] | 142 | |
| 143 | template<InvokeType type, bool access_check> |
Mathieu Chartier | d565caf | 2014-02-16 15:59:00 -0800 | [diff] [blame] | 144 | static inline mirror::ArtMethod* FindMethodFromCode(uint32_t method_idx, |
Mathieu Chartier | 0cd8135 | 2014-05-22 16:48:55 -0700 | [diff] [blame] | 145 | mirror::Object** this_object, |
Mingyao Yang | 98d1cc8 | 2014-05-15 17:02:16 -0700 | [diff] [blame^] | 146 | mirror::ArtMethod** referrer, Thread* self) |
| 147 | SHARED_LOCKS_REQUIRED(Locks::mutator_lock_); |
Ian Rogers | 57b86d4 | 2012-03-27 16:05:41 -0700 | [diff] [blame] | 148 | |
Ian Rogers | 08f753d | 2012-08-24 14:35:25 -0700 | [diff] [blame] | 149 | // Fast path field resolution that can't initialize classes or throw exceptions. |
Brian Carlstrom | ea46f95 | 2013-07-30 01:26:50 -0700 | [diff] [blame] | 150 | static inline mirror::ArtField* FindFieldFast(uint32_t field_idx, |
Ian Rogers | ef7d42f | 2014-01-06 12:55:46 -0800 | [diff] [blame] | 151 | mirror::ArtMethod* referrer, |
Brian Carlstrom | ea46f95 | 2013-07-30 01:26:50 -0700 | [diff] [blame] | 152 | FindFieldType type, size_t expected_size) |
Mingyao Yang | 98d1cc8 | 2014-05-15 17:02:16 -0700 | [diff] [blame^] | 153 | SHARED_LOCKS_REQUIRED(Locks::mutator_lock_); |
Ian Rogers | 57b86d4 | 2012-03-27 16:05:41 -0700 | [diff] [blame] | 154 | |
Ian Rogers | 08f753d | 2012-08-24 14:35:25 -0700 | [diff] [blame] | 155 | // Fast path method resolution that can't throw exceptions. |
Brian Carlstrom | ea46f95 | 2013-07-30 01:26:50 -0700 | [diff] [blame] | 156 | static inline mirror::ArtMethod* FindMethodFast(uint32_t method_idx, |
| 157 | mirror::Object* this_object, |
Ian Rogers | ef7d42f | 2014-01-06 12:55:46 -0800 | [diff] [blame] | 158 | mirror::ArtMethod* referrer, |
Brian Carlstrom | ea46f95 | 2013-07-30 01:26:50 -0700 | [diff] [blame] | 159 | bool access_check, InvokeType type) |
Mingyao Yang | 98d1cc8 | 2014-05-15 17:02:16 -0700 | [diff] [blame^] | 160 | SHARED_LOCKS_REQUIRED(Locks::mutator_lock_); |
Ian Rogers | 57b86d4 | 2012-03-27 16:05:41 -0700 | [diff] [blame] | 161 | |
Ian Rogers | fa46d3e | 2013-05-15 00:16:04 -0700 | [diff] [blame] | 162 | static inline mirror::Class* ResolveVerifyAndClinit(uint32_t type_idx, |
Ian Rogers | ef7d42f | 2014-01-06 12:55:46 -0800 | [diff] [blame] | 163 | mirror::ArtMethod* referrer, |
Ian Rogers | fa46d3e | 2013-05-15 00:16:04 -0700 | [diff] [blame] | 164 | Thread* self, bool can_run_clinit, |
| 165 | bool verify_access) |
Mingyao Yang | 98d1cc8 | 2014-05-15 17:02:16 -0700 | [diff] [blame^] | 166 | SHARED_LOCKS_REQUIRED(Locks::mutator_lock_); |
Ian Rogers | 57b86d4 | 2012-03-27 16:05:41 -0700 | [diff] [blame] | 167 | |
jeffhao | d752132 | 2012-11-21 15:38:24 -0800 | [diff] [blame] | 168 | extern void ThrowStackOverflowError(Thread* self) SHARED_LOCKS_REQUIRED(Locks::mutator_lock_); |
| 169 | |
Ian Rogers | ef7d42f | 2014-01-06 12:55:46 -0800 | [diff] [blame] | 170 | static inline mirror::String* ResolveStringFromCode(mirror::ArtMethod* referrer, |
Ian Rogers | 2dd0e2c | 2013-01-24 12:42:14 -0800 | [diff] [blame] | 171 | uint32_t string_idx) |
Mingyao Yang | 98d1cc8 | 2014-05-15 17:02:16 -0700 | [diff] [blame^] | 172 | SHARED_LOCKS_REQUIRED(Locks::mutator_lock_); |
Shih-wei Liao | 2d83101 | 2011-09-28 22:06:53 -0700 | [diff] [blame] | 173 | |
TDYa127 | 3d71d80 | 2012-08-15 03:47:03 -0700 | [diff] [blame] | 174 | static inline void UnlockJniSynchronizedMethod(jobject locked, Thread* self) |
Mingyao Yang | 98d1cc8 | 2014-05-15 17:02:16 -0700 | [diff] [blame^] | 175 | SHARED_LOCKS_REQUIRED(Locks::mutator_lock_); |
TDYa127 | 3d71d80 | 2012-08-15 03:47:03 -0700 | [diff] [blame] | 176 | |
Ian Rogers | 2dd0e2c | 2013-01-24 12:42:14 -0800 | [diff] [blame] | 177 | static inline void CheckReferenceResult(mirror::Object* o, Thread* self) |
Mingyao Yang | 98d1cc8 | 2014-05-15 17:02:16 -0700 | [diff] [blame^] | 178 | SHARED_LOCKS_REQUIRED(Locks::mutator_lock_); |
TDYa127 | 3d71d80 | 2012-08-15 03:47:03 -0700 | [diff] [blame] | 179 | |
Mingyao Yang | 98d1cc8 | 2014-05-15 17:02:16 -0700 | [diff] [blame^] | 180 | static inline void CheckSuspend(Thread* thread) SHARED_LOCKS_REQUIRED(Locks::mutator_lock_); |
jeffhao | 373c52f | 2012-11-20 16:11:52 -0800 | [diff] [blame] | 181 | |
Mathieu Chartier | 2b7c4d1 | 2014-05-19 10:52:16 -0700 | [diff] [blame] | 182 | JValue InvokeProxyInvocationHandler(ScopedObjectAccessAlreadyRunnable& soa, const char* shorty, |
Brian Carlstrom | ea46f95 | 2013-07-30 01:26:50 -0700 | [diff] [blame] | 183 | jobject rcvr_jobj, jobject interface_art_method_jobj, |
Ian Rogers | af6e67a | 2013-01-16 08:38:37 -0800 | [diff] [blame] | 184 | std::vector<jvalue>& args) |
Brian Carlstrom | 02c8cc6 | 2013-07-18 15:54:44 -0700 | [diff] [blame] | 185 | SHARED_LOCKS_REQUIRED(Locks::mutator_lock_); |
Ian Rogers | af6e67a | 2013-01-16 08:38:37 -0800 | [diff] [blame] | 186 | |
Jeff Hao | 58df327 | 2013-04-22 15:28:53 -0700 | [diff] [blame] | 187 | // Entry point for deoptimization. |
Ian Rogers | 848871b | 2013-08-05 10:56:33 -0700 | [diff] [blame] | 188 | extern "C" void art_quick_deoptimize(); |
| 189 | static inline uintptr_t GetQuickDeoptimizationEntryPoint() { |
Jeff Hao | 58df327 | 2013-04-22 15:28:53 -0700 | [diff] [blame] | 190 | return reinterpret_cast<uintptr_t>(art_quick_deoptimize); |
| 191 | } |
| 192 | |
| 193 | // Return address of instrumentation stub. |
Ian Rogers | 848871b | 2013-08-05 10:56:33 -0700 | [diff] [blame] | 194 | extern "C" void art_quick_instrumentation_entry(void*); |
| 195 | static inline void* GetQuickInstrumentationEntryPoint() { |
| 196 | return reinterpret_cast<void*>(art_quick_instrumentation_entry); |
Jeff Hao | 58df327 | 2013-04-22 15:28:53 -0700 | [diff] [blame] | 197 | } |
| 198 | |
| 199 | // The return_pc of instrumentation exit stub. |
Ian Rogers | 848871b | 2013-08-05 10:56:33 -0700 | [diff] [blame] | 200 | extern "C" void art_quick_instrumentation_exit(); |
| 201 | static inline uintptr_t GetQuickInstrumentationExitPc() { |
| 202 | return reinterpret_cast<uintptr_t>(art_quick_instrumentation_exit); |
| 203 | } |
| 204 | |
Brian Carlstrom | ea46f95 | 2013-07-30 01:26:50 -0700 | [diff] [blame] | 205 | extern "C" void art_portable_to_interpreter_bridge(mirror::ArtMethod*); |
Ian Rogers | 848871b | 2013-08-05 10:56:33 -0700 | [diff] [blame] | 206 | static inline const void* GetPortableToInterpreterBridge() { |
| 207 | return reinterpret_cast<void*>(art_portable_to_interpreter_bridge); |
| 208 | } |
| 209 | |
Ian Rogers | ef7d42f | 2014-01-06 12:55:46 -0800 | [diff] [blame] | 210 | static inline const void* GetPortableToQuickBridge() { |
| 211 | // TODO: portable to quick bridge. Bug: 8196384 |
| 212 | return GetPortableToInterpreterBridge(); |
| 213 | } |
| 214 | |
Brian Carlstrom | ea46f95 | 2013-07-30 01:26:50 -0700 | [diff] [blame] | 215 | extern "C" void art_quick_to_interpreter_bridge(mirror::ArtMethod*); |
Ian Rogers | 848871b | 2013-08-05 10:56:33 -0700 | [diff] [blame] | 216 | static inline const void* GetQuickToInterpreterBridge() { |
| 217 | return reinterpret_cast<void*>(art_quick_to_interpreter_bridge); |
Jeff Hao | 58df327 | 2013-04-22 15:28:53 -0700 | [diff] [blame] | 218 | } |
| 219 | |
Ian Rogers | ef7d42f | 2014-01-06 12:55:46 -0800 | [diff] [blame] | 220 | static inline const void* GetQuickToPortableBridge() { |
| 221 | // TODO: quick to portable bridge. Bug: 8196384 |
Ian Rogers | 848871b | 2013-08-05 10:56:33 -0700 | [diff] [blame] | 222 | return GetQuickToInterpreterBridge(); |
Jeff Hao | 58df327 | 2013-04-22 15:28:53 -0700 | [diff] [blame] | 223 | } |
| 224 | |
Ian Rogers | 848871b | 2013-08-05 10:56:33 -0700 | [diff] [blame] | 225 | extern "C" void art_portable_proxy_invoke_handler(); |
| 226 | static inline const void* GetPortableProxyInvokeHandler() { |
| 227 | return reinterpret_cast<void*>(art_portable_proxy_invoke_handler); |
Jeff Hao | 79fe539 | 2013-04-24 18:41:58 -0700 | [diff] [blame] | 228 | } |
| 229 | |
Ian Rogers | 848871b | 2013-08-05 10:56:33 -0700 | [diff] [blame] | 230 | extern "C" void art_quick_proxy_invoke_handler(); |
| 231 | static inline const void* GetQuickProxyInvokeHandler() { |
| 232 | return reinterpret_cast<void*>(art_quick_proxy_invoke_handler); |
Jeff Hao | 79fe539 | 2013-04-24 18:41:58 -0700 | [diff] [blame] | 233 | } |
| 234 | |
Ian Rogers | 848871b | 2013-08-05 10:56:33 -0700 | [diff] [blame] | 235 | extern "C" void* art_jni_dlsym_lookup_stub(JNIEnv*, jobject); |
Jeff Hao | 79fe539 | 2013-04-24 18:41:58 -0700 | [diff] [blame] | 236 | static inline void* GetJniDlsymLookupStub() { |
| 237 | return reinterpret_cast<void*>(art_jni_dlsym_lookup_stub); |
| 238 | } |
Jeff Hao | 58df327 | 2013-04-22 15:28:53 -0700 | [diff] [blame] | 239 | |
Ian Rogers | 450dcb5 | 2013-09-20 17:36:02 -0700 | [diff] [blame] | 240 | template <typename INT_TYPE, typename FLOAT_TYPE> |
Mingyao Yang | 98d1cc8 | 2014-05-15 17:02:16 -0700 | [diff] [blame^] | 241 | static inline INT_TYPE art_float_to_integral(FLOAT_TYPE f); |
Ian Rogers | 450dcb5 | 2013-09-20 17:36:02 -0700 | [diff] [blame] | 242 | |
Shih-wei Liao | 2d83101 | 2011-09-28 22:06:53 -0700 | [diff] [blame] | 243 | } // namespace art |
Ian Rogers | ad42e13 | 2011-09-17 20:23:33 -0700 | [diff] [blame] | 244 | |
Ian Rogers | 7655f29 | 2013-07-29 11:07:13 -0700 | [diff] [blame] | 245 | #endif // ART_RUNTIME_ENTRYPOINTS_ENTRYPOINT_UTILS_H_ |