merge in jb-release history after reset to jb-dev
diff --git a/vm/compiler/codegen/arm/CalloutHelper.h b/vm/compiler/codegen/arm/CalloutHelper.h
index 079c5f6..cc4c0ae 100644
--- a/vm/compiler/codegen/arm/CalloutHelper.h
+++ b/vm/compiler/codegen/arm/CalloutHelper.h
@@ -87,6 +87,13 @@
const ClassObject *clazz);
/*
+ * Switch dispatch offset calculation for OP_PACKED_SWITCH & OP_SPARSE_SWITCH
+ * Used in CodegenDriver.c
+ * static s8 findPackedSwitchIndex(const u2* switchData, int testVal, int pc);
+ * static s8 findSparseSwitchIndex(const u2* switchData, int testVal, int pc);
+ */
+
+/*
* Resolve interface callsites - OP_INVOKE_INTERFACE & OP_INVOKE_INTERFACE_RANGE
*
* Originally declared in mterp/common/FindInterface.h and only comment it here
diff --git a/vm/compiler/codegen/arm/CodegenDriver.cpp b/vm/compiler/codegen/arm/CodegenDriver.cpp
index 40fc964..d7017b0 100644
--- a/vm/compiler/codegen/arm/CodegenDriver.cpp
+++ b/vm/compiler/codegen/arm/CodegenDriver.cpp
@@ -2781,16 +2781,16 @@
* chaining cell for case default [8 bytes]
* noChain exit
*/
-static u8 findPackedSwitchIndex(const u2* switchData, int testVal, uintptr_t pc)
+static s8 findPackedSwitchIndex(const u2* switchData, int testVal, int pc)
{
int size;
int firstKey;
const int *entries;
int index;
int jumpIndex;
- uintptr_t caseDPCOffset = 0;
+ int caseDPCOffset = 0;
/* In Thumb mode pc is 4 ahead of the "mov r2, pc" instruction */
- uintptr_t chainingPC = (pc + 4) & ~3;
+ int chainingPC = (pc + 4) & ~3;
/*
* Packed switch data format:
@@ -2829,16 +2829,16 @@
}
chainingPC += jumpIndex * CHAIN_CELL_NORMAL_SIZE;
- return (((u8) caseDPCOffset) << 32) | (u8) chainingPC;
+ return (((s8) caseDPCOffset) << 32) | (u8) chainingPC;
}
/* See comments for findPackedSwitchIndex */
-static u8 findSparseSwitchIndex(const u2* switchData, int testVal, uintptr_t pc)
+static s8 findSparseSwitchIndex(const u2* switchData, int testVal, int pc)
{
int size;
const int *keys;
const int *entries;
- uintptr_t chainingPC = (pc + 4) & ~3;
+ int chainingPC = (pc + 4) & ~3;
int i;
/*
@@ -2880,7 +2880,7 @@
int jumpIndex = (i < MAX_CHAINED_SWITCH_CASES) ?
i : MAX_CHAINED_SWITCH_CASES + 1;
chainingPC += jumpIndex * CHAIN_CELL_NORMAL_SIZE;
- return (((u8) entries[i]) << 32) | (u8) chainingPC;
+ return (((s8) entries[i]) << 32) | (u8) chainingPC;
} else if (k > testVal) {
break;
}
diff --git a/vm/oo/Resolve.cpp b/vm/oo/Resolve.cpp
index ab3de5b..a4890a5 100644
--- a/vm/oo/Resolve.cpp
+++ b/vm/oo/Resolve.cpp
@@ -219,11 +219,7 @@
}
if (resMethod == NULL) {
- std::string msg;
- msg += resClass->descriptor;
- msg += ".";
- msg += name;
- dvmThrowNoSuchMethodError(msg.c_str());
+ dvmThrowNoSuchMethodError(name);
return NULL;
}
@@ -337,14 +333,11 @@
DexProto proto;
dexProtoSetFromMethodId(&proto, pDvmDex->pDexFile, pMethodId);
- LOGVV("+++ looking for '%s' in resClass='%s'", methodName, resClass->descriptor);
+ LOGVV("+++ looking for '%s' '%s' in resClass='%s'",
+ methodName, methodSig, resClass->descriptor);
resMethod = dvmFindInterfaceMethodHier(resClass, methodName, &proto);
if (resMethod == NULL) {
- std::string msg;
- msg += resClass->descriptor;
- msg += ".";
- msg += methodName;
- dvmThrowNoSuchMethodError(msg.c_str());
+ dvmThrowNoSuchMethodError(methodName);
return NULL;
}