diff options
Diffstat (limited to 'compiler/jni/quick')
-rw-r--r-- | compiler/jni/quick/jni_compiler.cc | 5 |
1 files changed, 3 insertions, 2 deletions
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<JNIMacroLabel> jclass_read_barrier_slow_path; std::unique_ptr<JNIMacroLabel> 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: |