blob: e5f2f8264929c72daa479dd4ec5ff155822ea7f9 [file] [log] [blame]
Ian Rogers57b86d42012-03-27 16:05:41 -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
17#include "callee_save_frame.h"
18#include "runtime_support.h"
19
20namespace art {
21
22extern "C" Class* artInitializeStaticStorageFromCode(uint32_t type_idx, const Method* referrer,
23 Thread* self, Method** sp) {
24 FinishCalleeSaveFrameSetup(self, sp, Runtime::kRefsOnly);
25 return ResolveVerifyAndClinit(type_idx, referrer, self, true, true);
26}
27
28extern "C" Class* artInitializeTypeFromCode(uint32_t type_idx, const Method* referrer, Thread* self,
29 Method** sp) {
30 // Called when method->dex_cache_resolved_types_[] misses
31 FinishCalleeSaveFrameSetup(self, sp, Runtime::kRefsOnly);
32 return ResolveVerifyAndClinit(type_idx, referrer, self, false, false);
33}
34
35extern "C" Class* artInitializeTypeAndVerifyAccessFromCode(uint32_t type_idx,
36 const Method* referrer, Thread* self,
37 Method** sp) {
38 // Called when caller isn't guaranteed to have access to a type and the dex cache may be
39 // unpopulated
40 FinishCalleeSaveFrameSetup(self, sp, Runtime::kRefsOnly);
41 return ResolveVerifyAndClinit(type_idx, referrer, self, false, true);
42}
43
44extern "C" String* artResolveStringFromCode(Method* referrer, int32_t string_idx,
45 Thread* self, Method** sp) {
46 FinishCalleeSaveFrameSetup(self, sp, Runtime::kRefsOnly);
47 return ResolveStringFromCode(referrer, string_idx);
48}
49
50} // namespace art