From 28f6cff854b61e39f953e69ebf3646ee9826ec82 Mon Sep 17 00:00:00 2001
From: David Srbecky <dsrbecky@google.com>
Date: Tue, 16 Oct 2018 15:07:28 +0100
Subject: Cache the value of MterpShouldSwitchInterpreters()

Add field to the Thread object which stores the value instead (negated).
Explicitly update the field when relevant state changes (which is rare).

This speeds up golem interpreter benchmarks by 3.5%
on average with some benchmarks up to 15% faster.

Test: test.py -b -r --interpreter --host
Change-Id: If2df0d3bf9e69ab50c30102b2648e997927c34d8
---
 tools/cpp-define-generator/thread.def | 2 ++
 1 file changed, 2 insertions(+)

(limited to 'tools/cpp-define-generator/thread.def')

diff --git a/tools/cpp-define-generator/thread.def b/tools/cpp-define-generator/thread.def
index 7b19076828..8c91dc8a87 100644
--- a/tools/cpp-define-generator/thread.def
+++ b/tools/cpp-define-generator/thread.def
@@ -56,5 +56,7 @@ ASM_DEFINE(THREAD_SUSPEND_OR_CHECKPOINT_REQUEST,
            art::kSuspendRequest | art::kCheckpointRequest | art::kEmptyCheckpointRequest)
 ASM_DEFINE(THREAD_SUSPEND_REQUEST,
            art::kSuspendRequest)
+ASM_DEFINE(THREAD_USE_MTERP_OFFSET,
+           art::Thread::UseMterpOffset<art::kRuntimePointerSize>().Int32Value())
 ASM_DEFINE(THREAD_TOP_QUICK_FRAME_OFFSET,
            art::Thread::TopOfManagedStackOffset<art::kRuntimePointerSize>().Int32Value())
-- 
cgit v1.2.3-59-g8ed1b

