David Srbecky | 766e74f | 2018-10-02 17:12:24 +0100 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2018 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 | #if ASM_DEFINE_INCLUDE_DEPENDENCIES |
| 18 | #include "mirror/class.h" |
Nicolas Geoffray | 8af7f91 | 2022-07-06 15:29:16 +0100 | [diff] [blame] | 19 | #include "subtype_check.h" |
David Srbecky | 766e74f | 2018-10-02 17:12:24 +0100 | [diff] [blame] | 20 | #endif |
| 21 | |
| 22 | ASM_DEFINE(MIRROR_CLASS_ACCESS_FLAGS_OFFSET, |
| 23 | art::mirror::Class::AccessFlagsOffset().Int32Value()) |
| 24 | ASM_DEFINE(MIRROR_CLASS_COMPONENT_TYPE_OFFSET, |
| 25 | art::mirror::Class::ComponentTypeOffset().Int32Value()) |
| 26 | ASM_DEFINE(MIRROR_CLASS_DEX_CACHE_OFFSET, |
| 27 | art::mirror::Class::DexCacheOffset().Int32Value()) |
| 28 | ASM_DEFINE(MIRROR_CLASS_IF_TABLE_OFFSET, |
| 29 | art::mirror::Class::IfTableOffset().Int32Value()) |
| 30 | ASM_DEFINE(MIRROR_CLASS_OBJECT_PRIMITIVE_TYPE_OFFSET, |
| 31 | art::mirror::Class::PrimitiveTypeOffset().Int32Value()) |
| 32 | ASM_DEFINE(MIRROR_CLASS_OBJECT_SIZE_ALLOC_FAST_PATH_OFFSET, |
| 33 | art::mirror::Class::ObjectSizeAllocFastPathOffset().Int32Value()) |
| 34 | ASM_DEFINE(MIRROR_CLASS_OBJECT_SIZE_OFFSET, |
| 35 | art::mirror::Class::ObjectSizeOffset().Int32Value()) |
| 36 | ASM_DEFINE(MIRROR_CLASS_STATUS_OFFSET, |
| 37 | art::mirror::Class::StatusOffset().Int32Value()) |
| 38 | ASM_DEFINE(PRIMITIVE_TYPE_SIZE_SHIFT_SHIFT, |
| 39 | art::mirror::Class::kPrimitiveTypeSizeShiftShift) |
Nicolas Geoffray | a00b54b | 2019-12-03 14:36:42 +0000 | [diff] [blame] | 40 | ASM_DEFINE(MIRROR_CLASS_VTABLE_OFFSET_32, |
| 41 | art::mirror::Class::EmbeddedVTableOffset(art::PointerSize::k32).Int32Value()) |
| 42 | ASM_DEFINE(MIRROR_CLASS_VTABLE_OFFSET_64, |
| 43 | art::mirror::Class::EmbeddedVTableOffset(art::PointerSize::k64).Int32Value()) |
| 44 | ASM_DEFINE(MIRROR_CLASS_IMT_PTR_OFFSET_32, |
| 45 | art::mirror::Class::ImtPtrOffset(art::PointerSize::k32).Int32Value()) |
| 46 | ASM_DEFINE(MIRROR_CLASS_IMT_PTR_OFFSET_64, |
| 47 | art::mirror::Class::ImtPtrOffset(art::PointerSize::k64).Int32Value()) |
Nicolas Geoffray | c2b3116 | 2021-12-06 09:08:33 +0000 | [diff] [blame] | 48 | ASM_DEFINE(MIRROR_CLASS_SUPER_CLASS_OFFSET, |
| 49 | art::mirror::Class::SuperClassOffset().Int32Value()) |
| 50 | ASM_DEFINE(MIRROR_CLASS_IS_INTERFACE_FLAG, art::kAccInterface) |
| 51 | ASM_DEFINE(MIRROR_CLASS_IS_INTERFACE_FLAG_BIT, |
| 52 | art::WhichPowerOf2(art::kAccInterface)) |
Nicolas Geoffray | 8af7f91 | 2022-07-06 15:29:16 +0100 | [diff] [blame] | 53 | ASM_DEFINE(MIRROR_CLASS_IS_VISIBLY_INITIALIZED_OFFSET, |
| 54 | art::mirror::Class::StatusOffset().SizeValue() + |
| 55 | (art::SubtypeCheckBits::BitStructSizeOf() / art::kBitsPerByte)) |
| 56 | ASM_DEFINE(MIRROR_CLASS_IS_VISIBLY_INITIALIZED_VALUE, |
| 57 | art::enum_cast<uint32_t>(art::ClassStatus::kVisiblyInitialized) << |
| 58 | (art::SubtypeCheckBits::BitStructSizeOf() % art::kBitsPerByte)) |
Nicolas Geoffray | 88d81e0 | 2022-08-07 14:48:09 +0100 | [diff] [blame] | 59 | ASM_DEFINE(MIRROR_CLASS_IS_INITIALIZING_VALUE, |
| 60 | art::enum_cast<uint32_t>(art::ClassStatus::kInitializing) << |
| 61 | (art::SubtypeCheckBits::BitStructSizeOf() % art::kBitsPerByte)) |
Nicolas Geoffray | 93455a0 | 2022-09-05 15:17:22 +0000 | [diff] [blame] | 62 | ASM_DEFINE(MIRROR_CLASS_IS_INITIALIZED_VALUE, |
| 63 | art::enum_cast<uint32_t>(art::ClassStatus::kInitialized) << |
| 64 | (art::SubtypeCheckBits::BitStructSizeOf() % art::kBitsPerByte)) |
Nicolas Geoffray | 88d81e0 | 2022-08-07 14:48:09 +0100 | [diff] [blame] | 65 | ASM_DEFINE(MIRROR_CLASS_CLINIT_THREAD_ID_OFFSET, |
| 66 | art::mirror::Class::ClinitThreadIdOffset().Int32Value()) |