Andreas Gampe | e179456 | 2014-11-04 22:26:32 -0800 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2014 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_QUICK_QUICK_DEFAULT_EXTERNS_H_ |
| 18 | #define ART_RUNTIME_ENTRYPOINTS_QUICK_QUICK_DEFAULT_EXTERNS_H_ |
| 19 | |
| 20 | #include <cstdint> |
| 21 | |
Andreas Gampe | 1cc7dba | 2014-12-17 18:43:01 -0800 | [diff] [blame] | 22 | namespace art { |
| 23 | namespace mirror { |
| 24 | class Array; |
Andreas Gampe | 1cc7dba | 2014-12-17 18:43:01 -0800 | [diff] [blame] | 25 | class Class; |
| 26 | class Object; |
| 27 | } // namespace mirror |
Mathieu Chartier | e401d14 | 2015-04-22 13:56:20 -0700 | [diff] [blame] | 28 | class ArtMethod; |
Andreas Gampe | 1cc7dba | 2014-12-17 18:43:01 -0800 | [diff] [blame] | 29 | } // namespace art |
| 30 | |
Andreas Gampe | e179456 | 2014-11-04 22:26:32 -0800 | [diff] [blame] | 31 | // These are extern declarations of assembly stubs with common names. |
| 32 | |
| 33 | // Cast entrypoints. |
Mathieu Chartier | b99f4d6 | 2016-11-07 16:17:26 -0800 | [diff] [blame] | 34 | extern "C" void art_quick_check_instance_of(art::mirror::Object*, art::mirror::Class*); |
Andreas Gampe | e179456 | 2014-11-04 22:26:32 -0800 | [diff] [blame] | 35 | |
Vladimir Marko | a9f303c | 2018-07-20 16:43:56 +0100 | [diff] [blame] | 36 | // Resolution and initialization entrypoints. |
| 37 | extern "C" void* art_quick_initialize_static_storage(art::mirror::Class*); |
Vladimir Marko | 9d47925 | 2018-07-24 11:35:20 +0100 | [diff] [blame] | 38 | extern "C" void* art_quick_resolve_type(uint32_t); |
| 39 | extern "C" void* art_quick_resolve_type_and_verify_access(uint32_t); |
Orion Hodson | dbaa5c7 | 2018-05-10 08:22:46 +0100 | [diff] [blame] | 40 | extern "C" void* art_quick_resolve_method_handle(uint32_t); |
Orion Hodson | 18259d7 | 2018-04-12 11:18:23 +0100 | [diff] [blame] | 41 | extern "C" void* art_quick_resolve_method_type(uint32_t); |
Vladimir Marko | 5ea536a | 2015-04-20 20:11:30 +0100 | [diff] [blame] | 42 | extern "C" void* art_quick_resolve_string(uint32_t); |
Andreas Gampe | e179456 | 2014-11-04 22:26:32 -0800 | [diff] [blame] | 43 | |
| 44 | // Field entrypoints. |
| 45 | extern "C" int art_quick_set8_instance(uint32_t, void*, int8_t); |
| 46 | extern "C" int art_quick_set8_static(uint32_t, int8_t); |
| 47 | extern "C" int art_quick_set16_instance(uint32_t, void*, int16_t); |
| 48 | extern "C" int art_quick_set16_static(uint32_t, int16_t); |
| 49 | extern "C" int art_quick_set32_instance(uint32_t, void*, int32_t); |
| 50 | extern "C" int art_quick_set32_static(uint32_t, int32_t); |
| 51 | extern "C" int art_quick_set64_instance(uint32_t, void*, int64_t); |
| 52 | extern "C" int art_quick_set64_static(uint32_t, int64_t); |
| 53 | extern "C" int art_quick_set_obj_instance(uint32_t, void*, void*); |
| 54 | extern "C" int art_quick_set_obj_static(uint32_t, void*); |
Andreas Gampe | 6740997 | 2016-07-19 22:34:53 -0700 | [diff] [blame] | 55 | extern "C" ssize_t art_quick_get_byte_instance(uint32_t, void*); |
| 56 | extern "C" size_t art_quick_get_boolean_instance(uint32_t, void*); |
| 57 | extern "C" ssize_t art_quick_get_byte_static(uint32_t); |
| 58 | extern "C" size_t art_quick_get_boolean_static(uint32_t); |
| 59 | extern "C" ssize_t art_quick_get_short_instance(uint32_t, void*); |
| 60 | extern "C" size_t art_quick_get_char_instance(uint32_t, void*); |
| 61 | extern "C" ssize_t art_quick_get_short_static(uint32_t); |
| 62 | extern "C" size_t art_quick_get_char_static(uint32_t); |
| 63 | extern "C" ssize_t art_quick_get32_instance(uint32_t, void*); |
| 64 | extern "C" ssize_t art_quick_get32_static(uint32_t); |
Andreas Gampe | e179456 | 2014-11-04 22:26:32 -0800 | [diff] [blame] | 65 | extern "C" int64_t art_quick_get64_instance(uint32_t, void*); |
| 66 | extern "C" int64_t art_quick_get64_static(uint32_t); |
| 67 | extern "C" void* art_quick_get_obj_instance(uint32_t, void*); |
| 68 | extern "C" void* art_quick_get_obj_static(uint32_t); |
| 69 | |
| 70 | // Array entrypoints. |
Andreas Gampe | 1cc7dba | 2014-12-17 18:43:01 -0800 | [diff] [blame] | 71 | extern "C" void art_quick_aput_obj_with_null_and_bound_check(art::mirror::Array*, int32_t, |
| 72 | art::mirror::Object*); |
| 73 | extern "C" void art_quick_aput_obj_with_bound_check(art::mirror::Array*, int32_t, |
| 74 | art::mirror::Object*); |
| 75 | extern "C" void art_quick_aput_obj(art::mirror::Array*, int32_t, art::mirror::Object*); |
Andreas Gampe | e179456 | 2014-11-04 22:26:32 -0800 | [diff] [blame] | 76 | extern "C" void art_quick_handle_fill_data(void*, void*); |
| 77 | |
| 78 | // Lock entrypoints. |
Andreas Gampe | 1cc7dba | 2014-12-17 18:43:01 -0800 | [diff] [blame] | 79 | extern "C" void art_quick_lock_object(art::mirror::Object*); |
| 80 | extern "C" void art_quick_unlock_object(art::mirror::Object*); |
Andreas Gampe | e179456 | 2014-11-04 22:26:32 -0800 | [diff] [blame] | 81 | |
Andreas Gampe | c7ed09b | 2016-04-25 20:08:55 -0700 | [diff] [blame] | 82 | // Lock entrypoints that do not inline any behavior (e.g., thin-locks). |
| 83 | extern "C" void art_quick_lock_object_no_inline(art::mirror::Object*); |
| 84 | extern "C" void art_quick_unlock_object_no_inline(art::mirror::Object*); |
| 85 | |
Andreas Gampe | e179456 | 2014-11-04 22:26:32 -0800 | [diff] [blame] | 86 | // Math entrypoints. |
| 87 | extern "C" int64_t art_quick_d2l(double); |
| 88 | extern "C" int64_t art_quick_f2l(float); |
Roland Levillain | c6328be | 2015-06-03 11:26:05 +0100 | [diff] [blame] | 89 | extern "C" float art_quick_l2f(int64_t); |
Andreas Gampe | e179456 | 2014-11-04 22:26:32 -0800 | [diff] [blame] | 90 | extern "C" int64_t art_quick_ldiv(int64_t, int64_t); |
| 91 | extern "C" int64_t art_quick_lmod(int64_t, int64_t); |
| 92 | extern "C" int64_t art_quick_lmul(int64_t, int64_t); |
| 93 | extern "C" uint64_t art_quick_lshl(uint64_t, uint32_t); |
| 94 | extern "C" uint64_t art_quick_lshr(uint64_t, uint32_t); |
| 95 | extern "C" uint64_t art_quick_lushr(uint64_t, uint32_t); |
| 96 | extern "C" int64_t art_quick_mul_long(int64_t, int64_t); |
| 97 | extern "C" uint64_t art_quick_shl_long(uint64_t, uint32_t); |
| 98 | extern "C" uint64_t art_quick_shr_long(uint64_t, uint32_t); |
| 99 | extern "C" uint64_t art_quick_ushr_long(uint64_t, uint32_t); |
| 100 | |
| 101 | // Intrinsic entrypoints. |
Roland Levillain | 42ad288 | 2016-02-29 18:26:54 +0000 | [diff] [blame] | 102 | extern "C" int32_t art_quick_indexof(void*, uint32_t, uint32_t); |
Andreas Gampe | e179456 | 2014-11-04 22:26:32 -0800 | [diff] [blame] | 103 | extern "C" int32_t art_quick_string_compareto(void*, void*); |
| 104 | extern "C" void* art_quick_memcpy(void*, const void*, size_t); |
| 105 | |
| 106 | // Invoke entrypoints. |
Mathieu Chartier | e401d14 | 2015-04-22 13:56:20 -0700 | [diff] [blame] | 107 | extern "C" void art_quick_imt_conflict_trampoline(art::ArtMethod*); |
| 108 | extern "C" void art_quick_resolution_trampoline(art::ArtMethod*); |
| 109 | extern "C" void art_quick_to_interpreter_bridge(art::ArtMethod*); |
Andreas Gampe | e179456 | 2014-11-04 22:26:32 -0800 | [diff] [blame] | 110 | extern "C" void art_quick_invoke_direct_trampoline_with_access_check(uint32_t, void*); |
| 111 | extern "C" void art_quick_invoke_interface_trampoline_with_access_check(uint32_t, void*); |
| 112 | extern "C" void art_quick_invoke_static_trampoline_with_access_check(uint32_t, void*); |
| 113 | extern "C" void art_quick_invoke_super_trampoline_with_access_check(uint32_t, void*); |
Orion Hodson | ac14139 | 2017-01-13 11:53:47 +0000 | [diff] [blame] | 114 | |
Andreas Gampe | e179456 | 2014-11-04 22:26:32 -0800 | [diff] [blame] | 115 | extern "C" void art_quick_invoke_virtual_trampoline_with_access_check(uint32_t, void*); |
| 116 | |
Vladimir Marko | 4d52715 | 2021-11-23 12:07:04 +0000 | [diff] [blame] | 117 | // JNI read barrier entrypoint. Note: Preserves all registers. |
Vladimir Marko | 8439e45 | 2021-11-25 15:36:29 +0000 | [diff] [blame] | 118 | extern "C" void art_jni_read_barrier(art::ArtMethod* method); |
Vladimir Marko | ad33392 | 2021-11-02 10:51:57 +0000 | [diff] [blame] | 119 | |
Vladimir Marko | ce2a344 | 2021-11-24 15:10:26 +0000 | [diff] [blame] | 120 | // JNI method start entrypoint. Note: Custom calling convention. |
| 121 | extern "C" void art_jni_method_start(); |
| 122 | extern "C" void art_jni_monitored_method_start(); |
Vladimir Marko | e74e0ce | 2021-12-08 14:16:21 +0000 | [diff] [blame] | 123 | extern "C" void art_jni_method_end(); |
| 124 | extern "C" void art_jni_monitored_method_end(); |
Mythri Alle | 6fb0acc | 2022-06-27 11:09:49 +0000 | [diff] [blame^] | 125 | extern "C" void art_jni_method_entry_hook(); |
Vladimir Marko | ce2a344 | 2021-11-24 15:10:26 +0000 | [diff] [blame] | 126 | |
Vladimir Marko | 4d52715 | 2021-11-23 12:07:04 +0000 | [diff] [blame] | 127 | // JNI lock/unlock entrypoints. Note: Custom calling convention. |
Vladimir Marko | 8439e45 | 2021-11-25 15:36:29 +0000 | [diff] [blame] | 128 | extern "C" void art_jni_lock_object(art::mirror::Object*); |
Vladimir Marko | f76aae1 | 2021-11-26 10:53:23 +0000 | [diff] [blame] | 129 | extern "C" void art_jni_lock_object_no_inline(art::mirror::Object*); |
Vladimir Marko | 8439e45 | 2021-11-25 15:36:29 +0000 | [diff] [blame] | 130 | extern "C" void art_jni_unlock_object(art::mirror::Object*); |
Vladimir Marko | f76aae1 | 2021-11-26 10:53:23 +0000 | [diff] [blame] | 131 | extern "C" void art_jni_unlock_object_no_inline(art::mirror::Object*); |
Vladimir Marko | 4d52715 | 2021-11-23 12:07:04 +0000 | [diff] [blame] | 132 | |
Orion Hodson | 4c8e12e | 2018-05-18 08:33:20 +0100 | [diff] [blame] | 133 | // Polymorphic invoke entrypoints. |
Orion Hodson | ac14139 | 2017-01-13 11:53:47 +0000 | [diff] [blame] | 134 | extern "C" void art_quick_invoke_polymorphic(uint32_t, void*); |
Orion Hodson | 4c8e12e | 2018-05-18 08:33:20 +0100 | [diff] [blame] | 135 | extern "C" void art_quick_invoke_custom(uint32_t, void*); |
Orion Hodson | ac14139 | 2017-01-13 11:53:47 +0000 | [diff] [blame] | 136 | |
Andreas Gampe | e179456 | 2014-11-04 22:26:32 -0800 | [diff] [blame] | 137 | // Thread entrypoints. |
| 138 | extern "C" void art_quick_test_suspend(); |
| 139 | |
| 140 | // Throw entrypoints. |
Andreas Gampe | 1cc7dba | 2014-12-17 18:43:01 -0800 | [diff] [blame] | 141 | extern "C" void art_quick_deliver_exception(art::mirror::Object*); |
Andreas Gampe | e179456 | 2014-11-04 22:26:32 -0800 | [diff] [blame] | 142 | extern "C" void art_quick_throw_array_bounds(int32_t index, int32_t limit); |
| 143 | extern "C" void art_quick_throw_div_zero(); |
Andreas Gampe | e179456 | 2014-11-04 22:26:32 -0800 | [diff] [blame] | 144 | extern "C" void art_quick_throw_null_pointer_exception(); |
Nicolas Geoffray | e8e1127 | 2016-06-28 18:08:46 +0100 | [diff] [blame] | 145 | extern "C" void art_quick_throw_null_pointer_exception_from_signal(uintptr_t address); |
Andreas Gampe | e179456 | 2014-11-04 22:26:32 -0800 | [diff] [blame] | 146 | extern "C" void art_quick_throw_stack_overflow(void*); |
Vladimir Marko | 87f3fcb | 2016-04-28 15:52:11 +0100 | [diff] [blame] | 147 | extern "C" void art_quick_throw_string_bounds(int32_t index, int32_t limit); |
Andreas Gampe | e179456 | 2014-11-04 22:26:32 -0800 | [diff] [blame] | 148 | |
Nicolas Geoffray | e2a3aa9 | 2019-11-25 17:52:58 +0000 | [diff] [blame] | 149 | // Inline cache. |
| 150 | extern "C" void art_quick_update_inline_cache(); |
| 151 | |
Andreas Gampe | e179456 | 2014-11-04 22:26:32 -0800 | [diff] [blame] | 152 | #endif // ART_RUNTIME_ENTRYPOINTS_QUICK_QUICK_DEFAULT_EXTERNS_H_ |