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 | 7655f29 | 2013-07-29 11:07:13 -0700 | [diff] [blame] | 18 | #include "entrypoints/entrypoint_utils.h" |
Brian Carlstrom | ea46f95 | 2013-07-30 01:26:50 -0700 | [diff] [blame] | 19 | #include "mirror/art_method-inl.h" |
Ian Rogers | 2dd0e2c | 2013-01-24 12:42:14 -0800 | [diff] [blame] | 20 | #include "mirror/class-inl.h" |
Ian Rogers | 2dd0e2c | 2013-01-24 12:42:14 -0800 | [diff] [blame] | 21 | #include "mirror/object_array-inl.h" |
Ian Rogers | 4f6ad8a | 2013-03-18 15:27:28 -0700 | [diff] [blame] | 22 | #include "mirror/object-inl.h" |
Ian Rogers | 57b86d4 | 2012-03-27 16:05:41 -0700 | [diff] [blame] | 23 | |
| 24 | namespace art { |
| 25 | |
Brian Carlstrom | ea46f95 | 2013-07-30 01:26:50 -0700 | [diff] [blame] | 26 | extern "C" mirror::Object* artAllocObjectFromCode(uint32_t type_idx, mirror::ArtMethod* method, |
| 27 | Thread* self, mirror::ArtMethod** sp) |
Ian Rogers | b726dcb | 2012-09-05 08:57:23 -0700 | [diff] [blame] | 28 | SHARED_LOCKS_REQUIRED(Locks::mutator_lock_) { |
Ian Rogers | 57b86d4 | 2012-03-27 16:05:41 -0700 | [diff] [blame] | 29 | FinishCalleeSaveFrameSetup(self, sp, Runtime::kRefsOnly); |
| 30 | return AllocObjectFromCode(type_idx, method, self, false); |
| 31 | } |
| 32 | |
Ian Rogers | 2dd0e2c | 2013-01-24 12:42:14 -0800 | [diff] [blame] | 33 | extern "C" mirror::Object* artAllocObjectFromCodeWithAccessCheck(uint32_t type_idx, |
Brian Carlstrom | ea46f95 | 2013-07-30 01:26:50 -0700 | [diff] [blame] | 34 | mirror::ArtMethod* method, |
Ian Rogers | 2dd0e2c | 2013-01-24 12:42:14 -0800 | [diff] [blame] | 35 | Thread* self, |
Brian Carlstrom | ea46f95 | 2013-07-30 01:26:50 -0700 | [diff] [blame] | 36 | mirror::ArtMethod** sp) |
Ian Rogers | b726dcb | 2012-09-05 08:57:23 -0700 | [diff] [blame] | 37 | SHARED_LOCKS_REQUIRED(Locks::mutator_lock_) { |
Ian Rogers | 57b86d4 | 2012-03-27 16:05:41 -0700 | [diff] [blame] | 38 | FinishCalleeSaveFrameSetup(self, sp, Runtime::kRefsOnly); |
| 39 | return AllocObjectFromCode(type_idx, method, self, true); |
| 40 | } |
| 41 | |
Brian Carlstrom | ea46f95 | 2013-07-30 01:26:50 -0700 | [diff] [blame] | 42 | extern "C" mirror::Array* artAllocArrayFromCode(uint32_t type_idx, mirror::ArtMethod* method, |
Ian Rogers | 2dd0e2c | 2013-01-24 12:42:14 -0800 | [diff] [blame] | 43 | int32_t component_count, Thread* self, |
Brian Carlstrom | ea46f95 | 2013-07-30 01:26:50 -0700 | [diff] [blame] | 44 | mirror::ArtMethod** sp) |
Ian Rogers | b726dcb | 2012-09-05 08:57:23 -0700 | [diff] [blame] | 45 | SHARED_LOCKS_REQUIRED(Locks::mutator_lock_) { |
Ian Rogers | 57b86d4 | 2012-03-27 16:05:41 -0700 | [diff] [blame] | 46 | FinishCalleeSaveFrameSetup(self, sp, Runtime::kRefsOnly); |
Ian Rogers | 50b35e2 | 2012-10-04 10:09:15 -0700 | [diff] [blame] | 47 | return AllocArrayFromCode(type_idx, method, component_count, self, false); |
Ian Rogers | 57b86d4 | 2012-03-27 16:05:41 -0700 | [diff] [blame] | 48 | } |
| 49 | |
Ian Rogers | 2dd0e2c | 2013-01-24 12:42:14 -0800 | [diff] [blame] | 50 | extern "C" mirror::Array* artAllocArrayFromCodeWithAccessCheck(uint32_t type_idx, |
Brian Carlstrom | ea46f95 | 2013-07-30 01:26:50 -0700 | [diff] [blame] | 51 | mirror::ArtMethod* method, |
Ian Rogers | 2dd0e2c | 2013-01-24 12:42:14 -0800 | [diff] [blame] | 52 | int32_t component_count, |
| 53 | Thread* self, |
Brian Carlstrom | ea46f95 | 2013-07-30 01:26:50 -0700 | [diff] [blame] | 54 | mirror::ArtMethod** sp) |
Ian Rogers | b726dcb | 2012-09-05 08:57:23 -0700 | [diff] [blame] | 55 | SHARED_LOCKS_REQUIRED(Locks::mutator_lock_) { |
Ian Rogers | 57b86d4 | 2012-03-27 16:05:41 -0700 | [diff] [blame] | 56 | FinishCalleeSaveFrameSetup(self, sp, Runtime::kRefsOnly); |
Ian Rogers | 50b35e2 | 2012-10-04 10:09:15 -0700 | [diff] [blame] | 57 | return AllocArrayFromCode(type_idx, method, component_count, self, true); |
Ian Rogers | 57b86d4 | 2012-03-27 16:05:41 -0700 | [diff] [blame] | 58 | } |
| 59 | |
Ian Rogers | 2dd0e2c | 2013-01-24 12:42:14 -0800 | [diff] [blame] | 60 | extern "C" mirror::Array* artCheckAndAllocArrayFromCode(uint32_t type_idx, |
Brian Carlstrom | ea46f95 | 2013-07-30 01:26:50 -0700 | [diff] [blame] | 61 | mirror::ArtMethod* method, |
Ian Rogers | 2dd0e2c | 2013-01-24 12:42:14 -0800 | [diff] [blame] | 62 | int32_t component_count, Thread* self, |
Brian Carlstrom | ea46f95 | 2013-07-30 01:26:50 -0700 | [diff] [blame] | 63 | mirror::ArtMethod** sp) |
Ian Rogers | b726dcb | 2012-09-05 08:57:23 -0700 | [diff] [blame] | 64 | SHARED_LOCKS_REQUIRED(Locks::mutator_lock_) { |
Ian Rogers | 57b86d4 | 2012-03-27 16:05:41 -0700 | [diff] [blame] | 65 | FinishCalleeSaveFrameSetup(self, sp, Runtime::kRefsOnly); |
| 66 | return CheckAndAllocArrayFromCode(type_idx, method, component_count, self, false); |
| 67 | } |
| 68 | |
Ian Rogers | 2dd0e2c | 2013-01-24 12:42:14 -0800 | [diff] [blame] | 69 | extern "C" mirror::Array* artCheckAndAllocArrayFromCodeWithAccessCheck(uint32_t type_idx, |
Brian Carlstrom | ea46f95 | 2013-07-30 01:26:50 -0700 | [diff] [blame] | 70 | mirror::ArtMethod* method, |
Ian Rogers | 2dd0e2c | 2013-01-24 12:42:14 -0800 | [diff] [blame] | 71 | int32_t component_count, |
| 72 | Thread* self, |
Brian Carlstrom | ea46f95 | 2013-07-30 01:26:50 -0700 | [diff] [blame] | 73 | mirror::ArtMethod** sp) |
Ian Rogers | b726dcb | 2012-09-05 08:57:23 -0700 | [diff] [blame] | 74 | SHARED_LOCKS_REQUIRED(Locks::mutator_lock_) { |
Ian Rogers | 57b86d4 | 2012-03-27 16:05:41 -0700 | [diff] [blame] | 75 | FinishCalleeSaveFrameSetup(self, sp, Runtime::kRefsOnly); |
| 76 | return CheckAndAllocArrayFromCode(type_idx, method, component_count, self, true); |
| 77 | } |
| 78 | |
Hiroshi Yamauchi | 3b4c189 | 2013-09-12 21:33:12 -0700 | [diff] [blame] | 79 | extern "C" mirror::Object* artAllocObjectFromCodeInstrumented(uint32_t type_idx, mirror::ArtMethod* method, |
| 80 | Thread* self, mirror::ArtMethod** sp) |
| 81 | SHARED_LOCKS_REQUIRED(Locks::mutator_lock_) { |
| 82 | FinishCalleeSaveFrameSetup(self, sp, Runtime::kRefsOnly); |
| 83 | return AllocObjectFromCodeInstrumented(type_idx, method, self, false); |
| 84 | } |
| 85 | |
| 86 | extern "C" mirror::Object* artAllocObjectFromCodeWithAccessCheckInstrumented(uint32_t type_idx, |
| 87 | mirror::ArtMethod* method, |
| 88 | Thread* self, |
| 89 | mirror::ArtMethod** sp) |
| 90 | SHARED_LOCKS_REQUIRED(Locks::mutator_lock_) { |
| 91 | FinishCalleeSaveFrameSetup(self, sp, Runtime::kRefsOnly); |
| 92 | return AllocObjectFromCodeInstrumented(type_idx, method, self, true); |
| 93 | } |
| 94 | |
| 95 | extern "C" mirror::Array* artAllocArrayFromCodeInstrumented(uint32_t type_idx, mirror::ArtMethod* method, |
| 96 | int32_t component_count, Thread* self, |
| 97 | mirror::ArtMethod** sp) |
| 98 | SHARED_LOCKS_REQUIRED(Locks::mutator_lock_) { |
| 99 | FinishCalleeSaveFrameSetup(self, sp, Runtime::kRefsOnly); |
| 100 | return AllocArrayFromCodeInstrumented(type_idx, method, component_count, self, false); |
| 101 | } |
| 102 | |
| 103 | extern "C" mirror::Array* artAllocArrayFromCodeWithAccessCheckInstrumented(uint32_t type_idx, |
| 104 | mirror::ArtMethod* method, |
| 105 | int32_t component_count, |
| 106 | Thread* self, |
| 107 | mirror::ArtMethod** sp) |
| 108 | SHARED_LOCKS_REQUIRED(Locks::mutator_lock_) { |
| 109 | FinishCalleeSaveFrameSetup(self, sp, Runtime::kRefsOnly); |
| 110 | return AllocArrayFromCodeInstrumented(type_idx, method, component_count, self, true); |
| 111 | } |
| 112 | |
| 113 | extern "C" mirror::Array* artCheckAndAllocArrayFromCodeInstrumented(uint32_t type_idx, |
| 114 | mirror::ArtMethod* method, |
| 115 | int32_t component_count, Thread* self, |
| 116 | mirror::ArtMethod** sp) |
| 117 | SHARED_LOCKS_REQUIRED(Locks::mutator_lock_) { |
| 118 | FinishCalleeSaveFrameSetup(self, sp, Runtime::kRefsOnly); |
| 119 | return CheckAndAllocArrayFromCodeInstrumented(type_idx, method, component_count, self, false); |
| 120 | } |
| 121 | |
| 122 | extern "C" mirror::Array* artCheckAndAllocArrayFromCodeWithAccessCheckInstrumented(uint32_t type_idx, |
| 123 | mirror::ArtMethod* method, |
| 124 | int32_t component_count, |
| 125 | Thread* self, |
| 126 | mirror::ArtMethod** sp) |
| 127 | SHARED_LOCKS_REQUIRED(Locks::mutator_lock_) { |
| 128 | FinishCalleeSaveFrameSetup(self, sp, Runtime::kRefsOnly); |
| 129 | return CheckAndAllocArrayFromCodeInstrumented(type_idx, method, component_count, self, true); |
| 130 | } |
| 131 | |
Ian Rogers | 57b86d4 | 2012-03-27 16:05:41 -0700 | [diff] [blame] | 132 | } // namespace art |