2 * Copyright (C) 2014 The Android Open Source Project
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
8 * http://www.apache.org/licenses/LICENSE-2.0
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.
17 #ifndef ART_RUNTIME_READ_BARRIER_C_H_
18 #define ART_RUNTIME_READ_BARRIER_C_H_
20 // This is a C (not C++) header file and is in a separate file (from
21 // globals.h) because asm_support.h is a C header file and can't
24 // Uncomment one of the following two and the two fields in
25 // Object.java (libcore) to enable baker, brooks (unimplemented), or
26 // table-lookup read barriers.
28 #ifdef ART_USE_READ_BARRIER
29 #if ART_READ_BARRIER_TYPE_IS_BAKER
30 #define USE_BAKER_READ_BARRIER
31 #elif ART_READ_BARRIER_TYPE_IS_BROOKS
32 #define USE_BROOKS_READ_BARRIER
33 #elif ART_READ_BARRIER_TYPE_IS_TABLELOOKUP
34 #define USE_TABLE_LOOKUP_READ_BARRIER
36 #error "ART read barrier type must be set"
38 #endif // ART_USE_READ_BARRIER
40 #ifdef ART_HEAP_POISONING
41 #define USE_HEAP_POISONING
44 #if defined(USE_BAKER_READ_BARRIER) || defined(USE_BROOKS_READ_BARRIER)
45 #define USE_BAKER_OR_BROOKS_READ_BARRIER
48 #if defined(USE_BAKER_READ_BARRIER) || defined(USE_BROOKS_READ_BARRIER) || defined(USE_TABLE_LOOKUP_READ_BARRIER)
49 #define USE_READ_BARRIER
52 #if defined(USE_BAKER_READ_BARRIER) && defined(USE_BROOKS_READ_BARRIER)
53 #error "Only one of Baker or Brooks can be enabled at a time."
56 #endif // ART_RUNTIME_READ_BARRIER_C_H_