1/*
2 * Copyright (C) 2014 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#ifndef ART_RUNTIME_READ_BARRIER_C_H_
18#define ART_RUNTIME_READ_BARRIER_C_H_
19
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
22// include globals.h.
23
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.
27
28#ifdef ART_USE_READ_BARRIER
29#define USE_BAKER_READ_BARRIER
30// #define USE_BROOKS_READ_BARRIER
31// #define USE_TABLE_LOOKUP_READ_BARRIER
32#endif
33
34#if defined(USE_BAKER_READ_BARRIER) || defined(USE_BROOKS_READ_BARRIER)
35#define USE_BAKER_OR_BROOKS_READ_BARRIER
36#endif
37
38#if defined(USE_BAKER_READ_BARRIER) || defined(USE_BROOKS_READ_BARRIER) || defined(USE_TABLE_LOOKUP_READ_BARRIER)
39#define USE_READ_BARRIER
40#endif
41
42#if defined(USE_BAKER_READ_BARRIER) && defined(USE_BROOKS_READ_BARRIER)
43#error "Only one of Baker or Brooks can be enabled at a time."
44#endif
45
46// A placeholder marker to indicate places to add read barriers in the
47// assembly code. This is a development time aid and to be removed
48// after read barriers are added.
49#define THIS_LOAD_REQUIRES_READ_BARRIER
50
51#endif  // ART_RUNTIME_READ_BARRIER_C_H_
52