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" |
| 18 | #include "runtime_support.h" |
| 19 | |
| 20 | namespace art { |
| 21 | |
| 22 | extern "C" Object* artAllocObjectFromCode(uint32_t type_idx, Method* method, |
Ian Rogers | 00f7d0e | 2012-07-19 15:28:27 -0700 | [diff] [blame] | 23 | Thread* self, Method** sp) |
| 24 | SHARED_LOCKS_REQUIRED(GlobalSynchronization::mutator_lock_) { |
Ian Rogers | 57b86d4 | 2012-03-27 16:05:41 -0700 | [diff] [blame] | 25 | FinishCalleeSaveFrameSetup(self, sp, Runtime::kRefsOnly); |
| 26 | return AllocObjectFromCode(type_idx, method, self, false); |
| 27 | } |
| 28 | |
| 29 | extern "C" Object* artAllocObjectFromCodeWithAccessCheck(uint32_t type_idx, Method* method, |
Ian Rogers | 00f7d0e | 2012-07-19 15:28:27 -0700 | [diff] [blame] | 30 | Thread* self, Method** sp) |
| 31 | SHARED_LOCKS_REQUIRED(GlobalSynchronization::mutator_lock_) { |
Ian Rogers | 57b86d4 | 2012-03-27 16:05:41 -0700 | [diff] [blame] | 32 | FinishCalleeSaveFrameSetup(self, sp, Runtime::kRefsOnly); |
| 33 | return AllocObjectFromCode(type_idx, method, self, true); |
| 34 | } |
| 35 | |
| 36 | extern "C" Array* artAllocArrayFromCode(uint32_t type_idx, Method* method, int32_t component_count, |
Ian Rogers | 00f7d0e | 2012-07-19 15:28:27 -0700 | [diff] [blame] | 37 | Thread* self, Method** sp) |
| 38 | SHARED_LOCKS_REQUIRED(GlobalSynchronization::mutator_lock_) { |
Ian Rogers | 57b86d4 | 2012-03-27 16:05:41 -0700 | [diff] [blame] | 39 | FinishCalleeSaveFrameSetup(self, sp, Runtime::kRefsOnly); |
| 40 | return AllocArrayFromCode(type_idx, method, component_count, self, false); |
| 41 | } |
| 42 | |
| 43 | extern "C" Array* artAllocArrayFromCodeWithAccessCheck(uint32_t type_idx, Method* method, |
| 44 | int32_t component_count, |
Ian Rogers | 00f7d0e | 2012-07-19 15:28:27 -0700 | [diff] [blame] | 45 | Thread* self, Method** sp) |
| 46 | SHARED_LOCKS_REQUIRED(GlobalSynchronization::mutator_lock_) { |
Ian Rogers | 57b86d4 | 2012-03-27 16:05:41 -0700 | [diff] [blame] | 47 | FinishCalleeSaveFrameSetup(self, sp, Runtime::kRefsOnly); |
| 48 | return AllocArrayFromCode(type_idx, method, component_count, self, true); |
| 49 | } |
| 50 | |
| 51 | extern "C" Array* artCheckAndAllocArrayFromCode(uint32_t type_idx, Method* method, |
Ian Rogers | 00f7d0e | 2012-07-19 15:28:27 -0700 | [diff] [blame] | 52 | int32_t component_count, Thread* self, Method** sp) |
| 53 | SHARED_LOCKS_REQUIRED(GlobalSynchronization::mutator_lock_) { |
Ian Rogers | 57b86d4 | 2012-03-27 16:05:41 -0700 | [diff] [blame] | 54 | FinishCalleeSaveFrameSetup(self, sp, Runtime::kRefsOnly); |
| 55 | return CheckAndAllocArrayFromCode(type_idx, method, component_count, self, false); |
| 56 | } |
| 57 | |
| 58 | extern "C" Array* artCheckAndAllocArrayFromCodeWithAccessCheck(uint32_t type_idx, Method* method, |
| 59 | int32_t component_count, |
Ian Rogers | 00f7d0e | 2012-07-19 15:28:27 -0700 | [diff] [blame] | 60 | Thread* self, Method** sp) |
| 61 | SHARED_LOCKS_REQUIRED(GlobalSynchronization::mutator_lock_) { |
Ian Rogers | 57b86d4 | 2012-03-27 16:05:41 -0700 | [diff] [blame] | 62 | FinishCalleeSaveFrameSetup(self, sp, Runtime::kRefsOnly); |
| 63 | return CheckAndAllocArrayFromCode(type_idx, method, component_count, self, true); |
| 64 | } |
| 65 | |
| 66 | } // namespace art |