We can just use dvmFindInterfaceMethodInCache directly.
Change-Id: I2f3a660262ba7a39c05689df160ebdd2e7ec38a5
(!strcmp(target, "dvmAllocArrayByClass")) ||
(!strcmp(target, "dvmAllocPrimitiveArray")) ||
(!strcmp(target, "dvmInterpHandleFillArrayData")) ||
- (!strcmp(target, "dvmFindInterfaceMethodInCache2")) ||
+ (!strcmp(target, "dvmFindInterfaceMethodInCache")) ||
(!strcmp(target, "dvmNcgHandlePackedSwitch")) ||
(!strcmp(target, "dvmNcgHandleSparseSwitch")) ||
(!strcmp(target, "dvmCanPutArrayElement")) ||
#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"
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;
}
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
-}
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