From bb68fda18ef3d7ea183a322831a5afd20b6a8bff Mon Sep 17 00:00:00 2001 From: Alex Light Date: Mon, 1 Oct 2018 13:21:47 -0700 Subject: Move InterpreterCache to right below tlsPtr_ Change the position of the InterpreterCache field in Thread to be directly below the tlsPtr_ field. Since both members of the tlsPtr_ and InterpreterCache fields are used by asm_code we need their offsets in asm_support.h. The fields at the end of the Thread struct have been undergoing changes. By moving this field up we avoid the need to update asm_support.h whenever one of the fields is modified. Test: ./test.py --host Change-Id: Ic2863116ed446af155badfc3bf098add7ba0b699 --- runtime/thread.h | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'runtime/thread.h') diff --git a/runtime/thread.h b/runtime/thread.h index 3c85b80976..aaf6bae36f 100644 --- a/runtime/thread.h +++ b/runtime/thread.h @@ -1783,6 +1783,14 @@ class Thread { mirror::Throwable* async_exception; } tlsPtr_; + // Small thread-local cache to be used from the interpreter. + // It is keyed by dex instruction pointer. + // The value is opcode-depended (e.g. field offset). + InterpreterCache interpreter_cache_; + + // All fields below this line should not be accessed by native code. This means these fields can + // be modified, rearranged, added or removed without having to modify asm_support.h + // Guards the 'wait_monitor_' members. Mutex* wait_mutex_ DEFAULT_MUTEX_ACQUIRED_AFTER; @@ -1812,11 +1820,6 @@ class Thread { // be false for threads where '!can_call_into_java_'. bool can_be_suspended_by_user_code_; - // Small thread-local cache to be used from the interpreter. - // It is keyed by dex instruction pointer. - // The value is opcode-depended (e.g. field offset). - InterpreterCache interpreter_cache_; - friend class Dbg; // For SetStateUnsafe. friend class gc::collector::SemiSpace; // For getting stack traces. friend class Runtime; // For CreatePeer. -- cgit v1.2.3