OSDN Git Service

Remove dvmFindInterfaceMethodInCache2.
authorElliott Hughes <enh@google.com>
Thu, 6 Dec 2012 23:24:32 +0000 (15:24 -0800)
committerElliott Hughes <enh@google.com>
Thu, 6 Dec 2012 23:27:38 +0000 (15:27 -0800)
We can just use dvmFindInterfaceMethodInCache directly.

Change-Id: I2f3a660262ba7a39c05689df160ebdd2e7ec38a5

vm/compiler/codegen/x86/AnalysisO1.cpp
vm/compiler/codegen/x86/LowerHelper.cpp
vm/compiler/codegen/x86/NcgHelper.cpp
vm/compiler/codegen/x86/NcgHelper.h

index 2c816e3..a9fd5ce 100644 (file)
@@ -3717,7 +3717,7 @@ int beforeCall(const char* target) { //spill all live registers
        (!strcmp(target, "dvmAllocArrayByClass")) ||
        (!strcmp(target, "dvmAllocPrimitiveArray")) ||
        (!strcmp(target, "dvmInterpHandleFillArrayData")) ||
-       (!strcmp(target, "dvmFindInterfaceMethodInCache2")) ||
+       (!strcmp(target, "dvmFindInterfaceMethodInCache")) ||
        (!strcmp(target, "dvmNcgHandlePackedSwitch")) ||
        (!strcmp(target, "dvmNcgHandleSparseSwitch")) ||
        (!strcmp(target, "dvmCanPutArrayElement")) ||
index 4539064..3fec038 100644 (file)
@@ -42,6 +42,7 @@ When allocating a physical register for an operand, we can't spill the operands
 #include "NcgAot.h"
 #include "enc_wrapper.h"
 #include "vm/mterp/Mterp.h"
+#include "vm/mterp/common/FindInterface.h"
 #include "NcgHelper.h"
 #include <math.h>
 #include "interp/InterpState.h"
@@ -2705,18 +2706,18 @@ int call_dvmCanPutArrayElement() {
     return 0;
 }
 
-//!generate native code to call dvmFindInterfaceMethodInCache2
+//!generate native code to call dvmFindInterfaceMethodInCache
 
 //!
 int call_dvmFindInterfaceMethodInCache() {
     typedef Method* (*vmHelper)(ClassObject*, u4, const Method*, DvmDex*);
-    vmHelper funcPtr = dvmFindInterfaceMethodInCache2;
+    vmHelper funcPtr = dvmFindInterfaceMethodInCache;
     if(gDvm.executionMode == kExecutionModeNcgO1) {
-        beforeCall("dvmFindInterfaceMethodInCache2");
-        callFuncPtr((int)funcPtr, "dvmFindInterfaceMethodInCache2");
-        afterCall("dvmFindInterfaceMethodInCache2");
+        beforeCall("dvmFindInterfaceMethodInCache");
+        callFuncPtr((int)funcPtr, "dvmFindInterfaceMethodInCache");
+        afterCall("dvmFindInterfaceMethodInCache");
     } else {
-        callFuncPtr((int)funcPtr, "dvmFindInterfaceMethodInCache2");
+        callFuncPtr((int)funcPtr, "dvmFindInterfaceMethodInCache");
     }
     return 0;
 }
index f9192db..c603d09 100644 (file)
@@ -102,17 +102,3 @@ s4 dvmJitHandleSparseSwitch(const s4* keys, u2 size, s4 testVal)
     LOGVV("Value %d not found in switch", testVal);
     return 2*3; //bytecode sparse_switch is 6(2*3) bytes long
 }
-/*
- * Look up an interface on a class using the cache.
- */
-/*INLINE*/ Method* dvmFindInterfaceMethodInCache2(ClassObject* thisClass,
-    u4 methodIdx, const Method* method, DvmDex* methodClassDex)
-{
-#define ATOMIC_CACHE_CALC \
-    dvmInterpFindInterfaceMethod(thisClass, methodIdx, method, methodClassDex)
-
-    return (Method*) ATOMIC_CACHE_LOOKUP(methodClassDex->pInterfaceCache,
-                DEX_INTERFACE_CACHE_SIZE, thisClass, methodIdx);
-
-#undef ATOMIC_CACHE_CALC
-}
index 888cb61..713f424 100644 (file)
@@ -22,17 +22,6 @@ s4 dvmNcgHandlePackedSwitch(const s4*, s4, u2, s4);
 s4 dvmNcgHandleSparseSwitch(const s4*, u2, s4);
 s4 dvmJitHandlePackedSwitch(const s4*, s4, u2, s4);
 s4 dvmJitHandleSparseSwitch(const s4*, u2, s4);
-/*
- * Look up an interface on a class using the cache.
- */
-Method* dvmFindInterfaceMethodInCache2(ClassObject* thisClass,
-    u4 methodIdx, const Method* method, DvmDex* methodClassDex);
-/*
- * Find an interface method.
- */
-#if 0
-bool dvmNcgStdRun(MterpGlue* glue);
-#endif
 extern "C" void dvmNcgInvokeInterpreter(int pc); //interpreter to execute at pc
 extern "C" void dvmNcgInvokeNcg(int pc);
 extern "C" void dvmJitToInterpNormal(int targetpc); //in %ebx