From fe7f7aa33d085ed3097ab499277c63aafdfd0e5c Mon Sep 17 00:00:00 2001 From: Vladimir Marko Date: Fri, 27 Oct 2023 11:05:27 +0200 Subject: 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 --- compiler/jni/quick/jni_compiler.cc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'compiler/jni/quick') diff --git a/compiler/jni/quick/jni_compiler.cc b/compiler/jni/quick/jni_compiler.cc index 9349d2c9fd..b125d2ef7c 100644 --- a/compiler/jni/quick/jni_compiler.cc +++ b/compiler/jni/quick/jni_compiler.cc @@ -109,6 +109,7 @@ static JniCompiledMethod ArtJniCompileMethodInternal(const CompilerOptions& comp // i.e. if the method was annotated with @CriticalNative const bool is_critical_native = (access_flags & kAccCriticalNative) != 0u; + bool emit_read_barrier = compiler_options.EmitReadBarrier(); bool is_debuggable = compiler_options.GetDebuggable(); bool needs_entry_exit_hooks = is_debuggable && compiler_options.IsJitCompiler(); // We don't support JITing stubs for critical native methods in debuggable runtimes yet. @@ -208,7 +209,7 @@ static JniCompiledMethod ArtJniCompileMethodInternal(const CompilerOptions& comp // Skip this for @CriticalNative because we're not passing a `jclass` to the native method. std::unique_ptr jclass_read_barrier_slow_path; std::unique_ptr jclass_read_barrier_return; - if (gUseReadBarrier && is_static && LIKELY(!is_critical_native)) { + if (emit_read_barrier && is_static && LIKELY(!is_critical_native)) { jclass_read_barrier_slow_path = __ CreateLabel(); jclass_read_barrier_return = __ CreateLabel(); @@ -601,7 +602,7 @@ static JniCompiledMethod ArtJniCompileMethodInternal(const CompilerOptions& comp // 8.1. Read barrier slow path for the declaring class in the method for a static call. // Skip this for @CriticalNative because we're not passing a `jclass` to the native method. - if (gUseReadBarrier && is_static && !is_critical_native) { + if (emit_read_barrier && is_static && !is_critical_native) { __ Bind(jclass_read_barrier_slow_path.get()); // Construct slow path for read barrier: -- cgit v1.2.3-59-g8ed1b