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 #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 35 #else 36 #error "ART read barrier type must be set" 37 #endif 38 #endif // ART_USE_READ_BARRIER 39 40 #ifdef ART_HEAP_POISONING 41 #define USE_HEAP_POISONING 42 #endif 43 44 #if defined(USE_BAKER_READ_BARRIER) || defined(USE_BROOKS_READ_BARRIER) 45 #define USE_BAKER_OR_BROOKS_READ_BARRIER 46 #endif 47 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 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 56 #endif // ART_RUNTIME_READ_BARRIER_C_H_ 57