/*
 * Copyright (C) 2014 The Android Open Source Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

#ifndef ART_RUNTIME_ENTRYPOINTS_QUICK_QUICK_DEFAULT_EXTERNS_H_
#define ART_RUNTIME_ENTRYPOINTS_QUICK_QUICK_DEFAULT_EXTERNS_H_

#include <cstdint>

namespace art HIDDEN {
namespace mirror {
class Array;
class Class;
class Object;
}  // namespace mirror
class ArtMethod;
}  // namespace art

// These are extern declarations of assembly stubs with common names.

// Cast entrypoints.
extern "C" void art_quick_check_instance_of(art::mirror::Object*, art::mirror::Class*);

// Resolution and initialization entrypoints.
extern "C" void* art_quick_initialize_static_storage(art::mirror::Class*);
extern "C" void* art_quick_resolve_type(uint32_t);
extern "C" void* art_quick_resolve_type_and_verify_access(uint32_t);
extern "C" void* art_quick_resolve_method_handle(uint32_t);
extern "C" void* art_quick_resolve_method_type(uint32_t);
extern "C" void* art_quick_resolve_string(uint32_t);

// Field entrypoints.
extern "C" int art_quick_set8_instance(uint32_t, void*, int8_t);
extern "C" int art_quick_set8_static(uint32_t, int8_t);
extern "C" int art_quick_set16_instance(uint32_t, void*, int16_t);
extern "C" int art_quick_set16_static(uint32_t, int16_t);
extern "C" int art_quick_set32_instance(uint32_t, void*, int32_t);
extern "C" int art_quick_set32_static(uint32_t, int32_t);
extern "C" int art_quick_set64_instance(uint32_t, void*, int64_t);
extern "C" int art_quick_set64_static(uint32_t, int64_t);
extern "C" int art_quick_set_obj_instance(uint32_t, void*, void*);
extern "C" int art_quick_set_obj_static(uint32_t, void*);
extern "C" ssize_t art_quick_get_byte_instance(uint32_t, void*);
extern "C" size_t art_quick_get_boolean_instance(uint32_t, void*);
extern "C" ssize_t art_quick_get_byte_static(uint32_t);
extern "C" size_t art_quick_get_boolean_static(uint32_t);
extern "C" ssize_t art_quick_get_short_instance(uint32_t, void*);
extern "C" size_t art_quick_get_char_instance(uint32_t, void*);
extern "C" ssize_t art_quick_get_short_static(uint32_t);
extern "C" size_t art_quick_get_char_static(uint32_t);
extern "C" ssize_t art_quick_get32_instance(uint32_t, void*);
extern "C" ssize_t art_quick_get32_static(uint32_t);
extern "C" int64_t art_quick_get64_instance(uint32_t, void*);
extern "C" int64_t art_quick_get64_static(uint32_t);
extern "C" void* art_quick_get_obj_instance(uint32_t, void*);
extern "C" void* art_quick_get_obj_static(uint32_t);

// Array entrypoints.
extern "C" void art_quick_aput_obj_with_null_and_bound_check(art::mirror::Array*, int32_t,
                                                             art::mirror::Object*);
extern "C" void art_quick_aput_obj_with_bound_check(art::mirror::Array*, int32_t,
                                                    art::mirror::Object*);
extern "C" void art_quick_aput_obj(art::mirror::Array*, int32_t, art::mirror::Object*);
extern "C" void art_quick_handle_fill_data(void*, void*);

// Lock entrypoints.
extern "C" void art_quick_lock_object(art::mirror::Object*);
extern "C" void art_quick_unlock_object(art::mirror::Object*);

// Lock entrypoints that do not inline any behavior (e.g., thin-locks).
extern "C" void art_quick_lock_object_no_inline(art::mirror::Object*);
extern "C" void art_quick_unlock_object_no_inline(art::mirror::Object*);

// Math entrypoints.
extern "C" int64_t art_quick_d2l(double);
extern "C" int64_t art_quick_f2l(float);
extern "C" float art_quick_l2f(int64_t);
extern "C" int64_t art_quick_ldiv(int64_t, int64_t);
extern "C" int64_t art_quick_lmod(int64_t, int64_t);
extern "C" int64_t art_quick_lmul(int64_t, int64_t);
extern "C" uint64_t art_quick_lshl(uint64_t, uint32_t);
extern "C" uint64_t art_quick_lshr(uint64_t, uint32_t);
extern "C" uint64_t art_quick_lushr(uint64_t, uint32_t);
extern "C" int64_t art_quick_mul_long(int64_t, int64_t);
extern "C" uint64_t art_quick_shl_long(uint64_t, uint32_t);
extern "C" uint64_t art_quick_shr_long(uint64_t, uint32_t);
extern "C" uint64_t art_quick_ushr_long(uint64_t, uint32_t);

// Intrinsic entrypoints.
extern "C" int32_t art_quick_indexof(void*, uint32_t, uint32_t);
extern "C" int32_t art_quick_string_compareto(void*, void*);
extern "C" void* art_quick_memcpy(void*, const void*, size_t);

// Invoke entrypoints.
extern "C" void art_quick_imt_conflict_trampoline(art::ArtMethod*);
extern "C" void art_quick_resolution_trampoline(art::ArtMethod*);
extern "C" void art_quick_to_interpreter_bridge(art::ArtMethod*);
extern "C" void art_quick_invoke_direct_trampoline_with_access_check(uint32_t, void*);
extern "C" void art_quick_invoke_interface_trampoline_with_access_check(uint32_t, void*);
extern "C" void art_quick_invoke_static_trampoline_with_access_check(uint32_t, void*);
extern "C" void art_quick_invoke_super_trampoline_with_access_check(uint32_t, void*);

extern "C" void art_quick_invoke_virtual_trampoline_with_access_check(uint32_t, void*);

// JNI read barrier entrypoint. Note: Preserves all registers.
extern "C" void art_jni_read_barrier(art::ArtMethod* method);

// JNI method start entrypoint. Note: Custom calling convention.
extern "C" void art_jni_method_start();
extern "C" void art_jni_monitored_method_start();
extern "C" void art_jni_method_end();
extern "C" void art_jni_monitored_method_end();
extern "C" void art_jni_method_entry_hook();

// JNI lock/unlock entrypoints. Note: Custom calling convention.
extern "C" void art_jni_lock_object(art::mirror::Object*);
extern "C" void art_jni_lock_object_no_inline(art::mirror::Object*);
extern "C" void art_jni_unlock_object(art::mirror::Object*);
extern "C" void art_jni_unlock_object_no_inline(art::mirror::Object*);

// Polymorphic invoke entrypoints.
extern "C" void art_quick_invoke_polymorphic(uint32_t, void*);
extern "C" void art_quick_invoke_custom(uint32_t, void*);

// Thread entrypoints.
extern "C" void art_quick_test_suspend();

// Throw entrypoints.
extern "C" void art_quick_deliver_exception(art::mirror::Object*);
extern "C" void art_quick_throw_array_bounds(int32_t index, int32_t limit);
extern "C" void art_quick_throw_div_zero();
extern "C" void art_quick_throw_null_pointer_exception();
extern "C" void art_quick_throw_null_pointer_exception_from_signal(uintptr_t address);
extern "C" void art_quick_throw_stack_overflow(void*);
extern "C" void art_quick_throw_string_bounds(int32_t index, int32_t limit);

// Inline cache.
extern "C" void art_quick_update_inline_cache();

#endif  // ART_RUNTIME_ENTRYPOINTS_QUICK_QUICK_DEFAULT_EXTERNS_H_
