diff options
author | Sebastien Hertz <shertz@google.com> | 2013-09-09 18:26:48 +0200 |
---|---|---|
committer | Sebastien Hertz <shertz@google.com> | 2013-09-09 20:42:21 +0200 |
commit | 043036f67fa37b3cfa3b05c41e5a824058730378 (patch) | |
tree | c3969fac77984ae17f11c284c757ef929693509b /runtime/interpreter/interpreter_goto_table_impl.cc | |
parent | 1eda2268e84d384256814cb6c2ba2440a848f9ed (diff) | |
download | art-043036f67fa37b3cfa3b05c41e5a824058730378.zip art-043036f67fa37b3cfa3b05c41e5a824058730378.tar.gz art-043036f67fa37b3cfa3b05c41e5a824058730378.tar.bz2 |
Add missing memory barrier.
When DEX-to-DEX compiler is not run onto a method (because it's not preverified
at the time of compilation), we do not replace RETURN where a barrier is needed
into RETURN_VOID_BARRIER.
This CL fixes this by placing a barrier on RETURN instruction only when the
checks are enabled (non-preverified method).
Change-Id: I4eb4cf79bb4a74684579c578318e27f62f4d9e8a
Diffstat (limited to 'runtime/interpreter/interpreter_goto_table_impl.cc')
-rw-r--r-- | runtime/interpreter/interpreter_goto_table_impl.cc | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/runtime/interpreter/interpreter_goto_table_impl.cc b/runtime/interpreter/interpreter_goto_table_impl.cc index 67517ea..10c50f3 100644 --- a/runtime/interpreter/interpreter_goto_table_impl.cc +++ b/runtime/interpreter/interpreter_goto_table_impl.cc @@ -197,6 +197,12 @@ JValue ExecuteGotoImpl(Thread* self, MethodHelper& mh, const DexFile::CodeItem* HANDLE_INSTRUCTION_START(RETURN_VOID) { JValue result; + if (do_access_check) { + // If access checks are required then the dex-to-dex compiler and analysis of + // whether the class has final fields hasn't been performed. Conservatively + // perform the memory barrier now. + ANDROID_MEMBAR_STORE(); + } if (UNLIKELY(self->TestAllFlags())) { CheckSuspend(self); } |