summaryrefslogtreecommitdiffstats
path: root/runtime/interpreter/interpreter.cc
diff options
context:
space:
mode:
authorHiroshi Yamauchi <yamauchi@google.com>2013-08-21 11:54:09 -0700
committerHiroshi Yamauchi <yamauchi@google.com>2013-08-23 11:46:35 -0700
commit89502fc63d5d2ef3586e49b1ec38e1777ce7accf (patch)
treebdd0ca91f0dac742b2814ae60c4a4e1d3322fb86 /runtime/interpreter/interpreter.cc
parent2213ac60891aae4a05232663182bcb75137c7623 (diff)
downloadart-89502fc63d5d2ef3586e49b1ec38e1777ce7accf.zip
art-89502fc63d5d2ef3586e49b1ec38e1777ce7accf.tar.gz
art-89502fc63d5d2ef3586e49b1ec38e1777ce7accf.tar.bz2
A char array copy optimization.
- Based on measurements, copy char by char for arrays of length <= 64. - With this change, the Ritz MemAllocBench got ~25% faster on Nexus 4 and ~20% faster on host. - This change only handles arraycopy calls in the core libraries and char arrays with the rest future work. Bug: 7103825 Change-Id: Ie88890eb65f011ca052b1f253f1b0e078ec24b6b
Diffstat (limited to 'runtime/interpreter/interpreter.cc')
-rw-r--r--runtime/interpreter/interpreter.cc3
1 files changed, 2 insertions, 1 deletions
diff --git a/runtime/interpreter/interpreter.cc b/runtime/interpreter/interpreter.cc
index 59f0ac2..1677e80 100644
--- a/runtime/interpreter/interpreter.cc
+++ b/runtime/interpreter/interpreter.cc
@@ -127,7 +127,8 @@ static void UnstartedRuntimeInvoke(Thread* self, MethodHelper& mh,
args[0] = reinterpret_cast<uint32_t>(found);
EnterInterpreterFromInvoke(self, c, field.get(), args, NULL);
result->SetL(field.get());
- } else if (name == "void java.lang.System.arraycopy(java.lang.Object, int, java.lang.Object, int, int)") {
+ } else if (name == "void java.lang.System.arraycopy(java.lang.Object, int, java.lang.Object, int, int)" ||
+ name == "void java.lang.System.arraycopy(char[], int, char[], int, int)") {
// Special case array copying without initializing System.
Class* ctype = shadow_frame->GetVRegReference(arg_offset)->GetClass()->GetComponentType();
jint srcPos = shadow_frame->GetVReg(arg_offset + 1);