Hiroshi Yamauchi | 800ac2d | 2014-04-02 17:32:54 -0700 | [diff] [blame] | 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 |
Hiroshi Yamauchi | 2cd334a | 2015-01-09 14:03:35 -0800 | [diff] [blame] | 25 | // Object.java (libcore) to enable baker, brooks (unimplemented), or |
| 26 | // table-lookup read barriers. |
Hiroshi Yamauchi | 800ac2d | 2014-04-02 17:32:54 -0700 | [diff] [blame] | 27 | |
Hiroshi Yamauchi | c23f0d8 | 2015-01-23 17:23:42 -0800 | [diff] [blame] | 28 | #ifdef ART_USE_READ_BARRIER |
Hiroshi Yamauchi | 2e28775 | 2015-10-02 13:41:34 -0700 | [diff] [blame] | 29 | #if ART_READ_BARRIER_TYPE_IS_BAKER |
Hiroshi Yamauchi | 8365a99 | 2015-04-27 17:58:51 -0700 | [diff] [blame] | 30 | #define USE_BAKER_READ_BARRIER |
Hiroshi Yamauchi | 2e28775 | 2015-10-02 13:41:34 -0700 | [diff] [blame] | 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 |
| 35 | #else |
| 36 | #error "ART read barrier type must be set" |
Hiroshi Yamauchi | c23f0d8 | 2015-01-23 17:23:42 -0800 | [diff] [blame] | 37 | #endif |
Hiroshi Yamauchi | 2e28775 | 2015-10-02 13:41:34 -0700 | [diff] [blame] | 38 | #endif // ART_USE_READ_BARRIER |
Hiroshi Yamauchi | 800ac2d | 2014-04-02 17:32:54 -0700 | [diff] [blame] | 39 | |
Hiroshi Yamauchi | bfa5eb6 | 2015-05-29 15:04:41 -0700 | [diff] [blame] | 40 | #ifdef ART_HEAP_POISONING |
| 41 | #define USE_HEAP_POISONING |
| 42 | #endif |
| 43 | |
Hiroshi Yamauchi | 800ac2d | 2014-04-02 17:32:54 -0700 | [diff] [blame] | 44 | #if defined(USE_BAKER_READ_BARRIER) || defined(USE_BROOKS_READ_BARRIER) |
| 45 | #define USE_BAKER_OR_BROOKS_READ_BARRIER |
| 46 | #endif |
| 47 | |
Hiroshi Yamauchi | e15ea08 | 2015-02-09 17:11:42 -0800 | [diff] [blame] | 48 | #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 Yamauchi | 800ac2d | 2014-04-02 17:32:54 -0700 | [diff] [blame] | 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." |
| 54 | #endif |
| 55 | |
Hiroshi Yamauchi | 800ac2d | 2014-04-02 17:32:54 -0700 | [diff] [blame] | 56 | #endif // ART_RUNTIME_READ_BARRIER_C_H_ |