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