blob: 1d5ce7dd49e49d6a75ed99904b30c3bfd5f932c9 [file] [log] [blame]
Igor Murashkin311fdf52016-07-22 15:59:16 -07001/*
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 Gampe8228cdf2017-05-30 15:03:54 -070020#include "base/callee_save_type.h" // art::CalleeSaveType
21#include "runtime.h" // art::Runtime
Igor Murashkin311fdf52016-07-22 15:59:16 -070022#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 Gampe8228cdf2017-05-30 15:03:54 -070029 DEFINE_OFFSET_EXPR(Runtime, \
30 field_name ## _METHOD, \
31 size_t, \
32 art::Runtime::GetCalleeSaveMethodOffset(constant_name))
Igor Murashkin311fdf52016-07-22 15:59:16 -070033
34 // Macro substring Constant name
Vladimir Markofd36f1f2016-08-03 18:49:58 +010035// Offset of field Runtime::callee_save_methods_[kSaveAllCalleeSaves]
Andreas Gampe8228cdf2017-05-30 15:03:54 -070036DEFINE_RUNTIME_CALLEE_SAVE_OFFSET(SAVE_ALL_CALLEE_SAVES, art::CalleeSaveType::kSaveAllCalleeSaves)
Vladimir Markofd36f1f2016-08-03 18:49:58 +010037// Offset of field Runtime::callee_save_methods_[kSaveRefsOnly]
Andreas Gampe8228cdf2017-05-30 15:03:54 -070038DEFINE_RUNTIME_CALLEE_SAVE_OFFSET(SAVE_REFS_ONLY, art::CalleeSaveType::kSaveRefsOnly)
Vladimir Markofd36f1f2016-08-03 18:49:58 +010039// Offset of field Runtime::callee_save_methods_[kSaveRefsAndArgs]
Andreas Gampe8228cdf2017-05-30 15:03:54 -070040DEFINE_RUNTIME_CALLEE_SAVE_OFFSET(SAVE_REFS_AND_ARGS, art::CalleeSaveType::kSaveRefsAndArgs)
Vladimir Marko952dbb12016-07-28 12:01:51 +010041// Offset of field Runtime::callee_save_methods_[kSaveEverything]
Andreas Gampe8228cdf2017-05-30 15:03:54 -070042DEFINE_RUNTIME_CALLEE_SAVE_OFFSET(SAVE_EVERYTHING, art::CalleeSaveType::kSaveEverything)
Mingyao Yang0a87a652017-04-12 13:43:15 -070043// Offset of field Runtime::callee_save_methods_[kSaveEverythingForClinit]
44DEFINE_RUNTIME_CALLEE_SAVE_OFFSET(SAVE_EVERYTHING_FOR_CLINIT, art::CalleeSaveType::kSaveEverythingForClinit)
45// Offset of field Runtime::callee_save_methods_[kSaveEverythingForSuspendCheck]
46DEFINE_RUNTIME_CALLEE_SAVE_OFFSET(SAVE_EVERYTHING_FOR_SUSPEND_CHECK, art::CalleeSaveType::kSaveEverythingForSuspendCheck)
Igor Murashkin311fdf52016-07-22 15:59:16 -070047
48#undef DEFINE_RUNTIME_CALLEE_SAVE_OFFSET
49#include "common_undef.def" // undef DEFINE_OFFSET_EXPR