From d109e30eab8ba25f8d89be2a83d9036e2d541af2 Mon Sep 17 00:00:00 2001 From: Alex Light Date: Wed, 27 Jun 2018 10:25:41 -0700 Subject: Don't use StringFactory.newEmptyString in compiled code When compiling debuggable code we would compile a new-instance String instruction into a StringFactory.newEmptyString invoke. This additional invoke could be observed using tracing and is inconsistent with the interpreter, where the string is simply allocated directly. In order to bring these two modes into alignment we added a new AllocStringObject quick entrypoint that will be used instead of the normal AllocObject<...> entrypoints when allocating a string. This entrypoint directly allocates a new string in the same manner the interpreter does. Needs next CL for test to work. Bug: 110884646 Test: ./test/testrunner/testrunner.py --host --runtime-option=-Xjitthreshold:0 --jit Test: Manual inspection of compiled code. Change-Id: I7b4b084bcf7dd9a23485c0e3cd2cd04a04b43d3d --- compiler/optimizing/nodes.cc | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'compiler/optimizing/nodes.cc') diff --git a/compiler/optimizing/nodes.cc b/compiler/optimizing/nodes.cc index d243331dbe..50ce7559f5 100644 --- a/compiler/optimizing/nodes.cc +++ b/compiler/optimizing/nodes.cc @@ -2892,8 +2892,7 @@ void HInvoke::SetIntrinsic(Intrinsics intrinsic, } bool HNewInstance::IsStringAlloc() const { - ScopedObjectAccess soa(Thread::Current()); - return GetReferenceTypeInfo().IsStringClass(); + return GetEntrypoint() == kQuickAllocStringObject; } bool HInvoke::NeedsEnvironment() const { -- cgit v1.2.3-59-g8ed1b