blob: 528198d81cb4ecfdbaaea472e03d8dedf5559db1 [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" Object* artAllocObjectFromCode(uint32_t type_idx, Method* method,
Ian Rogers00f7d0e2012-07-19 15:28:27 -070023 Thread* self, Method** sp)
24 SHARED_LOCKS_REQUIRED(GlobalSynchronization::mutator_lock_) {
Ian Rogers57b86d42012-03-27 16:05:41 -070025 FinishCalleeSaveFrameSetup(self, sp, Runtime::kRefsOnly);
26 return AllocObjectFromCode(type_idx, method, self, false);
27}
28
29extern "C" Object* artAllocObjectFromCodeWithAccessCheck(uint32_t type_idx, Method* method,
Ian Rogers00f7d0e2012-07-19 15:28:27 -070030 Thread* self, Method** sp)
31 SHARED_LOCKS_REQUIRED(GlobalSynchronization::mutator_lock_) {
Ian Rogers57b86d42012-03-27 16:05:41 -070032 FinishCalleeSaveFrameSetup(self, sp, Runtime::kRefsOnly);
33 return AllocObjectFromCode(type_idx, method, self, true);
34}
35
36extern "C" Array* artAllocArrayFromCode(uint32_t type_idx, Method* method, int32_t component_count,
Ian Rogers00f7d0e2012-07-19 15:28:27 -070037 Thread* self, Method** sp)
38 SHARED_LOCKS_REQUIRED(GlobalSynchronization::mutator_lock_) {
Ian Rogers57b86d42012-03-27 16:05:41 -070039 FinishCalleeSaveFrameSetup(self, sp, Runtime::kRefsOnly);
Ian Rogers87e552d2012-08-31 15:54:48 -070040 return AllocArrayFromCode(type_idx, method, component_count, false);
Ian Rogers57b86d42012-03-27 16:05:41 -070041}
42
43extern "C" Array* artAllocArrayFromCodeWithAccessCheck(uint32_t type_idx, Method* method,
44 int32_t component_count,
Ian Rogers00f7d0e2012-07-19 15:28:27 -070045 Thread* self, Method** sp)
46 SHARED_LOCKS_REQUIRED(GlobalSynchronization::mutator_lock_) {
Ian Rogers57b86d42012-03-27 16:05:41 -070047 FinishCalleeSaveFrameSetup(self, sp, Runtime::kRefsOnly);
Ian Rogers87e552d2012-08-31 15:54:48 -070048 return AllocArrayFromCode(type_idx, method, component_count, true);
Ian Rogers57b86d42012-03-27 16:05:41 -070049}
50
51extern "C" Array* artCheckAndAllocArrayFromCode(uint32_t type_idx, Method* method,
Ian Rogers00f7d0e2012-07-19 15:28:27 -070052 int32_t component_count, Thread* self, Method** sp)
53 SHARED_LOCKS_REQUIRED(GlobalSynchronization::mutator_lock_) {
Ian Rogers57b86d42012-03-27 16:05:41 -070054 FinishCalleeSaveFrameSetup(self, sp, Runtime::kRefsOnly);
55 return CheckAndAllocArrayFromCode(type_idx, method, component_count, self, false);
56}
57
58extern "C" Array* artCheckAndAllocArrayFromCodeWithAccessCheck(uint32_t type_idx, Method* method,
59 int32_t component_count,
Ian Rogers00f7d0e2012-07-19 15:28:27 -070060 Thread* self, Method** sp)
61 SHARED_LOCKS_REQUIRED(GlobalSynchronization::mutator_lock_) {
Ian Rogers57b86d42012-03-27 16:05:41 -070062 FinishCalleeSaveFrameSetup(self, sp, Runtime::kRefsOnly);
63 return CheckAndAllocArrayFromCode(type_idx, method, component_count, self, true);
64}
65
66} // namespace art