blob: 9364c46abf2397f6e9b2e50e8961a623ff71b0e2 [file] [log] [blame]
Ian Rogers7655f292013-07-29 11:07:13 -07001/*
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
Mingyao Yang98d1cc82014-05-15 17:02:16 -070017#include "entrypoints/entrypoint_utils-inl.h"
Ian Rogers7655f292013-07-29 11:07:13 -070018#include "gc/accounting/card_table-inl.h"
Brian Carlstromea46f952013-07-30 01:26:50 -070019#include "mirror/art_method-inl.h"
Ian Rogers7655f292013-07-29 11:07:13 -070020#include "mirror/object-inl.h"
21
22namespace art {
23
24extern "C" mirror::Object* art_portable_initialize_static_storage_from_code(uint32_t type_idx,
Brian Carlstromea46f952013-07-30 01:26:50 -070025 mirror::ArtMethod* referrer,
Ian Rogers7655f292013-07-29 11:07:13 -070026 Thread* thread)
27 SHARED_LOCKS_REQUIRED(Locks::mutator_lock_) {
28 return ResolveVerifyAndClinit(type_idx, referrer, thread, true, false);
29}
30
31extern "C" mirror::Object* art_portable_initialize_type_from_code(uint32_t type_idx,
Brian Carlstromea46f952013-07-30 01:26:50 -070032 mirror::ArtMethod* referrer,
Ian Rogers7655f292013-07-29 11:07:13 -070033 Thread* thread)
34 SHARED_LOCKS_REQUIRED(Locks::mutator_lock_) {
35 return ResolveVerifyAndClinit(type_idx, referrer, thread, false, false);
36}
37
38extern "C" mirror::Object* art_portable_initialize_type_and_verify_access_from_code(uint32_t type_idx,
Brian Carlstromea46f952013-07-30 01:26:50 -070039 mirror::ArtMethod* referrer,
Ian Rogers7655f292013-07-29 11:07:13 -070040 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
Brian Carlstromea46f952013-07-30 01:26:50 -070047extern "C" mirror::Object* art_portable_resolve_string_from_code(mirror::ArtMethod* referrer,
Ian Rogers7655f292013-07-29 11:07:13 -070048 uint32_t string_idx)
49 SHARED_LOCKS_REQUIRED(Locks::mutator_lock_) {
50 return ResolveStringFromCode(referrer, string_idx);
51}
52
53} // namespace art