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 | 800ac2d | 2014-04-02 17:32:54 -0700 | [diff] [blame] | 29 | // #define USE_BAKER_READ_BARRIER |
| 30 | // #define USE_BROOKS_READ_BARRIER |
Hiroshi Yamauchi | c23f0d8 | 2015-01-23 17:23:42 -0800 | [diff] [blame] | 31 | #define USE_TABLE_LOOKUP_READ_BARRIER |
| 32 | #endif |
Hiroshi Yamauchi | 800ac2d | 2014-04-02 17:32:54 -0700 | [diff] [blame] | 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) |
| 39 | #error "Only one of Baker or Brooks can be enabled at a time." |
| 40 | #endif |
| 41 | |
Hiroshi Yamauchi | ab08811 | 2014-07-14 13:00:14 -0700 | [diff] [blame] | 42 | // A placeholder marker to indicate places to add read barriers in the |
| 43 | // assembly code. This is a development time aid and to be removed |
| 44 | // after read barriers are added. |
| 45 | #define THIS_LOAD_REQUIRES_READ_BARRIER |
| 46 | |
Hiroshi Yamauchi | 800ac2d | 2014-04-02 17:32:54 -0700 | [diff] [blame] | 47 | #endif // ART_RUNTIME_READ_BARRIER_C_H_ |