Igor Murashkin | 311fdf5 | 2016-07-22 15:59:16 -0700 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2016 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 | // Offsets within ShadowFrame. |
| 18 | |
| 19 | #if defined(DEFINE_INCLUDE_DEPENDENCIES) |
Andreas Gampe | 542451c | 2016-07-26 09:02:02 -0700 | [diff] [blame] | 20 | #include "base/enums.h" // PointerSize |
Igor Murashkin | 311fdf5 | 2016-07-22 15:59:16 -0700 | [diff] [blame] | 21 | #include "stack.h" // art::ShadowFrame |
| 22 | #endif |
| 23 | |
| 24 | #include "common.def" // DEFINE_OFFSET_EXPR |
| 25 | |
| 26 | #define DEFINE_THREAD_OFFSET(field_name, method_name) \ |
Andreas Gampe | 542451c | 2016-07-26 09:02:02 -0700 | [diff] [blame] | 27 | DEFINE_OFFSET_EXPR(Thread, field_name, int32_t, art::Thread::method_name##Offset<art::kRuntimePointerSize>().Int32Value()) |
Igor Murashkin | 311fdf5 | 2016-07-22 15:59:16 -0700 | [diff] [blame] | 28 | |
| 29 | // New macro suffix Method Name (of the Offset method) |
| 30 | DEFINE_THREAD_OFFSET(FLAGS, ThreadFlags) |
| 31 | DEFINE_THREAD_OFFSET(ID, ThinLockId) |
| 32 | DEFINE_THREAD_OFFSET(IS_GC_MARKING, IsGcMarking) |
| 33 | DEFINE_THREAD_OFFSET(CARD_TABLE, CardTable) |
| 34 | |
| 35 | // TODO: The rest of the offsets |
| 36 | // are dependent on __SIZEOF_POINTER__ |
| 37 | |
| 38 | #undef DEFINE_THREAD_OFFSET |
| 39 | |
| 40 | #include "common_undef.def" // undef DEFINE_OFFSET_EXPR |