blob: 44c0661e3f898c92b86e8c574f5a0405a67106ea [file] [log] [blame]
Elliott Hughes2faa5f12012-01-30 14:42:07 -08001/*
2 * Copyright (C) 2011 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 */
Ian Rogers9651f422011-09-19 20:26:07 -070016
Brian Carlstromfc0e3212013-07-17 14:40:12 -070017#ifndef ART_RUNTIME_ASM_SUPPORT_H_
18#define ART_RUNTIME_ASM_SUPPORT_H_
Ian Rogers9651f422011-09-19 20:26:07 -070019
Hiroshi Yamauchi800ac2d2014-04-02 17:32:54 -070020#include "read_barrier_c.h"
Hiroshi Yamauchi9d04a202014-01-31 13:35:49 -080021
Zheng Xu69a50302015-04-14 20:04:41 +080022#if defined(__arm__) || defined(__mips__)
23// In quick code for ARM and MIPS we make poor use of registers and perform frequent suspend
Ian Rogers1d8cdbc2014-09-22 22:51:09 -070024// checks in the event of loop back edges. The SUSPEND_CHECK_INTERVAL constant is loaded into a
25// register at the point of an up-call or after handling a suspend check. It reduces the number of
26// loads of the TLS suspend check value by the given amount (turning it into a decrement and compare
27// of a register). This increases the time for a thread to respond to requests from GC and the
28// debugger, damaging GC performance and creating other unwanted artifacts. For example, this count
29// has the effect of making loops and Java code look cold in profilers, where the count is reset
30// impacts where samples will occur. Reducing the count as much as possible improves profiler
31// accuracy in tools like traceview.
32// TODO: get a compiler that can do a proper job of loop optimization and remove this.
buzbee72be1cd2014-11-11 22:48:59 -080033#define SUSPEND_CHECK_INTERVAL 96
Ian Rogers1d8cdbc2014-09-22 22:51:09 -070034#endif
35
Andreas Gampeb2d18fa2017-06-06 20:46:10 -070036// To generate tests related to the constants in this header, either define ADD_TEST_EQ before
37// including, or use asm_support_check.h.
Ian Rogers1d8cdbc2014-09-22 22:51:09 -070038#ifndef ADD_TEST_EQ // Allow #include-r to replace with their own.
Andreas Gampeb2d18fa2017-06-06 20:46:10 -070039#define DEFINED_ADD_TEST_EQ 1
Ian Rogers1d8cdbc2014-09-22 22:51:09 -070040#define ADD_TEST_EQ(x, y)
41#endif
42
Hiroshi Yamauchidc412b62015-10-15 12:26:57 -070043#if defined(__LP64__)
44#define POINTER_SIZE_SHIFT 3
Andreas Gampe542451c2016-07-26 09:02:02 -070045#define POINTER_SIZE art::PointerSize::k64
Hiroshi Yamauchidc412b62015-10-15 12:26:57 -070046#else
47#define POINTER_SIZE_SHIFT 2
Andreas Gampe542451c2016-07-26 09:02:02 -070048#define POINTER_SIZE art::PointerSize::k32
Hiroshi Yamauchidc412b62015-10-15 12:26:57 -070049#endif
50ADD_TEST_EQ(static_cast<size_t>(1U << POINTER_SIZE_SHIFT),
51 static_cast<size_t>(__SIZEOF_POINTER__))
52
Igor Murashkin311fdf52016-07-22 15:59:16 -070053// Import platform-independent constant defines from our autogenerated list.
54// Export new defines (for assembly use) by editing cpp-define-generator def files.
55#define DEFINE_CHECK_EQ ADD_TEST_EQ
Igor Murashkin2bb70d32017-02-06 10:34:14 -080056#include "asm_support_gen.h"
Andreas Gampeb2d18fa2017-06-06 20:46:10 -070057#undef DEFINE_CHECK_EQ
Ian Rogers1d8cdbc2014-09-22 22:51:09 -070058
59// Offset of field Thread::tlsPtr_.exception.
60#define THREAD_EXCEPTION_OFFSET (THREAD_CARD_TABLE_OFFSET + __SIZEOF_POINTER__)
61ADD_TEST_EQ(THREAD_EXCEPTION_OFFSET,
Andreas Gampe542451c2016-07-26 09:02:02 -070062 art::Thread::ExceptionOffset<POINTER_SIZE>().Int32Value())
Ian Rogers1d8cdbc2014-09-22 22:51:09 -070063
64// Offset of field Thread::tlsPtr_.managed_stack.top_quick_frame_.
65#define THREAD_TOP_QUICK_FRAME_OFFSET (THREAD_CARD_TABLE_OFFSET + (3 * __SIZEOF_POINTER__))
66ADD_TEST_EQ(THREAD_TOP_QUICK_FRAME_OFFSET,
Andreas Gampe542451c2016-07-26 09:02:02 -070067 art::Thread::TopOfManagedStackOffset<POINTER_SIZE>().Int32Value())
Ian Rogers1d8cdbc2014-09-22 22:51:09 -070068
Roland Levillainca80ecc2015-07-22 17:19:28 +010069// Offset of field Thread::tlsPtr_.self.
Andreas Gampe449357d2015-06-01 22:29:51 -070070#define THREAD_SELF_OFFSET (THREAD_CARD_TABLE_OFFSET + (9 * __SIZEOF_POINTER__))
Ian Rogers1d8cdbc2014-09-22 22:51:09 -070071ADD_TEST_EQ(THREAD_SELF_OFFSET,
Andreas Gampe542451c2016-07-26 09:02:02 -070072 art::Thread::SelfOffset<POINTER_SIZE>().Int32Value())
Ian Rogers4a510d82011-10-09 14:30:24 -070073
Roland Levillainca80ecc2015-07-22 17:19:28 +010074// Offset of field Thread::tlsPtr_.thread_local_pos.
Roland Levillaine71b3542017-01-16 14:58:23 +000075#define THREAD_LOCAL_POS_OFFSET (THREAD_CARD_TABLE_OFFSET + 34 * __SIZEOF_POINTER__)
Hiroshi Yamauchie01a5202015-03-19 12:35:04 -070076ADD_TEST_EQ(THREAD_LOCAL_POS_OFFSET,
Andreas Gampe542451c2016-07-26 09:02:02 -070077 art::Thread::ThreadLocalPosOffset<POINTER_SIZE>().Int32Value())
Roland Levillainca80ecc2015-07-22 17:19:28 +010078// Offset of field Thread::tlsPtr_.thread_local_end.
Hiroshi Yamauchie01a5202015-03-19 12:35:04 -070079#define THREAD_LOCAL_END_OFFSET (THREAD_LOCAL_POS_OFFSET + __SIZEOF_POINTER__)
80ADD_TEST_EQ(THREAD_LOCAL_END_OFFSET,
Andreas Gampe542451c2016-07-26 09:02:02 -070081 art::Thread::ThreadLocalEndOffset<POINTER_SIZE>().Int32Value())
Vladimir Marko05846472016-09-14 12:49:57 +010082// Offset of field Thread::tlsPtr_.thread_local_objects.
Mathieu Chartier6bc77742017-04-18 17:46:23 -070083#define THREAD_LOCAL_OBJECTS_OFFSET (THREAD_LOCAL_END_OFFSET + 2 * __SIZEOF_POINTER__)
Vladimir Marko05846472016-09-14 12:49:57 +010084ADD_TEST_EQ(THREAD_LOCAL_OBJECTS_OFFSET,
85 art::Thread::ThreadLocalObjectsOffset<POINTER_SIZE>().Int32Value())
Roland Levillaine71b3542017-01-16 14:58:23 +000086
buzbee1452bee2015-03-06 14:43:04 -080087// Offset of field Thread::tlsPtr_.mterp_current_ibase.
Roland Levillaine71b3542017-01-16 14:58:23 +000088#define THREAD_CURRENT_IBASE_OFFSET \
Nicolas Geoffrayb048cb72017-01-23 22:50:24 +000089 (THREAD_LOCAL_OBJECTS_OFFSET + __SIZEOF_SIZE_T__ + (1 + 161) * __SIZEOF_POINTER__)
buzbee1452bee2015-03-06 14:43:04 -080090ADD_TEST_EQ(THREAD_CURRENT_IBASE_OFFSET,
Andreas Gampe542451c2016-07-26 09:02:02 -070091 art::Thread::MterpCurrentIBaseOffset<POINTER_SIZE>().Int32Value())
buzbee1452bee2015-03-06 14:43:04 -080092// Offset of field Thread::tlsPtr_.mterp_default_ibase.
Vladimir Marko87f3fcb2016-04-28 15:52:11 +010093#define THREAD_DEFAULT_IBASE_OFFSET (THREAD_CURRENT_IBASE_OFFSET + __SIZEOF_POINTER__)
buzbee1452bee2015-03-06 14:43:04 -080094ADD_TEST_EQ(THREAD_DEFAULT_IBASE_OFFSET,
Andreas Gampe542451c2016-07-26 09:02:02 -070095 art::Thread::MterpDefaultIBaseOffset<POINTER_SIZE>().Int32Value())
buzbee1452bee2015-03-06 14:43:04 -080096// Offset of field Thread::tlsPtr_.mterp_alt_ibase.
Vladimir Marko87f3fcb2016-04-28 15:52:11 +010097#define THREAD_ALT_IBASE_OFFSET (THREAD_DEFAULT_IBASE_OFFSET + __SIZEOF_POINTER__)
buzbee1452bee2015-03-06 14:43:04 -080098ADD_TEST_EQ(THREAD_ALT_IBASE_OFFSET,
Andreas Gampe542451c2016-07-26 09:02:02 -070099 art::Thread::MterpAltIBaseOffset<POINTER_SIZE>().Int32Value())
Hiroshi Yamauchidc412b62015-10-15 12:26:57 -0700100// Offset of field Thread::tlsPtr_.rosalloc_runs.
Vladimir Marko87f3fcb2016-04-28 15:52:11 +0100101#define THREAD_ROSALLOC_RUNS_OFFSET (THREAD_ALT_IBASE_OFFSET + __SIZEOF_POINTER__)
Hiroshi Yamauchidc412b62015-10-15 12:26:57 -0700102ADD_TEST_EQ(THREAD_ROSALLOC_RUNS_OFFSET,
Andreas Gampe542451c2016-07-26 09:02:02 -0700103 art::Thread::RosAllocRunsOffset<POINTER_SIZE>().Int32Value())
Hiroshi Yamauchidc412b62015-10-15 12:26:57 -0700104// Offset of field Thread::tlsPtr_.thread_local_alloc_stack_top.
Hiroshi Yamauchi7ed9c562016-02-02 15:22:09 -0800105#define THREAD_LOCAL_ALLOC_STACK_TOP_OFFSET (THREAD_ROSALLOC_RUNS_OFFSET + 16 * __SIZEOF_POINTER__)
Hiroshi Yamauchidc412b62015-10-15 12:26:57 -0700106ADD_TEST_EQ(THREAD_LOCAL_ALLOC_STACK_TOP_OFFSET,
Andreas Gampe542451c2016-07-26 09:02:02 -0700107 art::Thread::ThreadLocalAllocStackTopOffset<POINTER_SIZE>().Int32Value())
Hiroshi Yamauchidc412b62015-10-15 12:26:57 -0700108// Offset of field Thread::tlsPtr_.thread_local_alloc_stack_end.
Hiroshi Yamauchi7ed9c562016-02-02 15:22:09 -0800109#define THREAD_LOCAL_ALLOC_STACK_END_OFFSET (THREAD_ROSALLOC_RUNS_OFFSET + 17 * __SIZEOF_POINTER__)
Hiroshi Yamauchidc412b62015-10-15 12:26:57 -0700110ADD_TEST_EQ(THREAD_LOCAL_ALLOC_STACK_END_OFFSET,
Andreas Gampe542451c2016-07-26 09:02:02 -0700111 art::Thread::ThreadLocalAllocStackEndOffset<POINTER_SIZE>().Int32Value())
Hiroshi Yamauchie01a5202015-03-19 12:35:04 -0700112
buzbee1452bee2015-03-06 14:43:04 -0800113// Offsets within ShadowFrame.
114#define SHADOWFRAME_LINK_OFFSET 0
115ADD_TEST_EQ(SHADOWFRAME_LINK_OFFSET,
116 static_cast<int32_t>(art::ShadowFrame::LinkOffset()))
117#define SHADOWFRAME_METHOD_OFFSET (SHADOWFRAME_LINK_OFFSET + 1 * __SIZEOF_POINTER__)
118ADD_TEST_EQ(SHADOWFRAME_METHOD_OFFSET,
119 static_cast<int32_t>(art::ShadowFrame::MethodOffset()))
120#define SHADOWFRAME_RESULT_REGISTER_OFFSET (SHADOWFRAME_LINK_OFFSET + 2 * __SIZEOF_POINTER__)
121ADD_TEST_EQ(SHADOWFRAME_RESULT_REGISTER_OFFSET,
122 static_cast<int32_t>(art::ShadowFrame::ResultRegisterOffset()))
123#define SHADOWFRAME_DEX_PC_PTR_OFFSET (SHADOWFRAME_LINK_OFFSET + 3 * __SIZEOF_POINTER__)
124ADD_TEST_EQ(SHADOWFRAME_DEX_PC_PTR_OFFSET,
125 static_cast<int32_t>(art::ShadowFrame::DexPCPtrOffset()))
126#define SHADOWFRAME_CODE_ITEM_OFFSET (SHADOWFRAME_LINK_OFFSET + 4 * __SIZEOF_POINTER__)
127ADD_TEST_EQ(SHADOWFRAME_CODE_ITEM_OFFSET,
128 static_cast<int32_t>(art::ShadowFrame::CodeItemOffset()))
129#define SHADOWFRAME_LOCK_COUNT_DATA_OFFSET (SHADOWFRAME_LINK_OFFSET + 5 * __SIZEOF_POINTER__)
130ADD_TEST_EQ(SHADOWFRAME_LOCK_COUNT_DATA_OFFSET,
131 static_cast<int32_t>(art::ShadowFrame::LockCountDataOffset()))
132#define SHADOWFRAME_NUMBER_OF_VREGS_OFFSET (SHADOWFRAME_LINK_OFFSET + 6 * __SIZEOF_POINTER__)
133ADD_TEST_EQ(SHADOWFRAME_NUMBER_OF_VREGS_OFFSET,
134 static_cast<int32_t>(art::ShadowFrame::NumberOfVRegsOffset()))
135#define SHADOWFRAME_DEX_PC_OFFSET (SHADOWFRAME_NUMBER_OF_VREGS_OFFSET + 4)
136ADD_TEST_EQ(SHADOWFRAME_DEX_PC_OFFSET,
137 static_cast<int32_t>(art::ShadowFrame::DexPCOffset()))
Bill Buzbee1d011d92016-04-04 16:59:29 +0000138#define SHADOWFRAME_CACHED_HOTNESS_COUNTDOWN_OFFSET (SHADOWFRAME_NUMBER_OF_VREGS_OFFSET + 8)
139ADD_TEST_EQ(SHADOWFRAME_CACHED_HOTNESS_COUNTDOWN_OFFSET,
140 static_cast<int32_t>(art::ShadowFrame::CachedHotnessCountdownOffset()))
141#define SHADOWFRAME_HOTNESS_COUNTDOWN_OFFSET (SHADOWFRAME_NUMBER_OF_VREGS_OFFSET + 10)
142ADD_TEST_EQ(SHADOWFRAME_HOTNESS_COUNTDOWN_OFFSET,
143 static_cast<int32_t>(art::ShadowFrame::HotnessCountdownOffset()))
144#define SHADOWFRAME_VREGS_OFFSET (SHADOWFRAME_NUMBER_OF_VREGS_OFFSET + 12)
buzbee1452bee2015-03-06 14:43:04 -0800145ADD_TEST_EQ(SHADOWFRAME_VREGS_OFFSET,
146 static_cast<int32_t>(art::ShadowFrame::VRegsOffset()))
147
Hiroshi Yamauchi60f63f52015-04-23 16:12:40 -0700148#if defined(USE_BROOKS_READ_BARRIER)
Ian Rogers1d8cdbc2014-09-22 22:51:09 -0700149#define MIRROR_OBJECT_HEADER_SIZE 16
Hiroshi Yamauchi9d04a202014-01-31 13:35:49 -0800150#else
Ian Rogers1d8cdbc2014-09-22 22:51:09 -0700151#define MIRROR_OBJECT_HEADER_SIZE 8
152#endif
153ADD_TEST_EQ(size_t(MIRROR_OBJECT_HEADER_SIZE), sizeof(art::mirror::Object))
Hiroshi Yamauchi9d04a202014-01-31 13:35:49 -0800154
155// Offsets within java.lang.Class.
Neil Fuller3d0aa882016-08-16 19:53:07 +0100156#define MIRROR_CLASS_COMPONENT_TYPE_OFFSET (4 + MIRROR_OBJECT_HEADER_SIZE)
Ian Rogers1d8cdbc2014-09-22 22:51:09 -0700157ADD_TEST_EQ(MIRROR_CLASS_COMPONENT_TYPE_OFFSET,
158 art::mirror::Class::ComponentTypeOffset().Int32Value())
Alex Lightd6251582016-10-31 11:12:30 -0700159#define MIRROR_CLASS_IF_TABLE_OFFSET (16 + MIRROR_OBJECT_HEADER_SIZE)
Mathieu Chartier2ecfd272016-11-01 10:10:05 -0700160ADD_TEST_EQ(MIRROR_CLASS_IF_TABLE_OFFSET,
161 art::mirror::Class::IfTableOffset().Int32Value())
Nicolas Geoffrayf9bf2502016-12-14 14:59:04 +0000162#define MIRROR_CLASS_ACCESS_FLAGS_OFFSET (56 + MIRROR_OBJECT_HEADER_SIZE)
Hiroshi Yamauchie01a5202015-03-19 12:35:04 -0700163ADD_TEST_EQ(MIRROR_CLASS_ACCESS_FLAGS_OFFSET,
164 art::mirror::Class::AccessFlagsOffset().Int32Value())
Nicolas Geoffrayf9bf2502016-12-14 14:59:04 +0000165#define MIRROR_CLASS_OBJECT_SIZE_OFFSET (88 + MIRROR_OBJECT_HEADER_SIZE)
Hiroshi Yamauchie01a5202015-03-19 12:35:04 -0700166ADD_TEST_EQ(MIRROR_CLASS_OBJECT_SIZE_OFFSET,
167 art::mirror::Class::ObjectSizeOffset().Int32Value())
Nicolas Geoffrayf9bf2502016-12-14 14:59:04 +0000168#define MIRROR_CLASS_OBJECT_SIZE_ALLOC_FAST_PATH_OFFSET (92 + MIRROR_OBJECT_HEADER_SIZE)
Mathieu Chartier93bbee02016-08-31 09:38:40 -0700169ADD_TEST_EQ(MIRROR_CLASS_OBJECT_SIZE_ALLOC_FAST_PATH_OFFSET,
170 art::mirror::Class::ObjectSizeAllocFastPathOffset().Int32Value())
Nicolas Geoffrayf9bf2502016-12-14 14:59:04 +0000171#define MIRROR_CLASS_OBJECT_PRIMITIVE_TYPE_OFFSET (96 + MIRROR_OBJECT_HEADER_SIZE)
Mathieu Chartier8261d022016-08-08 09:41:04 -0700172ADD_TEST_EQ(MIRROR_CLASS_OBJECT_PRIMITIVE_TYPE_OFFSET,
173 art::mirror::Class::PrimitiveTypeOffset().Int32Value())
Nicolas Geoffrayf9bf2502016-12-14 14:59:04 +0000174#define MIRROR_CLASS_STATUS_OFFSET (104 + MIRROR_OBJECT_HEADER_SIZE)
Hiroshi Yamauchie01a5202015-03-19 12:35:04 -0700175ADD_TEST_EQ(MIRROR_CLASS_STATUS_OFFSET,
176 art::mirror::Class::StatusOffset().Int32Value())
177
Mathieu Chartier8261d022016-08-08 09:41:04 -0700178#define PRIMITIVE_TYPE_SIZE_SHIFT_SHIFT 16
179ADD_TEST_EQ(PRIMITIVE_TYPE_SIZE_SHIFT_SHIFT,
180 static_cast<int>(art::mirror::Class::kPrimitiveTypeSizeShiftShift))
181
Hiroshi Yamauchi9d04a202014-01-31 13:35:49 -0800182// Array offsets.
Ian Rogers1d8cdbc2014-09-22 22:51:09 -0700183#define MIRROR_ARRAY_LENGTH_OFFSET MIRROR_OBJECT_HEADER_SIZE
184ADD_TEST_EQ(MIRROR_ARRAY_LENGTH_OFFSET, art::mirror::Array::LengthOffset().Int32Value())
185
186#define MIRROR_CHAR_ARRAY_DATA_OFFSET (4 + MIRROR_OBJECT_HEADER_SIZE)
187ADD_TEST_EQ(MIRROR_CHAR_ARRAY_DATA_OFFSET,
188 art::mirror::Array::DataOffset(sizeof(uint16_t)).Int32Value())
189
buzbee1452bee2015-03-06 14:43:04 -0800190#define MIRROR_BOOLEAN_ARRAY_DATA_OFFSET MIRROR_CHAR_ARRAY_DATA_OFFSET
191ADD_TEST_EQ(MIRROR_BOOLEAN_ARRAY_DATA_OFFSET,
192 art::mirror::Array::DataOffset(sizeof(uint8_t)).Int32Value())
193
194#define MIRROR_BYTE_ARRAY_DATA_OFFSET MIRROR_CHAR_ARRAY_DATA_OFFSET
195ADD_TEST_EQ(MIRROR_BYTE_ARRAY_DATA_OFFSET,
196 art::mirror::Array::DataOffset(sizeof(int8_t)).Int32Value())
197
198#define MIRROR_SHORT_ARRAY_DATA_OFFSET MIRROR_CHAR_ARRAY_DATA_OFFSET
199ADD_TEST_EQ(MIRROR_SHORT_ARRAY_DATA_OFFSET,
200 art::mirror::Array::DataOffset(sizeof(int16_t)).Int32Value())
201
202#define MIRROR_INT_ARRAY_DATA_OFFSET MIRROR_CHAR_ARRAY_DATA_OFFSET
203ADD_TEST_EQ(MIRROR_INT_ARRAY_DATA_OFFSET,
204 art::mirror::Array::DataOffset(sizeof(int32_t)).Int32Value())
205
206#define MIRROR_WIDE_ARRAY_DATA_OFFSET (8 + MIRROR_OBJECT_HEADER_SIZE)
207ADD_TEST_EQ(MIRROR_WIDE_ARRAY_DATA_OFFSET,
208 art::mirror::Array::DataOffset(sizeof(uint64_t)).Int32Value())
209
Ian Rogers1d8cdbc2014-09-22 22:51:09 -0700210#define MIRROR_OBJECT_ARRAY_DATA_OFFSET (4 + MIRROR_OBJECT_HEADER_SIZE)
211ADD_TEST_EQ(MIRROR_OBJECT_ARRAY_DATA_OFFSET,
212 art::mirror::Array::DataOffset(
213 sizeof(art::mirror::HeapReference<art::mirror::Object>)).Int32Value())
Hiroshi Yamauchi9d04a202014-01-31 13:35:49 -0800214
Hiroshi Yamauchie01a5202015-03-19 12:35:04 -0700215#define MIRROR_OBJECT_ARRAY_COMPONENT_SIZE 4
216ADD_TEST_EQ(static_cast<size_t>(MIRROR_OBJECT_ARRAY_COMPONENT_SIZE),
217 sizeof(art::mirror::HeapReference<art::mirror::Object>))
218
Mathieu Chartiere401d142015-04-22 13:56:20 -0700219#define MIRROR_LONG_ARRAY_DATA_OFFSET (8 + MIRROR_OBJECT_HEADER_SIZE)
220ADD_TEST_EQ(MIRROR_LONG_ARRAY_DATA_OFFSET,
221 art::mirror::Array::DataOffset(sizeof(uint64_t)).Int32Value())
222
Hiroshi Yamauchi9d04a202014-01-31 13:35:49 -0800223// Offsets within java.lang.String.
Jeff Hao848f70a2014-01-15 13:49:50 -0800224#define MIRROR_STRING_COUNT_OFFSET MIRROR_OBJECT_HEADER_SIZE
Ian Rogers1d8cdbc2014-09-22 22:51:09 -0700225ADD_TEST_EQ(MIRROR_STRING_COUNT_OFFSET, art::mirror::String::CountOffset().Int32Value())
Hiroshi Yamauchi9d04a202014-01-31 13:35:49 -0800226
Jeff Hao848f70a2014-01-15 13:49:50 -0800227#define MIRROR_STRING_VALUE_OFFSET (8 + MIRROR_OBJECT_HEADER_SIZE)
228ADD_TEST_EQ(MIRROR_STRING_VALUE_OFFSET, art::mirror::String::ValueOffset().Int32Value())
Ian Rogers1d8cdbc2014-09-22 22:51:09 -0700229
jessicahandojo4877b792016-09-08 19:49:13 -0700230// String compression feature.
Vladimir Markobcf716f2017-02-23 10:43:09 +0000231#define STRING_COMPRESSION_FEATURE 1
jessicahandojo4877b792016-09-08 19:49:13 -0700232ADD_TEST_EQ(STRING_COMPRESSION_FEATURE, art::mirror::kUseStringCompression);
Bill Buzbee1d011d92016-04-04 16:59:29 +0000233
Andreas Gampeb2d18fa2017-06-06 20:46:10 -0700234#ifdef DEFINED_ADD_TEST_EQ
235#undef ADD_TEST_EQ
236#undef DEFINED_ADD_TEST_EQ
Hiroshi Yamauchi9d04a202014-01-31 13:35:49 -0800237#endif
238
Brian Carlstromfc0e3212013-07-17 14:40:12 -0700239#endif // ART_RUNTIME_ASM_SUPPORT_H_