• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (C) 2016 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_INIT_ENTRYPOINTS_H_
18 #define ART_RUNTIME_ENTRYPOINTS_QUICK_QUICK_DEFAULT_INIT_ENTRYPOINTS_H_
19 
20 #include "base/logging.h"  // FOR VLOG_IS_ON.
21 #include "entrypoints/jni/jni_entrypoints.h"
22 #include "entrypoints/runtime_asm_entrypoints.h"
23 #include "quick_alloc_entrypoints.h"
24 #include "quick_default_externs.h"
25 #include "quick_entrypoints.h"
26 
27 namespace art {
28 
DefaultInitEntryPoints(JniEntryPoints * jpoints,QuickEntryPoints * qpoints,bool monitor_jni_entry_exit)29 static void DefaultInitEntryPoints(JniEntryPoints* jpoints,
30                                    QuickEntryPoints* qpoints,
31                                    bool monitor_jni_entry_exit) {
32   // JNI
33   jpoints->pDlsymLookup = reinterpret_cast<void*>(art_jni_dlsym_lookup_stub);
34   jpoints->pDlsymLookupCritical = reinterpret_cast<void*>(art_jni_dlsym_lookup_critical_stub);
35 
36   // Alloc
37   ResetQuickAllocEntryPoints(qpoints);
38 
39   // Resolution and initialization
40   qpoints->SetInitializeStaticStorage(art_quick_initialize_static_storage);
41   qpoints->SetResolveTypeAndVerifyAccess(art_quick_resolve_type_and_verify_access);
42   qpoints->SetResolveType(art_quick_resolve_type);
43   qpoints->SetResolveMethodHandle(art_quick_resolve_method_handle);
44   qpoints->SetResolveMethodType(art_quick_resolve_method_type);
45   qpoints->SetResolveString(art_quick_resolve_string);
46 
47   // Field
48   qpoints->SetSet8Instance(art_quick_set8_instance);
49   qpoints->SetSet8Static(art_quick_set8_static);
50   qpoints->SetSet16Instance(art_quick_set16_instance);
51   qpoints->SetSet16Static(art_quick_set16_static);
52   qpoints->SetSet32Instance(art_quick_set32_instance);
53   qpoints->SetSet32Static(art_quick_set32_static);
54   qpoints->SetSet64Instance(art_quick_set64_instance);
55   qpoints->SetSet64Static(art_quick_set64_static);
56   qpoints->SetSetObjInstance(art_quick_set_obj_instance);
57   qpoints->SetSetObjStatic(art_quick_set_obj_static);
58   qpoints->SetGetByteInstance(art_quick_get_byte_instance);
59   qpoints->SetGetBooleanInstance(art_quick_get_boolean_instance);
60   qpoints->SetGetShortInstance(art_quick_get_short_instance);
61   qpoints->SetGetCharInstance(art_quick_get_char_instance);
62   qpoints->SetGet32Instance(art_quick_get32_instance);
63   qpoints->SetGet64Instance(art_quick_get64_instance);
64   qpoints->SetGetObjInstance(art_quick_get_obj_instance);
65   qpoints->SetGetByteStatic(art_quick_get_byte_static);
66   qpoints->SetGetBooleanStatic(art_quick_get_boolean_static);
67   qpoints->SetGetShortStatic(art_quick_get_short_static);
68   qpoints->SetGetCharStatic(art_quick_get_char_static);
69   qpoints->SetGet32Static(art_quick_get32_static);
70   qpoints->SetGet64Static(art_quick_get64_static);
71   qpoints->SetGetObjStatic(art_quick_get_obj_static);
72 
73   // Array
74   qpoints->SetAputObject(art_quick_aput_obj);
75 
76   // JNI
77   qpoints->SetJniMethodStart(art_jni_method_start);
78   qpoints->SetJniMethodEnd(art_jni_method_end);
79   qpoints->SetQuickGenericJniTrampoline(art_quick_generic_jni_trampoline);
80   qpoints->SetJniDecodeReferenceResult(JniDecodeReferenceResult);
81   qpoints->SetJniReadBarrier(art_jni_read_barrier);
82   qpoints->SetJniMethodEntryHook(art_jni_method_entry_hook);
83 
84   // Locks
85   if (UNLIKELY(VLOG_IS_ON(systrace_lock_logging))) {
86     qpoints->SetJniLockObject(art_jni_lock_object_no_inline);
87     qpoints->SetJniUnlockObject(art_jni_unlock_object_no_inline);
88     qpoints->SetLockObject(art_quick_lock_object_no_inline);
89     qpoints->SetUnlockObject(art_quick_unlock_object_no_inline);
90   } else {
91     qpoints->SetJniLockObject(art_jni_lock_object);
92     qpoints->SetJniUnlockObject(art_jni_unlock_object);
93     qpoints->SetLockObject(art_quick_lock_object);
94     qpoints->SetUnlockObject(art_quick_unlock_object);
95   }
96 
97   // Invocation
98   qpoints->SetQuickImtConflictTrampoline(art_quick_imt_conflict_trampoline);
99   qpoints->SetQuickResolutionTrampoline(art_quick_resolution_trampoline);
100   qpoints->SetQuickToInterpreterBridge(art_quick_to_interpreter_bridge);
101   qpoints->SetInvokeDirectTrampolineWithAccessCheck(
102       art_quick_invoke_direct_trampoline_with_access_check);
103   qpoints->SetInvokeInterfaceTrampolineWithAccessCheck(
104       art_quick_invoke_interface_trampoline_with_access_check);
105   qpoints->SetInvokeStaticTrampolineWithAccessCheck(
106       art_quick_invoke_static_trampoline_with_access_check);
107   qpoints->SetInvokeSuperTrampolineWithAccessCheck(
108       art_quick_invoke_super_trampoline_with_access_check);
109   qpoints->SetInvokeVirtualTrampolineWithAccessCheck(
110       art_quick_invoke_virtual_trampoline_with_access_check);
111   qpoints->SetInvokePolymorphic(art_quick_invoke_polymorphic);
112   qpoints->SetInvokeCustom(art_quick_invoke_custom);
113 
114   // Thread
115   qpoints->SetTestSuspend(art_quick_test_suspend);
116 
117   // Throws
118   qpoints->SetDeliverException(art_quick_deliver_exception);
119   qpoints->SetThrowArrayBounds(art_quick_throw_array_bounds);
120   qpoints->SetThrowDivZero(art_quick_throw_div_zero);
121   qpoints->SetThrowNullPointer(art_quick_throw_null_pointer_exception);
122   qpoints->SetThrowStackOverflow(art_quick_throw_stack_overflow);
123   qpoints->SetThrowStringBounds(art_quick_throw_string_bounds);
124 
125   // Deoptimize
126   qpoints->SetDeoptimize(art_quick_deoptimize_from_compiled_code);
127 
128   // StringBuilder append
129   qpoints->SetStringBuilderAppend(art_quick_string_builder_append);
130 
131   // Tiered JIT support
132   qpoints->SetUpdateInlineCache(art_quick_update_inline_cache);
133   qpoints->SetCompileOptimized(art_quick_compile_optimized);
134 
135   // Tracing hooks
136   qpoints->SetMethodEntryHook(art_quick_method_entry_hook);
137   qpoints->SetMethodExitHook(art_quick_method_exit_hook);
138 
139   if (monitor_jni_entry_exit) {
140     qpoints->SetJniMethodStart(art_jni_monitored_method_start);
141     qpoints->SetJniMethodEnd(art_jni_monitored_method_end);
142   }
143 }
144 
145 }  // namespace art
146 
147 #endif  // ART_RUNTIME_ENTRYPOINTS_QUICK_QUICK_DEFAULT_INIT_ENTRYPOINTS_H_
148