blob: f66fc848d5d1ced706b88998e7c082f4d5092374 [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 Rogers4f6ad8a2013-03-18 15:27:28 -070021#include "mirror/object-inl.h"
Ian Rogers57b86d42012-03-27 16:05:41 -070022#include "runtime_support.h"
23
24namespace art {
25
Ian Rogers2dd0e2c2013-01-24 12:42:14 -080026extern "C" mirror::Object* artAllocObjectFromCode(uint32_t type_idx, mirror::AbstractMethod* method,
27 Thread* self, mirror::AbstractMethod** sp)
Ian Rogersb726dcb2012-09-05 08:57:23 -070028 SHARED_LOCKS_REQUIRED(Locks::mutator_lock_) {
Ian Rogers57b86d42012-03-27 16:05:41 -070029 FinishCalleeSaveFrameSetup(self, sp, Runtime::kRefsOnly);
30 return AllocObjectFromCode(type_idx, method, self, false);
31}
32
Ian Rogers2dd0e2c2013-01-24 12:42:14 -080033extern "C" mirror::Object* artAllocObjectFromCodeWithAccessCheck(uint32_t type_idx,
34 mirror::AbstractMethod* method,
35 Thread* self,
36 mirror::AbstractMethod** sp)
Ian Rogersb726dcb2012-09-05 08:57:23 -070037 SHARED_LOCKS_REQUIRED(Locks::mutator_lock_) {
Ian Rogers57b86d42012-03-27 16:05:41 -070038 FinishCalleeSaveFrameSetup(self, sp, Runtime::kRefsOnly);
39 return AllocObjectFromCode(type_idx, method, self, true);
40}
41
Ian Rogers2dd0e2c2013-01-24 12:42:14 -080042extern "C" mirror::Array* artAllocArrayFromCode(uint32_t type_idx, mirror::AbstractMethod* method,
43 int32_t component_count, Thread* self,
44 mirror::AbstractMethod** sp)
Ian Rogersb726dcb2012-09-05 08:57:23 -070045 SHARED_LOCKS_REQUIRED(Locks::mutator_lock_) {
Ian Rogers57b86d42012-03-27 16:05:41 -070046 FinishCalleeSaveFrameSetup(self, sp, Runtime::kRefsOnly);
Ian Rogers50b35e22012-10-04 10:09:15 -070047 return AllocArrayFromCode(type_idx, method, component_count, self, false);
Ian Rogers57b86d42012-03-27 16:05:41 -070048}
49
Ian Rogers2dd0e2c2013-01-24 12:42:14 -080050extern "C" mirror::Array* artAllocArrayFromCodeWithAccessCheck(uint32_t type_idx,
51 mirror::AbstractMethod* method,
52 int32_t component_count,
53 Thread* self,
54 mirror::AbstractMethod** sp)
Ian Rogersb726dcb2012-09-05 08:57:23 -070055 SHARED_LOCKS_REQUIRED(Locks::mutator_lock_) {
Ian Rogers57b86d42012-03-27 16:05:41 -070056 FinishCalleeSaveFrameSetup(self, sp, Runtime::kRefsOnly);
Ian Rogers50b35e22012-10-04 10:09:15 -070057 return AllocArrayFromCode(type_idx, method, component_count, self, true);
Ian Rogers57b86d42012-03-27 16:05:41 -070058}
59
Ian Rogers2dd0e2c2013-01-24 12:42:14 -080060extern "C" mirror::Array* artCheckAndAllocArrayFromCode(uint32_t type_idx,
61 mirror::AbstractMethod* method,
62 int32_t component_count, Thread* self,
63 mirror::AbstractMethod** sp)
Ian Rogersb726dcb2012-09-05 08:57:23 -070064 SHARED_LOCKS_REQUIRED(Locks::mutator_lock_) {
Ian Rogers57b86d42012-03-27 16:05:41 -070065 FinishCalleeSaveFrameSetup(self, sp, Runtime::kRefsOnly);
66 return CheckAndAllocArrayFromCode(type_idx, method, component_count, self, false);
67}
68
Ian Rogers2dd0e2c2013-01-24 12:42:14 -080069extern "C" mirror::Array* artCheckAndAllocArrayFromCodeWithAccessCheck(uint32_t type_idx,
70 mirror::AbstractMethod* method,
71 int32_t component_count,
72 Thread* self,
73 mirror::AbstractMethod** sp)
Ian Rogersb726dcb2012-09-05 08:57:23 -070074 SHARED_LOCKS_REQUIRED(Locks::mutator_lock_) {
Ian Rogers57b86d42012-03-27 16:05:41 -070075 FinishCalleeSaveFrameSetup(self, sp, Runtime::kRefsOnly);
76 return CheckAndAllocArrayFromCode(type_idx, method, component_count, self, true);
77}
78
79} // namespace art