blob: 49e038d370aa8247eec27e83eadf6f1f20c892f9 [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) {
Ian Rogerse2645d32012-04-11 14:42:42 -070024 // Called to ensure static storage base is initialized for direct static field reads and writes.
25 // A class may be accessing another class' fields when it doesn't have access, as access has been
26 // given by inheritance.
Ian Rogers57b86d42012-03-27 16:05:41 -070027 FinishCalleeSaveFrameSetup(self, sp, Runtime::kRefsOnly);
Ian Rogerse2645d32012-04-11 14:42:42 -070028 return ResolveVerifyAndClinit(type_idx, referrer, self, true, false);
Ian Rogers57b86d42012-03-27 16:05:41 -070029}
30
31extern "C" Class* artInitializeTypeFromCode(uint32_t type_idx, const Method* referrer, Thread* self,
32 Method** sp) {
Ian Rogerse2645d32012-04-11 14:42:42 -070033 // Called when method->dex_cache_resolved_types_[] misses.
Ian Rogers57b86d42012-03-27 16:05:41 -070034 FinishCalleeSaveFrameSetup(self, sp, Runtime::kRefsOnly);
35 return ResolveVerifyAndClinit(type_idx, referrer, self, false, false);
36}
37
38extern "C" Class* artInitializeTypeAndVerifyAccessFromCode(uint32_t type_idx,
39 const Method* referrer, Thread* self,
40 Method** sp) {
41 // Called when caller isn't guaranteed to have access to a type and the dex cache may be
Ian Rogerse2645d32012-04-11 14:42:42 -070042 // unpopulated.
Ian Rogers57b86d42012-03-27 16:05:41 -070043 FinishCalleeSaveFrameSetup(self, sp, Runtime::kRefsOnly);
44 return ResolveVerifyAndClinit(type_idx, referrer, self, false, true);
45}
46
47extern "C" String* artResolveStringFromCode(Method* referrer, int32_t string_idx,
48 Thread* self, Method** sp) {
49 FinishCalleeSaveFrameSetup(self, sp, Runtime::kRefsOnly);
50 return ResolveStringFromCode(referrer, string_idx);
51}
52
53} // namespace art