blob: 8e5b1872f25b80663ed72e24298a669b225730c1 [file] [log] [blame]
Hiroshi Yamauchi800ac2d2014-04-02 17:32:54 -07001/*
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
Hiroshi Yamauchi2cd334a2015-01-09 14:03:35 -080025// Object.java (libcore) to enable baker, brooks (unimplemented), or
26// table-lookup read barriers.
Hiroshi Yamauchi800ac2d2014-04-02 17:32:54 -070027
Hiroshi Yamauchic23f0d82015-01-23 17:23:42 -080028#ifdef ART_USE_READ_BARRIER
Hiroshi Yamauchi2e287752015-10-02 13:41:34 -070029#if ART_READ_BARRIER_TYPE_IS_BAKER
Hiroshi Yamauchi8365a992015-04-27 17:58:51 -070030#define USE_BAKER_READ_BARRIER
Hiroshi Yamauchi2e287752015-10-02 13:41:34 -070031#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
35#else
36#error "ART read barrier type must be set"
Hiroshi Yamauchic23f0d82015-01-23 17:23:42 -080037#endif
Hiroshi Yamauchi2e287752015-10-02 13:41:34 -070038#endif // ART_USE_READ_BARRIER
Hiroshi Yamauchi800ac2d2014-04-02 17:32:54 -070039
Hiroshi Yamauchibfa5eb62015-05-29 15:04:41 -070040#ifdef ART_HEAP_POISONING
41#define USE_HEAP_POISONING
42#endif
43
Hiroshi Yamauchi800ac2d2014-04-02 17:32:54 -070044#if defined(USE_BAKER_READ_BARRIER) || defined(USE_BROOKS_READ_BARRIER)
45#define USE_BAKER_OR_BROOKS_READ_BARRIER
46#endif
47
Hiroshi Yamauchie15ea082015-02-09 17:11:42 -080048#if defined(USE_BAKER_READ_BARRIER) || defined(USE_BROOKS_READ_BARRIER) || defined(USE_TABLE_LOOKUP_READ_BARRIER)
49#define USE_READ_BARRIER
50#endif
51
Hiroshi Yamauchi800ac2d2014-04-02 17:32:54 -070052#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."
54#endif
55
Hiroshi Yamauchi800ac2d2014-04-02 17:32:54 -070056#endif // ART_RUNTIME_READ_BARRIER_C_H_