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 "entrypoints/quick/quick_entrypoints_enum.h" 19#include "thread.h" 20#include "trace_profile.h" 21#endif 22 23ASM_DEFINE(THREAD_CARD_TABLE_OFFSET, 24 art::Thread::CardTableOffset<art::kRuntimePointerSize>().Int32Value()) 25ASM_DEFINE(THREAD_EXCEPTION_OFFSET, 26 art::Thread::ExceptionOffset<art::kRuntimePointerSize>().Int32Value()) 27ASM_DEFINE(THREAD_FLAGS_OFFSET, 28 art::Thread::ThreadFlagsOffset<art::kRuntimePointerSize>().Int32Value()) 29ASM_DEFINE(THREAD_ID_OFFSET, 30 art::Thread::ThinLockIdOffset<art::kRuntimePointerSize>().Int32Value()) 31ASM_DEFINE(THREAD_INTERPRETER_CACHE_OFFSET, 32 art::Thread::InterpreterCacheOffset<art::kRuntimePointerSize>().Int32Value()) 33ASM_DEFINE(THREAD_INTERPRETER_CACHE_SIZE_LOG2, 34 art::Thread::InterpreterCacheSizeLog2()) 35ASM_DEFINE(THREAD_INTERPRETER_CACHE_SIZE_MASK, 36 (sizeof(art::InterpreterCache::Entry) * (art::InterpreterCache::kSize - 1))) 37ASM_DEFINE(THREAD_INTERPRETER_CACHE_SIZE_SHIFT, 38 (art::WhichPowerOf2(sizeof(art::InterpreterCache::Entry)) - 2)) 39ASM_DEFINE(THREAD_IS_GC_MARKING_OFFSET, 40 art::Thread::IsGcMarkingOffset<art::kRuntimePointerSize>().Int32Value()) 41ASM_DEFINE(THREAD_DEOPT_CHECK_REQUIRED_OFFSET, 42 art::Thread::DeoptCheckRequiredOffset<art::kRuntimePointerSize>().Int32Value()) 43ASM_DEFINE(THREAD_LOCAL_ALLOC_STACK_END_OFFSET, 44 art::Thread::ThreadLocalAllocStackEndOffset<art::kRuntimePointerSize>().Int32Value()) 45ASM_DEFINE(THREAD_LOCAL_ALLOC_STACK_TOP_OFFSET, 46 art::Thread::ThreadLocalAllocStackTopOffset<art::kRuntimePointerSize>().Int32Value()) 47ASM_DEFINE(THREAD_LOCAL_END_OFFSET, 48 art::Thread::ThreadLocalEndOffset<art::kRuntimePointerSize>().Int32Value()) 49ASM_DEFINE(THREAD_LOCAL_POS_OFFSET, 50 art::Thread::ThreadLocalPosOffset<art::kRuntimePointerSize>().Int32Value()) 51ASM_DEFINE(THREAD_ROSALLOC_RUNS_OFFSET, 52 art::Thread::RosAllocRunsOffset<art::kRuntimePointerSize>().Int32Value()) 53ASM_DEFINE(THREAD_SELF_OFFSET, 54 art::Thread::SelfOffset<art::kRuntimePointerSize>().Int32Value()) 55ASM_DEFINE(THREAD_SUSPEND_OR_CHECKPOINT_REQUEST, 56 art::Thread::SuspendOrCheckpointRequestFlags()) 57ASM_DEFINE(THREAD_SUSPEND_REQUEST, 58 static_cast<uint32_t>(art::ThreadFlag::kSuspendRequest)) 59ASM_DEFINE(THREAD_TOP_QUICK_FRAME_OFFSET, 60 art::Thread::TopOfManagedStackOffset<art::kRuntimePointerSize>().Int32Value()) 61ASM_DEFINE(THREAD_SUSPEND_TRIGGER_OFFSET, 62 art::Thread::ThreadSuspendTriggerOffset<art::kRuntimePointerSize>().Int32Value()) 63ASM_DEFINE(THREAD_ALLOC_OBJECT_ENTRYPOINT_OFFSET, 64 art::GetThreadOffset<art::kRuntimePointerSize>(art::kQuickAllocObjectInitialized) 65 .Int32Value()) 66ASM_DEFINE(THREAD_ALLOC_ARRAY_ENTRYPOINT_OFFSET, 67 art::GetThreadOffset<art::kRuntimePointerSize>(art::kQuickAllocArrayResolved) 68 .Int32Value()) 69ASM_DEFINE(THREAD_READ_BARRIER_MARK_REG00_OFFSET, 70 art::Thread::ReadBarrierMarkEntryPointsOffset<art::kRuntimePointerSize>(0)) 71ASM_DEFINE(THREAD_SHARED_METHOD_HOTNESS_OFFSET, 72 art::Thread::SharedMethodHotnessOffset<art::kRuntimePointerSize>().Int32Value()) 73ASM_DEFINE(THREAD_TID_OFFSET, 74 art::Thread::TidOffset<art::kRuntimePointerSize>().Int32Value()) 75ASM_DEFINE(TRACE_BUFFER_INIT_OFFSET, 76 art::Thread::TraceBufferPtrOffset<art::kRuntimePointerSize>().Int32Value()) 77ASM_DEFINE(TRACE_BUFFER_CURRENT_OFFSET, 78 art::Thread::TraceBufferCurrPtrOffset<art::kRuntimePointerSize>().Int32Value()) 79ASM_DEFINE(TRACE_BUFFER_SIZE, (art::kAlwaysOnTraceBufSize - 1) * sizeof(uintptr_t)) 80