Replace `gUseReadBarrier` with compiler option in compiler.
Leave a few `gUseReadBarrier` uses in JNI macro assemblers.
We shall deaal with these later.
Test: m test-art-host-gtest
Test: testrunner.py --host --optimizing
Test: run-gtests.sh
Test: testrunner.py --target --optimizing
Bug: 289805127
Change-Id: I9d2aa245cee4c650129f169a82beda7dc0dd6a35
diff --git a/compiler/driver/compiler_options.cc b/compiler/driver/compiler_options.cc
index d0770e9..e1245c7 100644
--- a/compiler/driver/compiler_options.cc
+++ b/compiler/driver/compiler_options.cc
@@ -52,6 +52,7 @@
image_type_(ImageType::kNone),
multi_image_(false),
compile_art_test_(false),
+ emit_read_barrier_(false),
baseline_(false),
debuggable_(false),
generate_debug_info_(kDefaultGenerateDebugInfo),
diff --git a/compiler/driver/compiler_options.h b/compiler/driver/compiler_options.h
index a5b3ae1..7369b61 100644
--- a/compiler/driver/compiler_options.h
+++ b/compiler/driver/compiler_options.h
@@ -150,6 +150,10 @@
return top_k_profile_threshold_;
}
+ bool EmitReadBarrier() const {
+ return emit_read_barrier_;
+ }
+
bool GetDebuggable() const {
return debuggable_;
}
@@ -421,6 +425,7 @@
ImageType image_type_;
bool multi_image_;
bool compile_art_test_;
+ bool emit_read_barrier_;
bool baseline_;
bool debuggable_;
bool generate_debug_info_;