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#if defined(DEFINE_INCLUDE_DEPENDENCIES) 18#include "mirror/class.h" // kStatusInitialized 19#include "modifiers.h" // kAccClassIsFinalizable 20#include "base/bit_utils.h" // MostSignificantBit 21#endif 22 23#define DEFINE_FLAG_OFFSET(type_name, field_name, expr) \ 24 DEFINE_EXPR(type_name ## _ ## field_name, uint32_t, (expr)) 25 26DEFINE_FLAG_OFFSET(MIRROR_CLASS, STATUS_INITIALIZED, art::mirror::Class::kStatusInitialized) 27DEFINE_FLAG_OFFSET(ACCESS_FLAGS, CLASS_IS_FINALIZABLE, art::kAccClassIsFinalizable) 28DEFINE_FLAG_OFFSET(ACCESS_FLAGS, CLASS_IS_INTERFACE, art::kAccInterface) 29// TODO: We should really have a BitPosition which also checks it's a power of 2. 30DEFINE_FLAG_OFFSET(ACCESS_FLAGS, CLASS_IS_FINALIZABLE_BIT, art::MostSignificantBit(art::kAccClassIsFinalizable)) 31 32#undef DEFINE_FLAG_OFFSET 33