Revert "Remove inline natives for an unused performance test."
This reverts commit 7ecd89dc02ce00c425788bd4989bdb6cde9a618a.
Change-Id: I427635b7e3f7be45cfde78b8046dab3b23b64562
diff --git a/vm/DalvikVersion.h b/vm/DalvikVersion.h
index 7282c40..d3d67dd 100644
--- a/vm/DalvikVersion.h
+++ b/vm/DalvikVersion.h
@@ -32,6 +32,6 @@
* way classes load changes, e.g. field ordering or vtable layout. Changing
* this guarantees that the optimized form of the DEX file is regenerated.
*/
-#define DALVIK_VM_BUILD 25
+#define DALVIK_VM_BUILD 24
#endif /*_DALVIK_VERSION*/
diff --git a/vm/Dvm.mk b/vm/Dvm.mk
index 1d234ad..554ba70 100644
--- a/vm/Dvm.mk
+++ b/vm/Dvm.mk
@@ -182,6 +182,7 @@
native/java_lang_reflect_Proxy.c \
native/java_security_AccessController.c \
native/java_util_concurrent_atomic_AtomicLong.c \
+ native/org_apache_harmony_dalvik_NativeTestTarget.c \
native/org_apache_harmony_dalvik_ddmc_DdmServer.c \
native/org_apache_harmony_dalvik_ddmc_DdmVmInternal.c \
native/sun_misc_Unsafe.c \
diff --git a/vm/InlineNative.c b/vm/InlineNative.c
index 54656db..c426d4d 100644
--- a/vm/InlineNative.c
+++ b/vm/InlineNative.c
@@ -98,6 +98,25 @@
/*
* ===========================================================================
+ * org.apache.harmony.dalvik.NativeTestTarget
+ * ===========================================================================
+ */
+
+/*
+ * public static void emptyInlineMethod
+ *
+ * This exists only for benchmarks.
+ */
+static bool org_apache_harmony_dalvik_NativeTestTarget_emptyInlineMethod(
+ u4 arg0, u4 arg1, u4 arg2, u4 arg3, JValue* pResult)
+{
+ // do nothing
+ return true;
+}
+
+
+/*
+ * ===========================================================================
* java.lang.String
* ===========================================================================
*/
@@ -684,6 +703,10 @@
* the dispatch code in compiler/codegen/<target>/Codegen.c.
*/
const InlineOperation gDvmInlineOpsTable[] = {
+ { org_apache_harmony_dalvik_NativeTestTarget_emptyInlineMethod,
+ "Lorg/apache/harmony/dalvik/NativeTestTarget;",
+ "emptyInlineMethod", "()V" },
+
{ javaLangString_charAt,
"Ljava/lang/String;", "charAt", "(I)C" },
{ javaLangString_compareTo,
diff --git a/vm/compiler/codegen/arm/CalloutHelper.h b/vm/compiler/codegen/arm/CalloutHelper.h
index d4d1ec9..d6eb421 100644
--- a/vm/compiler/codegen/arm/CalloutHelper.h
+++ b/vm/compiler/codegen/arm/CalloutHelper.h
@@ -104,6 +104,7 @@
* Functions declared in gDvmInlineOpsTable[] are used for
* OP_EXECUTE_INLINE & OP_EXECUTE_INLINE_RANGE.
*
+ * org_apache_harmony_dalvik_NativeTestTarget_emptyInlineMethod
* javaLangString_charAt
* javaLangString_compareTo
* javaLangString_equals
diff --git a/vm/compiler/codegen/x86/CalloutHelper.h b/vm/compiler/codegen/x86/CalloutHelper.h
index 7357405..3229a26 100644
--- a/vm/compiler/codegen/x86/CalloutHelper.h
+++ b/vm/compiler/codegen/x86/CalloutHelper.h
@@ -54,6 +54,7 @@
* Functions declared in gDvmInlineOpsTable[] are used for
* OP_EXECUTE_INLINE & OP_EXECUTE_INLINE_RANGE.
*
+ * org_apache_harmony_dalvik_NativeTestTarget_emptyInlineMethod
* javaLangString_charAt
* javaLangString_compareTo
* javaLangString_equals
diff --git a/vm/native/InternalNative.c b/vm/native/InternalNative.c
index 536f88a..9dc61d8 100644
--- a/vm/native/InternalNative.c
+++ b/vm/native/InternalNative.c
@@ -57,6 +57,8 @@
dvm_org_apache_harmony_dalvik_ddmc_DdmServer, 0 },
{ "Lorg/apache/harmony/dalvik/ddmc/DdmVmInternal;",
dvm_org_apache_harmony_dalvik_ddmc_DdmVmInternal, 0 },
+ { "Lorg/apache/harmony/dalvik/NativeTestTarget;",
+ dvm_org_apache_harmony_dalvik_NativeTestTarget, 0 },
{ "Lsun/misc/Unsafe;", dvm_sun_misc_Unsafe, 0 },
{ NULL, NULL, 0 },
};
diff --git a/vm/native/InternalNativePriv.h b/vm/native/InternalNativePriv.h
index b14a3ee..0e54081 100644
--- a/vm/native/InternalNativePriv.h
+++ b/vm/native/InternalNativePriv.h
@@ -107,6 +107,7 @@
extern const DalvikNativeMethod dvm_dalvik_system_VMStack[];
extern const DalvikNativeMethod dvm_org_apache_harmony_dalvik_ddmc_DdmServer[];
extern const DalvikNativeMethod dvm_org_apache_harmony_dalvik_ddmc_DdmVmInternal[];
+extern const DalvikNativeMethod dvm_org_apache_harmony_dalvik_NativeTestTarget[];
extern const DalvikNativeMethod dvm_sun_misc_Unsafe[];
#endif /*_DALVIK_NATIVE_INTERNALNATIVEPRIV*/
diff --git a/vm/native/org_apache_harmony_dalvik_NativeTestTarget.c b/vm/native/org_apache_harmony_dalvik_NativeTestTarget.c
new file mode 100644
index 0000000..ccc9467
--- /dev/null
+++ b/vm/native/org_apache_harmony_dalvik_NativeTestTarget.c
@@ -0,0 +1,42 @@
+/*
+ * Copyright (C) 2008 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/*
+ * org.apache.harmony.dalvik.NativeTestTarget
+ */
+#include "Dalvik.h"
+#include "native/InternalNativePriv.h"
+
+
+/*
+ * public static void emptyInternalStaticMethod()
+ *
+ * For benchmarks, a do-nothing internal method with no arguments.
+ */
+static void Dalvik_org_apache_harmony_dalvik_NativeTestTarget_emptyInternalMethod(
+ const u4* args, JValue* pResult)
+{
+ UNUSED_PARAMETER(args);
+
+ RETURN_VOID();
+}
+
+const DalvikNativeMethod dvm_org_apache_harmony_dalvik_NativeTestTarget[] =
+{
+ { "emptyInternalStaticMethod", "()V",
+ Dalvik_org_apache_harmony_dalvik_NativeTestTarget_emptyInternalMethod },
+ { NULL, NULL, NULL },
+};