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 | 8228cdf | 2017-05-30 15:03:54 -0700 | [diff] [blame] | 20 | #include "base/callee_save_type.h" // art::CalleeSaveType |
| 21 | #include "runtime.h" // art::Runtime |
Igor Murashkin | 311fdf5 | 2016-07-22 15:59:16 -0700 | [diff] [blame] | 22 | #endif |
| 23 | |
| 24 | #include "common.def" // DEFINE_OFFSET_EXPR |
| 25 | |
| 26 | // Note: these callee save methods loads require read barriers. |
| 27 | |
| 28 | #define DEFINE_RUNTIME_CALLEE_SAVE_OFFSET(field_name, constant_name) \ |
Andreas Gampe | 8228cdf | 2017-05-30 15:03:54 -0700 | [diff] [blame] | 29 | DEFINE_OFFSET_EXPR(Runtime, \ |
| 30 | field_name ## _METHOD, \ |
| 31 | size_t, \ |
| 32 | art::Runtime::GetCalleeSaveMethodOffset(constant_name)) |
Igor Murashkin | 311fdf5 | 2016-07-22 15:59:16 -0700 | [diff] [blame] | 33 | |
| 34 | // Macro substring Constant name |
Vladimir Marko | fd36f1f | 2016-08-03 18:49:58 +0100 | [diff] [blame] | 35 | // Offset of field Runtime::callee_save_methods_[kSaveAllCalleeSaves] |
Andreas Gampe | 8228cdf | 2017-05-30 15:03:54 -0700 | [diff] [blame] | 36 | DEFINE_RUNTIME_CALLEE_SAVE_OFFSET(SAVE_ALL_CALLEE_SAVES, art::CalleeSaveType::kSaveAllCalleeSaves) |
Vladimir Marko | fd36f1f | 2016-08-03 18:49:58 +0100 | [diff] [blame] | 37 | // Offset of field Runtime::callee_save_methods_[kSaveRefsOnly] |
Andreas Gampe | 8228cdf | 2017-05-30 15:03:54 -0700 | [diff] [blame] | 38 | DEFINE_RUNTIME_CALLEE_SAVE_OFFSET(SAVE_REFS_ONLY, art::CalleeSaveType::kSaveRefsOnly) |
Vladimir Marko | fd36f1f | 2016-08-03 18:49:58 +0100 | [diff] [blame] | 39 | // Offset of field Runtime::callee_save_methods_[kSaveRefsAndArgs] |
Andreas Gampe | 8228cdf | 2017-05-30 15:03:54 -0700 | [diff] [blame] | 40 | DEFINE_RUNTIME_CALLEE_SAVE_OFFSET(SAVE_REFS_AND_ARGS, art::CalleeSaveType::kSaveRefsAndArgs) |
Vladimir Marko | 952dbb1 | 2016-07-28 12:01:51 +0100 | [diff] [blame] | 41 | // Offset of field Runtime::callee_save_methods_[kSaveEverything] |
Andreas Gampe | 8228cdf | 2017-05-30 15:03:54 -0700 | [diff] [blame] | 42 | DEFINE_RUNTIME_CALLEE_SAVE_OFFSET(SAVE_EVERYTHING, art::CalleeSaveType::kSaveEverything) |
Mingyao Yang | 0a87a65 | 2017-04-12 13:43:15 -0700 | [diff] [blame] | 43 | // Offset of field Runtime::callee_save_methods_[kSaveEverythingForClinit] |
| 44 | DEFINE_RUNTIME_CALLEE_SAVE_OFFSET(SAVE_EVERYTHING_FOR_CLINIT, art::CalleeSaveType::kSaveEverythingForClinit) |
| 45 | // Offset of field Runtime::callee_save_methods_[kSaveEverythingForSuspendCheck] |
| 46 | DEFINE_RUNTIME_CALLEE_SAVE_OFFSET(SAVE_EVERYTHING_FOR_SUSPEND_CHECK, art::CalleeSaveType::kSaveEverythingForSuspendCheck) |
Igor Murashkin | 311fdf5 | 2016-07-22 15:59:16 -0700 | [diff] [blame] | 47 | |
| 48 | #undef DEFINE_RUNTIME_CALLEE_SAVE_OFFSET |
| 49 | #include "common_undef.def" // undef DEFINE_OFFSET_EXPR |