| Ian Rogers | 7655f29 | 2013-07-29 11:07:13 -0700 | [diff] [blame] | 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 | |
| Mingyao Yang | 98d1cc8 | 2014-05-15 17:02:16 -0700 | [diff] [blame] | 17 | #include "entrypoints/entrypoint_utils-inl.h" |
| Ian Rogers | 7655f29 | 2013-07-29 11:07:13 -0700 | [diff] [blame] | 18 | #include "gc/accounting/card_table-inl.h" |
| Brian Carlstrom | ea46f95 | 2013-07-30 01:26:50 -0700 | [diff] [blame] | 19 | #include "mirror/art_method-inl.h" |
| Ian Rogers | 7655f29 | 2013-07-29 11:07:13 -0700 | [diff] [blame] | 20 | #include "mirror/object-inl.h" |
| 21 | |
| 22 | namespace art { |
| 23 | |
| 24 | extern "C" mirror::Object* art_portable_initialize_static_storage_from_code(uint32_t type_idx, |
| Brian Carlstrom | ea46f95 | 2013-07-30 01:26:50 -0700 | [diff] [blame] | 25 | mirror::ArtMethod* referrer, |
| Ian Rogers | 7655f29 | 2013-07-29 11:07:13 -0700 | [diff] [blame] | 26 | Thread* thread) |
| 27 | SHARED_LOCKS_REQUIRED(Locks::mutator_lock_) { |
| 28 | return ResolveVerifyAndClinit(type_idx, referrer, thread, true, false); |
| 29 | } |
| 30 | |
| 31 | extern "C" mirror::Object* art_portable_initialize_type_from_code(uint32_t type_idx, |
| Brian Carlstrom | ea46f95 | 2013-07-30 01:26:50 -0700 | [diff] [blame] | 32 | mirror::ArtMethod* referrer, |
| Ian Rogers | 7655f29 | 2013-07-29 11:07:13 -0700 | [diff] [blame] | 33 | Thread* thread) |
| 34 | SHARED_LOCKS_REQUIRED(Locks::mutator_lock_) { |
| 35 | return ResolveVerifyAndClinit(type_idx, referrer, thread, false, false); |
| 36 | } |
| 37 | |
| 38 | extern "C" mirror::Object* art_portable_initialize_type_and_verify_access_from_code(uint32_t type_idx, |
| Brian Carlstrom | ea46f95 | 2013-07-30 01:26:50 -0700 | [diff] [blame] | 39 | mirror::ArtMethod* referrer, |
| Ian Rogers | 7655f29 | 2013-07-29 11:07:13 -0700 | [diff] [blame] | 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 | |
| Brian Carlstrom | ea46f95 | 2013-07-30 01:26:50 -0700 | [diff] [blame] | 47 | extern "C" mirror::Object* art_portable_resolve_string_from_code(mirror::ArtMethod* referrer, |
| Ian Rogers | 7655f29 | 2013-07-29 11:07:13 -0700 | [diff] [blame] | 48 | uint32_t string_idx) |
| 49 | SHARED_LOCKS_REQUIRED(Locks::mutator_lock_) { |
| 50 | return ResolveStringFromCode(referrer, string_idx); |
| 51 | } |
| 52 | |
| 53 | } // namespace art |