From 43c9cd7938a53265ea9899a604b409ce070cc2c5 Mon Sep 17 00:00:00 2001
From: Nicolas Geoffray <ngeoffray@google.com>
Date: Wed, 10 Mar 2021 15:09:19 +0000
Subject: Improve nterp -> compiled code transitions.

Use an unused bit in the access flags of an ArtMethod (0x00200000) to store
the information a method only takes ints or references and returns an
int, a reference, or a long. This avoids the need to fetch the shorty in nterp
when doing a call.

Test: test.py
Test: 821-many-args
Bug: 112676029

Change-Id: Ie657ccf69c17c1097dc2a97f18e3093ef3be391b
---
 tools/cpp-define-generator/art_method.def | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)

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

diff --git a/tools/cpp-define-generator/art_method.def b/tools/cpp-define-generator/art_method.def
index 5e09565df1..a73bbedc8a 100644
--- a/tools/cpp-define-generator/art_method.def
+++ b/tools/cpp-define-generator/art_method.def
@@ -23,14 +23,18 @@ ASM_DEFINE(ART_METHOD_ACCESS_FLAGS_OFFSET,
            art::ArtMethod::AccessFlagsOffset().Int32Value())
 ASM_DEFINE(ART_METHOD_IS_STATIC_FLAG,
            art::kAccStatic)
-ASM_DEFINE(ART_METHOD_NTERP_ENTRY_POINT_FAST_PATH_FLAG,
-           art::kAccNterpEntryPointFastPathFlag)
-ASM_DEFINE(ART_METHOD_IMT_MASK,
-           art::ImTable::kSizeTruncToPowerOfTwo - 1)
 ASM_DEFINE(ART_METHOD_IS_STATIC_FLAG_BIT,
            art::MostSignificantBit(art::kAccStatic))
+ASM_DEFINE(ART_METHOD_NTERP_INVOKE_FAST_PATH_FLAG,
+           art::kAccNterpInvokeFastPathFlag)
+ASM_DEFINE(ART_METHOD_NTERP_INVOKE_FAST_PATH_FLAG_BIT,
+           art::MostSignificantBit(art::kAccNterpInvokeFastPathFlag))
+ASM_DEFINE(ART_METHOD_NTERP_ENTRY_POINT_FAST_PATH_FLAG,
+           art::kAccNterpEntryPointFastPathFlag)
 ASM_DEFINE(ART_METHOD_NTERP_ENTRY_POINT_FAST_PATH_FLAG_BIT,
            art::MostSignificantBit(art::kAccNterpEntryPointFastPathFlag))
+ASM_DEFINE(ART_METHOD_IMT_MASK,
+           art::ImTable::kSizeTruncToPowerOfTwo - 1)
 ASM_DEFINE(ART_METHOD_DECLARING_CLASS_OFFSET,
            art::ArtMethod::DeclaringClassOffset().Int32Value())
 ASM_DEFINE(ART_METHOD_JNI_OFFSET_32,
-- 
cgit v1.2.3-59-g8ed1b

