Ian Rogers | 57b86d4 | 2012-03-27 16:05:41 -0700 | [diff] [blame] | 1 | /* |
| 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 Rogers | 2dd0e2c | 2013-01-24 12:42:14 -0800 | [diff] [blame^] | 18 | #include "mirror/class-inl.h" |
| 19 | #include "mirror/abstract_method-inl.h" |
| 20 | #include "mirror/object_array-inl.h" |
Ian Rogers | 57b86d4 | 2012-03-27 16:05:41 -0700 | [diff] [blame] | 21 | #include "runtime_support.h" |
| 22 | |
| 23 | namespace art { |
| 24 | |
Ian Rogers | 2dd0e2c | 2013-01-24 12:42:14 -0800 | [diff] [blame^] | 25 | extern "C" mirror::Object* artAllocObjectFromCode(uint32_t type_idx, mirror::AbstractMethod* method, |
| 26 | Thread* self, mirror::AbstractMethod** sp) |
Ian Rogers | b726dcb | 2012-09-05 08:57:23 -0700 | [diff] [blame] | 27 | SHARED_LOCKS_REQUIRED(Locks::mutator_lock_) { |
Ian Rogers | 57b86d4 | 2012-03-27 16:05:41 -0700 | [diff] [blame] | 28 | FinishCalleeSaveFrameSetup(self, sp, Runtime::kRefsOnly); |
| 29 | return AllocObjectFromCode(type_idx, method, self, false); |
| 30 | } |
| 31 | |
Ian Rogers | 2dd0e2c | 2013-01-24 12:42:14 -0800 | [diff] [blame^] | 32 | extern "C" mirror::Object* artAllocObjectFromCodeWithAccessCheck(uint32_t type_idx, |
| 33 | mirror::AbstractMethod* method, |
| 34 | Thread* self, |
| 35 | mirror::AbstractMethod** sp) |
Ian Rogers | b726dcb | 2012-09-05 08:57:23 -0700 | [diff] [blame] | 36 | SHARED_LOCKS_REQUIRED(Locks::mutator_lock_) { |
Ian Rogers | 57b86d4 | 2012-03-27 16:05:41 -0700 | [diff] [blame] | 37 | FinishCalleeSaveFrameSetup(self, sp, Runtime::kRefsOnly); |
| 38 | return AllocObjectFromCode(type_idx, method, self, true); |
| 39 | } |
| 40 | |
Ian Rogers | 2dd0e2c | 2013-01-24 12:42:14 -0800 | [diff] [blame^] | 41 | extern "C" mirror::Array* artAllocArrayFromCode(uint32_t type_idx, mirror::AbstractMethod* method, |
| 42 | int32_t component_count, Thread* self, |
| 43 | mirror::AbstractMethod** sp) |
Ian Rogers | b726dcb | 2012-09-05 08:57:23 -0700 | [diff] [blame] | 44 | SHARED_LOCKS_REQUIRED(Locks::mutator_lock_) { |
Ian Rogers | 57b86d4 | 2012-03-27 16:05:41 -0700 | [diff] [blame] | 45 | FinishCalleeSaveFrameSetup(self, sp, Runtime::kRefsOnly); |
Ian Rogers | 50b35e2 | 2012-10-04 10:09:15 -0700 | [diff] [blame] | 46 | return AllocArrayFromCode(type_idx, method, component_count, self, false); |
Ian Rogers | 57b86d4 | 2012-03-27 16:05:41 -0700 | [diff] [blame] | 47 | } |
| 48 | |
Ian Rogers | 2dd0e2c | 2013-01-24 12:42:14 -0800 | [diff] [blame^] | 49 | extern "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 Rogers | b726dcb | 2012-09-05 08:57:23 -0700 | [diff] [blame] | 54 | SHARED_LOCKS_REQUIRED(Locks::mutator_lock_) { |
Ian Rogers | 57b86d4 | 2012-03-27 16:05:41 -0700 | [diff] [blame] | 55 | FinishCalleeSaveFrameSetup(self, sp, Runtime::kRefsOnly); |
Ian Rogers | 50b35e2 | 2012-10-04 10:09:15 -0700 | [diff] [blame] | 56 | return AllocArrayFromCode(type_idx, method, component_count, self, true); |
Ian Rogers | 57b86d4 | 2012-03-27 16:05:41 -0700 | [diff] [blame] | 57 | } |
| 58 | |
Ian Rogers | 2dd0e2c | 2013-01-24 12:42:14 -0800 | [diff] [blame^] | 59 | extern "C" mirror::Array* artCheckAndAllocArrayFromCode(uint32_t type_idx, |
| 60 | mirror::AbstractMethod* method, |
| 61 | int32_t component_count, Thread* self, |
| 62 | mirror::AbstractMethod** sp) |
Ian Rogers | b726dcb | 2012-09-05 08:57:23 -0700 | [diff] [blame] | 63 | SHARED_LOCKS_REQUIRED(Locks::mutator_lock_) { |
Ian Rogers | 57b86d4 | 2012-03-27 16:05:41 -0700 | [diff] [blame] | 64 | FinishCalleeSaveFrameSetup(self, sp, Runtime::kRefsOnly); |
| 65 | return CheckAndAllocArrayFromCode(type_idx, method, component_count, self, false); |
| 66 | } |
| 67 | |
Ian Rogers | 2dd0e2c | 2013-01-24 12:42:14 -0800 | [diff] [blame^] | 68 | extern "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 Rogers | b726dcb | 2012-09-05 08:57:23 -0700 | [diff] [blame] | 73 | SHARED_LOCKS_REQUIRED(Locks::mutator_lock_) { |
Ian Rogers | 57b86d4 | 2012-03-27 16:05:41 -0700 | [diff] [blame] | 74 | FinishCalleeSaveFrameSetup(self, sp, Runtime::kRefsOnly); |
| 75 | return CheckAndAllocArrayFromCode(type_idx, method, component_count, self, true); |
| 76 | } |
| 77 | |
| 78 | } // namespace art |