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