blob: fb70285073deecd73eb1f8ff0c1ed04b5f1c01da [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
Mathieu Chartier66f19252012-09-18 08:57:04 -070022extern "C" Object* artAllocObjectFromCode(uint32_t type_idx, AbstractMethod* method,
23 Thread* self, AbstractMethod** sp)
Ian Rogersb726dcb2012-09-05 08:57:23 -070024 SHARED_LOCKS_REQUIRED(Locks::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
Mathieu Chartier66f19252012-09-18 08:57:04 -070029extern "C" Object* artAllocObjectFromCodeWithAccessCheck(uint32_t type_idx, AbstractMethod* method,
30 Thread* self, AbstractMethod** sp)
Ian Rogersb726dcb2012-09-05 08:57:23 -070031 SHARED_LOCKS_REQUIRED(Locks::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
Mathieu Chartier66f19252012-09-18 08:57:04 -070036extern "C" Array* artAllocArrayFromCode(uint32_t type_idx, AbstractMethod* method, int32_t component_count,
37 Thread* self, AbstractMethod** sp)
Ian Rogersb726dcb2012-09-05 08:57:23 -070038 SHARED_LOCKS_REQUIRED(Locks::mutator_lock_) {
Ian Rogers57b86d42012-03-27 16:05:41 -070039 FinishCalleeSaveFrameSetup(self, sp, Runtime::kRefsOnly);
Ian Rogers50b35e22012-10-04 10:09:15 -070040 return AllocArrayFromCode(type_idx, method, component_count, self, false);
Ian Rogers57b86d42012-03-27 16:05:41 -070041}
42
Mathieu Chartier66f19252012-09-18 08:57:04 -070043extern "C" Array* artAllocArrayFromCodeWithAccessCheck(uint32_t type_idx, AbstractMethod* method,
Ian Rogers57b86d42012-03-27 16:05:41 -070044 int32_t component_count,
Mathieu Chartier66f19252012-09-18 08:57:04 -070045 Thread* self, AbstractMethod** sp)
Ian Rogersb726dcb2012-09-05 08:57:23 -070046 SHARED_LOCKS_REQUIRED(Locks::mutator_lock_) {
Ian Rogers57b86d42012-03-27 16:05:41 -070047 FinishCalleeSaveFrameSetup(self, sp, Runtime::kRefsOnly);
Ian Rogers50b35e22012-10-04 10:09:15 -070048 return AllocArrayFromCode(type_idx, method, component_count, self, true);
Ian Rogers57b86d42012-03-27 16:05:41 -070049}
50
Mathieu Chartier66f19252012-09-18 08:57:04 -070051extern "C" Array* artCheckAndAllocArrayFromCode(uint32_t type_idx, AbstractMethod* method,
52 int32_t component_count, Thread* self,
53 AbstractMethod** sp)
Ian Rogersb726dcb2012-09-05 08:57:23 -070054 SHARED_LOCKS_REQUIRED(Locks::mutator_lock_) {
Ian Rogers57b86d42012-03-27 16:05:41 -070055 FinishCalleeSaveFrameSetup(self, sp, Runtime::kRefsOnly);
56 return CheckAndAllocArrayFromCode(type_idx, method, component_count, self, false);
57}
58
Mathieu Chartier66f19252012-09-18 08:57:04 -070059extern "C" Array* artCheckAndAllocArrayFromCodeWithAccessCheck(uint32_t type_idx,
60 AbstractMethod* method,
Ian Rogers57b86d42012-03-27 16:05:41 -070061 int32_t component_count,
Mathieu Chartier66f19252012-09-18 08:57:04 -070062 Thread* self, AbstractMethod** sp)
Ian Rogersb726dcb2012-09-05 08:57:23 -070063 SHARED_LOCKS_REQUIRED(Locks::mutator_lock_) {
Ian Rogers57b86d42012-03-27 16:05:41 -070064 FinishCalleeSaveFrameSetup(self, sp, Runtime::kRefsOnly);
65 return CheckAndAllocArrayFromCode(type_idx, method, component_count, self, true);
66}
67
68} // namespace art