OSDN Git Service

Revert "Remove inline natives for an unused performance test."
authorJesse Wilson <jessewilson@google.com>
Wed, 22 Dec 2010 20:01:23 +0000 (12:01 -0800)
committerJesse Wilson <jessewilson@google.com>
Wed, 22 Dec 2010 20:01:23 +0000 (12:01 -0800)
This reverts commit 7ecd89dc02ce00c425788bd4989bdb6cde9a618a.

Change-Id: I427635b7e3f7be45cfde78b8046dab3b23b64562

vm/DalvikVersion.h
vm/Dvm.mk
vm/InlineNative.c
vm/compiler/codegen/arm/CalloutHelper.h
vm/compiler/codegen/x86/CalloutHelper.h
vm/native/InternalNative.c
vm/native/InternalNativePriv.h
vm/native/org_apache_harmony_dalvik_NativeTestTarget.c [new file with mode: 0644]

index 7282c40..d3d67dd 100644 (file)
@@ -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*/
index 1d234ad..554ba70 100644 (file)
--- a/vm/Dvm.mk
+++ b/vm/Dvm.mk
@@ -182,6 +182,7 @@ LOCAL_SRC_FILES := \
        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 \
index 54656db..c426d4d 100644 (file)
@@ -98,6 +98,25 @@ extern u4 __memcmp16(const u2* s0, const u2* s1, size_t count);
 
 /*
  * ===========================================================================
+ *      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 @@ static bool javaLangDouble_longBitsToDouble(u4 arg0, u4 arg1, u4 arg2, u4 arg,
  * 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,
index d4d1ec9..d6eb421 100644 (file)
@@ -104,6 +104,7 @@ Object* dvmAllocObject(ClassObject* clazz, int flags);  // OP_NEW_INSTANCE
  * 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
index 7357405..3229a26 100644 (file)
@@ -54,6 +54,7 @@ Object* dvmAllocObject(ClassObject* clazz, int flags);  // OP_NEW_INSTANCE
  * 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
index 536f88a..9dc61d8 100644 (file)
@@ -57,6 +57,8 @@ static DalvikNativeClass gDvmNativeMethodSet[] = {
             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 },
 };
index b14a3ee..0e54081 100644 (file)
@@ -107,6 +107,7 @@ extern const DalvikNativeMethod dvm_dalvik_system_Zygote[];
 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 (file)
index 0000000..ccc9467
--- /dev/null
@@ -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 },
+};