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 */
16
17 #include "entrypoints/entrypoint_utils-inl.h"
18 #include "gc/accounting/card_table-inl.h"
19 #include "mirror/art_method-inl.h"
20 #include "mirror/object-inl.h"
21
22 namespace art {
23
art_portable_initialize_static_storage_from_code(uint32_t type_idx,mirror::ArtMethod * referrer,Thread * thread)24 extern "C" mirror::Object* art_portable_initialize_static_storage_from_code(uint32_t type_idx,
25 mirror::ArtMethod* referrer,
26 Thread* thread)
27 SHARED_LOCKS_REQUIRED(Locks::mutator_lock_) {
28 return ResolveVerifyAndClinit(type_idx, referrer, thread, true, false);
29 }
30
art_portable_initialize_type_from_code(uint32_t type_idx,mirror::ArtMethod * referrer,Thread * thread)31 extern "C" mirror::Object* art_portable_initialize_type_from_code(uint32_t type_idx,
32 mirror::ArtMethod* referrer,
33 Thread* thread)
34 SHARED_LOCKS_REQUIRED(Locks::mutator_lock_) {
35 return ResolveVerifyAndClinit(type_idx, referrer, thread, false, false);
36 }
37
art_portable_initialize_type_and_verify_access_from_code(uint32_t type_idx,mirror::ArtMethod * referrer,Thread * thread)38 extern "C" mirror::Object* art_portable_initialize_type_and_verify_access_from_code(uint32_t type_idx,
39 mirror::ArtMethod* referrer,
40 Thread* thread)
41 SHARED_LOCKS_REQUIRED(Locks::mutator_lock_) {
42 // Called when caller isn't guaranteed to have access to a type and the dex cache may be
43 // unpopulated
44 return ResolveVerifyAndClinit(type_idx, referrer, thread, false, true);
45 }
46
art_portable_resolve_string_from_code(mirror::ArtMethod * referrer,uint32_t string_idx)47 extern "C" mirror::Object* art_portable_resolve_string_from_code(mirror::ArtMethod* referrer,
48 uint32_t string_idx)
49 SHARED_LOCKS_REQUIRED(Locks::mutator_lock_) {
50 return ResolveStringFromCode(referrer, string_idx);
51 }
52
53 } // namespace art
54