blob: 5e3af78c940d1e673d5764a8f1bcafd57f819c00 [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"
Ian Rogers2dd0e2c2013-01-24 12:42:14 -080018#include "mirror/class-inl.h"
19#include "mirror/abstract_method-inl.h"
20#include "mirror/object_array-inl.h"
Ian Rogers57b86d42012-03-27 16:05:41 -070021#include "runtime_support.h"
22
23namespace art {
24
Ian Rogers2dd0e2c2013-01-24 12:42:14 -080025extern "C" mirror::Object* artAllocObjectFromCode(uint32_t type_idx, mirror::AbstractMethod* method,
26 Thread* self, mirror::AbstractMethod** sp)
Ian Rogersb726dcb2012-09-05 08:57:23 -070027 SHARED_LOCKS_REQUIRED(Locks::mutator_lock_) {
Ian Rogers57b86d42012-03-27 16:05:41 -070028 FinishCalleeSaveFrameSetup(self, sp, Runtime::kRefsOnly);
29 return AllocObjectFromCode(type_idx, method, self, false);
30}
31
Ian Rogers2dd0e2c2013-01-24 12:42:14 -080032extern "C" mirror::Object* artAllocObjectFromCodeWithAccessCheck(uint32_t type_idx,
33 mirror::AbstractMethod* method,
34 Thread* self,
35 mirror::AbstractMethod** sp)
Ian Rogersb726dcb2012-09-05 08:57:23 -070036 SHARED_LOCKS_REQUIRED(Locks::mutator_lock_) {
Ian Rogers57b86d42012-03-27 16:05:41 -070037 FinishCalleeSaveFrameSetup(self, sp, Runtime::kRefsOnly);
38 return AllocObjectFromCode(type_idx, method, self, true);
39}
40
Ian Rogers2dd0e2c2013-01-24 12:42:14 -080041extern "C" mirror::Array* artAllocArrayFromCode(uint32_t type_idx, mirror::AbstractMethod* method,
42 int32_t component_count, Thread* self,
43 mirror::AbstractMethod** sp)
Ian Rogersb726dcb2012-09-05 08:57:23 -070044 SHARED_LOCKS_REQUIRED(Locks::mutator_lock_) {
Ian Rogers57b86d42012-03-27 16:05:41 -070045 FinishCalleeSaveFrameSetup(self, sp, Runtime::kRefsOnly);
Ian Rogers50b35e22012-10-04 10:09:15 -070046 return AllocArrayFromCode(type_idx, method, component_count, self, false);
Ian Rogers57b86d42012-03-27 16:05:41 -070047}
48
Ian Rogers2dd0e2c2013-01-24 12:42:14 -080049extern "C" mirror::Array* artAllocArrayFromCodeWithAccessCheck(uint32_t type_idx,
50 mirror::AbstractMethod* method,
51 int32_t component_count,
52 Thread* self,
53 mirror::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);
Ian Rogers50b35e22012-10-04 10:09:15 -070056 return AllocArrayFromCode(type_idx, method, component_count, self, true);
Ian Rogers57b86d42012-03-27 16:05:41 -070057}
58
Ian Rogers2dd0e2c2013-01-24 12:42:14 -080059extern "C" mirror::Array* artCheckAndAllocArrayFromCode(uint32_t type_idx,
60 mirror::AbstractMethod* method,
61 int32_t component_count, Thread* self,
62 mirror::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, false);
66}
67
Ian Rogers2dd0e2c2013-01-24 12:42:14 -080068extern "C" mirror::Array* artCheckAndAllocArrayFromCodeWithAccessCheck(uint32_t type_idx,
69 mirror::AbstractMethod* method,
70 int32_t component_count,
71 Thread* self,
72 mirror::AbstractMethod** sp)
Ian Rogersb726dcb2012-09-05 08:57:23 -070073 SHARED_LOCKS_REQUIRED(Locks::mutator_lock_) {
Ian Rogers57b86d42012-03-27 16:05:41 -070074 FinishCalleeSaveFrameSetup(self, sp, Runtime::kRefsOnly);
75 return CheckAndAllocArrayFromCode(type_idx, method, component_count, self, true);
76}
77
78} // namespace art