blob: 6c189b0a84d40d8d560b71c8a46ff01338085c18 [file] [log] [blame]
Igor Murashkin311fdf52016-07-22 15:59:16 -07001
2/*
3 * Copyright (C) 2016 The Android Open Source Project
4 *
5 * Licensed under the Apache License, Version 2.0 (the "License");
6 * you may not use this file except in compliance with the License.
7 * You may obtain a copy of the License at
8 *
9 * http://www.apache.org/licenses/LICENSE-2.0
10 *
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
16 */
17
18#ifndef ART_RUNTIME_GENERATED_ASM_SUPPORT_GEN_H_
19#define ART_RUNTIME_GENERATED_ASM_SUPPORT_GEN_H_
20
21// This file has been auto-generated by cpp-define-generator; do not edit directly.
22
23#define STACK_REFERENCE_SIZE 0x4
24DEFINE_CHECK_EQ(static_cast<size_t>(STACK_REFERENCE_SIZE), (static_cast<size_t>(sizeof(art::StackReference<art::mirror::Object>))))
25#define COMPRESSED_REFERENCE_SIZE 0x4
26DEFINE_CHECK_EQ(static_cast<size_t>(COMPRESSED_REFERENCE_SIZE), (static_cast<size_t>(sizeof(art::mirror::CompressedReference<art::mirror::Object>))))
27#define COMPRESSED_REFERENCE_SIZE_SHIFT 0x2
28DEFINE_CHECK_EQ(static_cast<size_t>(COMPRESSED_REFERENCE_SIZE_SHIFT), (static_cast<size_t>(art::WhichPowerOf2(sizeof(art::mirror::CompressedReference<art::mirror::Object>)))))
Vladimir Markofd36f1f2016-08-03 18:49:58 +010029#define RUNTIME_SAVE_ALL_CALLEE_SAVES_METHOD_OFFSET 0
30DEFINE_CHECK_EQ(static_cast<size_t>(RUNTIME_SAVE_ALL_CALLEE_SAVES_METHOD_OFFSET), (static_cast<size_t>(art::Runtime::GetCalleeSaveMethodOffset(art::Runtime:: kSaveAllCalleeSaves))))
31#define RUNTIME_SAVE_REFS_ONLY_METHOD_OFFSET 0x8
32DEFINE_CHECK_EQ(static_cast<size_t>(RUNTIME_SAVE_REFS_ONLY_METHOD_OFFSET), (static_cast<size_t>(art::Runtime::GetCalleeSaveMethodOffset(art::Runtime:: kSaveRefsOnly))))
33#define RUNTIME_SAVE_REFS_AND_ARGS_METHOD_OFFSET 0x10
34DEFINE_CHECK_EQ(static_cast<size_t>(RUNTIME_SAVE_REFS_AND_ARGS_METHOD_OFFSET), (static_cast<size_t>(art::Runtime::GetCalleeSaveMethodOffset(art::Runtime:: kSaveRefsAndArgs))))
35#define RUNTIME_SAVE_EVERYTHING_METHOD_OFFSET 0x18
36DEFINE_CHECK_EQ(static_cast<size_t>(RUNTIME_SAVE_EVERYTHING_METHOD_OFFSET), (static_cast<size_t>(art::Runtime::GetCalleeSaveMethodOffset(art::Runtime:: kSaveEverything))))
Igor Murashkin311fdf52016-07-22 15:59:16 -070037#define THREAD_FLAGS_OFFSET 0
Andreas Gampe542451c2016-07-26 09:02:02 -070038DEFINE_CHECK_EQ(static_cast<int32_t>(THREAD_FLAGS_OFFSET), (static_cast<int32_t>(art::Thread:: ThreadFlagsOffset<art::kRuntimePointerSize>().Int32Value())))
Igor Murashkin311fdf52016-07-22 15:59:16 -070039#define THREAD_ID_OFFSET 12
Andreas Gampe542451c2016-07-26 09:02:02 -070040DEFINE_CHECK_EQ(static_cast<int32_t>(THREAD_ID_OFFSET), (static_cast<int32_t>(art::Thread:: ThinLockIdOffset<art::kRuntimePointerSize>().Int32Value())))
Igor Murashkin311fdf52016-07-22 15:59:16 -070041#define THREAD_IS_GC_MARKING_OFFSET 52
Andreas Gampe542451c2016-07-26 09:02:02 -070042DEFINE_CHECK_EQ(static_cast<int32_t>(THREAD_IS_GC_MARKING_OFFSET), (static_cast<int32_t>(art::Thread:: IsGcMarkingOffset<art::kRuntimePointerSize>().Int32Value())))
Igor Murashkin311fdf52016-07-22 15:59:16 -070043#define THREAD_CARD_TABLE_OFFSET 128
Andreas Gampe542451c2016-07-26 09:02:02 -070044DEFINE_CHECK_EQ(static_cast<int32_t>(THREAD_CARD_TABLE_OFFSET), (static_cast<int32_t>(art::Thread:: CardTableOffset<art::kRuntimePointerSize>().Int32Value())))
Igor Murashkin311fdf52016-07-22 15:59:16 -070045#define CODEITEM_INSNS_OFFSET 16
46DEFINE_CHECK_EQ(static_cast<int32_t>(CODEITEM_INSNS_OFFSET), (static_cast<int32_t>(__builtin_offsetof(art::DexFile::CodeItem, insns_))))
47#define MIRROR_OBJECT_CLASS_OFFSET 0
48DEFINE_CHECK_EQ(static_cast<int32_t>(MIRROR_OBJECT_CLASS_OFFSET), (static_cast<int32_t>(art::mirror::Object:: ClassOffset().Int32Value())))
49#define MIRROR_OBJECT_LOCK_WORD_OFFSET 4
50DEFINE_CHECK_EQ(static_cast<int32_t>(MIRROR_OBJECT_LOCK_WORD_OFFSET), (static_cast<int32_t>(art::mirror::Object:: MonitorOffset().Int32Value())))
51#define MIRROR_CLASS_STATUS_INITIALIZED 0xa
52DEFINE_CHECK_EQ(static_cast<uint32_t>(MIRROR_CLASS_STATUS_INITIALIZED), (static_cast<uint32_t>((art::mirror::Class::kStatusInitialized))))
53#define ACCESS_FLAGS_CLASS_IS_FINALIZABLE 0x80000000
54DEFINE_CHECK_EQ(static_cast<uint32_t>(ACCESS_FLAGS_CLASS_IS_FINALIZABLE), (static_cast<uint32_t>((art::kAccClassIsFinalizable))))
Mathieu Chartier2ecfd272016-11-01 10:10:05 -070055#define ACCESS_FLAGS_CLASS_IS_INTERFACE 0x200
56DEFINE_CHECK_EQ(static_cast<uint32_t>(ACCESS_FLAGS_CLASS_IS_INTERFACE), (static_cast<uint32_t>((art::kAccInterface))))
Igor Murashkin311fdf52016-07-22 15:59:16 -070057#define ACCESS_FLAGS_CLASS_IS_FINALIZABLE_BIT 0x1f
58DEFINE_CHECK_EQ(static_cast<uint32_t>(ACCESS_FLAGS_CLASS_IS_FINALIZABLE_BIT), (static_cast<uint32_t>((art::MostSignificantBit(art::kAccClassIsFinalizable)))))
59#define ART_METHOD_DEX_CACHE_METHODS_OFFSET_32 20
Andreas Gampe542451c2016-07-26 09:02:02 -070060DEFINE_CHECK_EQ(static_cast<int32_t>(ART_METHOD_DEX_CACHE_METHODS_OFFSET_32), (static_cast<int32_t>(art::ArtMethod:: DexCacheResolvedMethodsOffset(art::PointerSize::k32).Int32Value())))
Igor Murashkin311fdf52016-07-22 15:59:16 -070061#define ART_METHOD_DEX_CACHE_METHODS_OFFSET_64 24
Andreas Gampe542451c2016-07-26 09:02:02 -070062DEFINE_CHECK_EQ(static_cast<int32_t>(ART_METHOD_DEX_CACHE_METHODS_OFFSET_64), (static_cast<int32_t>(art::ArtMethod:: DexCacheResolvedMethodsOffset(art::PointerSize::k64).Int32Value())))
Igor Murashkin311fdf52016-07-22 15:59:16 -070063#define ART_METHOD_DEX_CACHE_TYPES_OFFSET_32 24
Andreas Gampe542451c2016-07-26 09:02:02 -070064DEFINE_CHECK_EQ(static_cast<int32_t>(ART_METHOD_DEX_CACHE_TYPES_OFFSET_32), (static_cast<int32_t>(art::ArtMethod:: DexCacheResolvedTypesOffset(art::PointerSize::k32).Int32Value())))
Igor Murashkin311fdf52016-07-22 15:59:16 -070065#define ART_METHOD_DEX_CACHE_TYPES_OFFSET_64 32
Andreas Gampe542451c2016-07-26 09:02:02 -070066DEFINE_CHECK_EQ(static_cast<int32_t>(ART_METHOD_DEX_CACHE_TYPES_OFFSET_64), (static_cast<int32_t>(art::ArtMethod:: DexCacheResolvedTypesOffset(art::PointerSize::k64).Int32Value())))
Igor Murashkin311fdf52016-07-22 15:59:16 -070067#define ART_METHOD_JNI_OFFSET_32 28
Andreas Gampe542451c2016-07-26 09:02:02 -070068DEFINE_CHECK_EQ(static_cast<int32_t>(ART_METHOD_JNI_OFFSET_32), (static_cast<int32_t>(art::ArtMethod:: EntryPointFromJniOffset(art::PointerSize::k32).Int32Value())))
Igor Murashkin311fdf52016-07-22 15:59:16 -070069#define ART_METHOD_JNI_OFFSET_64 40
Andreas Gampe542451c2016-07-26 09:02:02 -070070DEFINE_CHECK_EQ(static_cast<int32_t>(ART_METHOD_JNI_OFFSET_64), (static_cast<int32_t>(art::ArtMethod:: EntryPointFromJniOffset(art::PointerSize::k64).Int32Value())))
Igor Murashkin311fdf52016-07-22 15:59:16 -070071#define ART_METHOD_QUICK_CODE_OFFSET_32 32
Andreas Gampe542451c2016-07-26 09:02:02 -070072DEFINE_CHECK_EQ(static_cast<int32_t>(ART_METHOD_QUICK_CODE_OFFSET_32), (static_cast<int32_t>(art::ArtMethod:: EntryPointFromQuickCompiledCodeOffset(art::PointerSize::k32).Int32Value())))
Igor Murashkin311fdf52016-07-22 15:59:16 -070073#define ART_METHOD_QUICK_CODE_OFFSET_64 48
Andreas Gampe542451c2016-07-26 09:02:02 -070074DEFINE_CHECK_EQ(static_cast<int32_t>(ART_METHOD_QUICK_CODE_OFFSET_64), (static_cast<int32_t>(art::ArtMethod:: EntryPointFromQuickCompiledCodeOffset(art::PointerSize::k64).Int32Value())))
Christina Wadsworth97a8a9a2016-08-19 11:23:48 -070075#define ART_METHOD_DECLARING_CLASS_OFFSET 0
76DEFINE_CHECK_EQ(static_cast<int32_t>(ART_METHOD_DECLARING_CLASS_OFFSET), (static_cast<int32_t>(art::ArtMethod:: DeclaringClassOffset().Int32Value())))
77#define DECLARING_CLASS_DEX_CACHE_STRINGS_OFFSET 40
78DEFINE_CHECK_EQ(static_cast<int32_t>(DECLARING_CLASS_DEX_CACHE_STRINGS_OFFSET), (static_cast<int32_t>(art::mirror::Class:: DexCacheStringsOffset().Int32Value())))
79#define STRING_DEX_CACHE_ELEMENT_SIZE_SHIFT 3
80DEFINE_CHECK_EQ(static_cast<int32_t>(STRING_DEX_CACHE_ELEMENT_SIZE_SHIFT), (static_cast<int32_t>(art::WhichPowerOf2(sizeof(art::mirror::StringDexCachePair)))))
81#define STRING_DEX_CACHE_SIZE_MINUS_ONE 1023
82DEFINE_CHECK_EQ(static_cast<int32_t>(STRING_DEX_CACHE_SIZE_MINUS_ONE), (static_cast<int32_t>(art::mirror::DexCache::kDexCacheStringCacheSize - 1)))
83#define STRING_DEX_CACHE_HASH_BITS 10
84DEFINE_CHECK_EQ(static_cast<int32_t>(STRING_DEX_CACHE_HASH_BITS), (static_cast<int32_t>(art::LeastSignificantBit(art::mirror::DexCache::kDexCacheStringCacheSize))))
Christina Wadsworth74898e72016-08-25 13:23:01 -070085#define STRING_DEX_CACHE_ELEMENT_SIZE 8
86DEFINE_CHECK_EQ(static_cast<int32_t>(STRING_DEX_CACHE_ELEMENT_SIZE), (static_cast<int32_t>(sizeof(art::mirror::StringDexCachePair))))
Mathieu Chartier8261d022016-08-08 09:41:04 -070087#define MIN_LARGE_OBJECT_THRESHOLD 0x3000
88DEFINE_CHECK_EQ(static_cast<size_t>(MIN_LARGE_OBJECT_THRESHOLD), (static_cast<size_t>(art::gc::Heap::kMinLargeObjectThreshold)))
Igor Murashkin311fdf52016-07-22 15:59:16 -070089#define LOCK_WORD_STATE_SHIFT 30
90DEFINE_CHECK_EQ(static_cast<int32_t>(LOCK_WORD_STATE_SHIFT), (static_cast<int32_t>(art::LockWord::kStateShift)))
91#define LOCK_WORD_STATE_MASK 0xc0000000
92DEFINE_CHECK_EQ(static_cast<uint32_t>(LOCK_WORD_STATE_MASK), (static_cast<uint32_t>(art::LockWord::kStateMaskShifted)))
93#define LOCK_WORD_READ_BARRIER_STATE_SHIFT 28
94DEFINE_CHECK_EQ(static_cast<int32_t>(LOCK_WORD_READ_BARRIER_STATE_SHIFT), (static_cast<int32_t>(art::LockWord::kReadBarrierStateShift)))
Mathieu Chartier36a270a2016-07-28 18:08:51 -070095#define LOCK_WORD_READ_BARRIER_STATE_MASK 0x10000000
Igor Murashkin311fdf52016-07-22 15:59:16 -070096DEFINE_CHECK_EQ(static_cast<uint32_t>(LOCK_WORD_READ_BARRIER_STATE_MASK), (static_cast<uint32_t>(art::LockWord::kReadBarrierStateMaskShifted)))
Mathieu Chartier36a270a2016-07-28 18:08:51 -070097#define LOCK_WORD_READ_BARRIER_STATE_MASK_TOGGLED 0xefffffff
Igor Murashkin311fdf52016-07-22 15:59:16 -070098DEFINE_CHECK_EQ(static_cast<uint32_t>(LOCK_WORD_READ_BARRIER_STATE_MASK_TOGGLED), (static_cast<uint32_t>(art::LockWord::kReadBarrierStateMaskShiftedToggled)))
99#define LOCK_WORD_THIN_LOCK_COUNT_ONE 65536
100DEFINE_CHECK_EQ(static_cast<int32_t>(LOCK_WORD_THIN_LOCK_COUNT_ONE), (static_cast<int32_t>(art::LockWord::kThinLockCountOne)))
Mathieu Chartier36a270a2016-07-28 18:08:51 -0700101#define LOCK_WORD_GC_STATE_MASK_SHIFTED 0x30000000
102DEFINE_CHECK_EQ(static_cast<uint32_t>(LOCK_WORD_GC_STATE_MASK_SHIFTED), (static_cast<uint32_t>(art::LockWord::kGCStateMaskShifted)))
103#define LOCK_WORD_GC_STATE_MASK_SHIFTED_TOGGLED 0xcfffffff
104DEFINE_CHECK_EQ(static_cast<uint32_t>(LOCK_WORD_GC_STATE_MASK_SHIFTED_TOGGLED), (static_cast<uint32_t>(art::LockWord::kGCStateMaskShiftedToggled)))
105#define LOCK_WORD_GC_STATE_SHIFT 28
106DEFINE_CHECK_EQ(static_cast<int32_t>(LOCK_WORD_GC_STATE_SHIFT), (static_cast<int32_t>(art::LockWord::kGCStateShift)))
107#define LOCK_WORD_MARK_BIT_SHIFT 29
108DEFINE_CHECK_EQ(static_cast<int32_t>(LOCK_WORD_MARK_BIT_SHIFT), (static_cast<int32_t>(art::LockWord::kMarkBitStateShift)))
109#define LOCK_WORD_MARK_BIT_MASK_SHIFTED 0x20000000
110DEFINE_CHECK_EQ(static_cast<uint32_t>(LOCK_WORD_MARK_BIT_MASK_SHIFTED), (static_cast<uint32_t>(art::LockWord::kMarkBitStateMaskShifted)))
Igor Murashkin311fdf52016-07-22 15:59:16 -0700111#define OBJECT_ALIGNMENT_MASK 0x7
112DEFINE_CHECK_EQ(static_cast<size_t>(OBJECT_ALIGNMENT_MASK), (static_cast<size_t>(art::kObjectAlignment - 1)))
113#define OBJECT_ALIGNMENT_MASK_TOGGLED 0xfffffff8
114DEFINE_CHECK_EQ(static_cast<uint32_t>(OBJECT_ALIGNMENT_MASK_TOGGLED), (static_cast<uint32_t>(~static_cast<uint32_t>(art::kObjectAlignment - 1))))
Mathieu Chartier2ee98f22016-08-10 10:08:58 -0700115#define OBJECT_ALIGNMENT_MASK_TOGGLED64 0xfffffffffffffff8
116DEFINE_CHECK_EQ(static_cast<uint64_t>(OBJECT_ALIGNMENT_MASK_TOGGLED64), (static_cast<uint64_t>(~static_cast<uint64_t>(art::kObjectAlignment - 1))))
Igor Murashkin311fdf52016-07-22 15:59:16 -0700117#define ROSALLOC_MAX_THREAD_LOCAL_BRACKET_SIZE 128
118DEFINE_CHECK_EQ(static_cast<int32_t>(ROSALLOC_MAX_THREAD_LOCAL_BRACKET_SIZE), (static_cast<int32_t>((art::gc::allocator::RosAlloc::kMaxThreadLocalBracketSize))))
119#define ROSALLOC_BRACKET_QUANTUM_SIZE_SHIFT 3
120DEFINE_CHECK_EQ(static_cast<int32_t>(ROSALLOC_BRACKET_QUANTUM_SIZE_SHIFT), (static_cast<int32_t>((art::gc::allocator::RosAlloc::kThreadLocalBracketQuantumSizeShift))))
121#define ROSALLOC_BRACKET_QUANTUM_SIZE_MASK 7
122DEFINE_CHECK_EQ(static_cast<int32_t>(ROSALLOC_BRACKET_QUANTUM_SIZE_MASK), (static_cast<int32_t>((static_cast<int32_t>(art::gc::allocator::RosAlloc::kThreadLocalBracketQuantumSize - 1)))))
123#define ROSALLOC_BRACKET_QUANTUM_SIZE_MASK_TOGGLED32 0xfffffff8
124DEFINE_CHECK_EQ(static_cast<uint32_t>(ROSALLOC_BRACKET_QUANTUM_SIZE_MASK_TOGGLED32), (static_cast<uint32_t>((~static_cast<uint32_t>(art::gc::allocator::RosAlloc::kThreadLocalBracketQuantumSize - 1)))))
125#define ROSALLOC_BRACKET_QUANTUM_SIZE_MASK_TOGGLED64 0xfffffffffffffff8
126DEFINE_CHECK_EQ(static_cast<uint64_t>(ROSALLOC_BRACKET_QUANTUM_SIZE_MASK_TOGGLED64), (static_cast<uint64_t>((~static_cast<uint64_t>(art::gc::allocator::RosAlloc::kThreadLocalBracketQuantumSize - 1)))))
127#define ROSALLOC_RUN_FREE_LIST_OFFSET 8
128DEFINE_CHECK_EQ(static_cast<int32_t>(ROSALLOC_RUN_FREE_LIST_OFFSET), (static_cast<int32_t>((art::gc::allocator::RosAlloc::RunFreeListOffset()))))
129#define ROSALLOC_RUN_FREE_LIST_HEAD_OFFSET 0
130DEFINE_CHECK_EQ(static_cast<int32_t>(ROSALLOC_RUN_FREE_LIST_HEAD_OFFSET), (static_cast<int32_t>((art::gc::allocator::RosAlloc::RunFreeListHeadOffset()))))
131#define ROSALLOC_RUN_FREE_LIST_SIZE_OFFSET 16
132DEFINE_CHECK_EQ(static_cast<int32_t>(ROSALLOC_RUN_FREE_LIST_SIZE_OFFSET), (static_cast<int32_t>((art::gc::allocator::RosAlloc::RunFreeListSizeOffset()))))
133#define ROSALLOC_SLOT_NEXT_OFFSET 0
134DEFINE_CHECK_EQ(static_cast<int32_t>(ROSALLOC_SLOT_NEXT_OFFSET), (static_cast<int32_t>((art::gc::allocator::RosAlloc::RunSlotNextOffset()))))
135#define THREAD_SUSPEND_REQUEST 1
136DEFINE_CHECK_EQ(static_cast<int32_t>(THREAD_SUSPEND_REQUEST), (static_cast<int32_t>((art::kSuspendRequest))))
137#define THREAD_CHECKPOINT_REQUEST 2
138DEFINE_CHECK_EQ(static_cast<int32_t>(THREAD_CHECKPOINT_REQUEST), (static_cast<int32_t>((art::kCheckpointRequest))))
139#define JIT_CHECK_OSR (-1)
140DEFINE_CHECK_EQ(static_cast<int16_t>(JIT_CHECK_OSR), (static_cast<int16_t>((art::jit::kJitCheckForOSR))))
141#define JIT_HOTNESS_DISABLE (-2)
142DEFINE_CHECK_EQ(static_cast<int16_t>(JIT_HOTNESS_DISABLE), (static_cast<int16_t>((art::jit::kJitHotnessDisabled))))
143
144#endif // ART_RUNTIME_GENERATED_ASM_SUPPORT_GEN_H_
145