Also re-enabled the JIT for the ARMv5te target.
Change-Id: I89fd229205e30e6ee92a4933290a7d8dca001232
#$(call add-clean-step, rm -rf $(OUT)/obj/SHARED_LIBRARIES/libdvm*)
$(call add-clean-step, rm -rf $(OUT)/obj/SHARED_LIBRARIES/libdvm*)
$(call add-clean-step, rm -rf $(OUT)/obj/SHARED_LIBRARIES/libdvm*)
+$(call add-clean-step, rm -rf $(OUT)/obj/SHARED_LIBRARIES/libdvm*)
# ************************************************
# NEWER CLEAN STEPS MUST BE AT THE END OF THE LIST
# ************************************************
# Build for the target (device).
#
-ifeq ($(TARGET_ARCH_VARIANT),armv5te)
- WITH_JIT := false
-endif
-
ifeq ($(TARGET_CPU_SMP),true)
target_smp_flag := -DANDROID_SMP=1
else
}
+#if 0
+/* Debugging routines */
static void dumpConstants(CompilationUnit *cUnit)
{
int i;
}
}
+static void dumpHoistedChecks(CompilationUnit *cUnit)
+{
+ LoopAnalysis *loopAnalysis = cUnit->loopAnalysis;
+ unsigned int i;
+
+ for (i = 0; i < loopAnalysis->arrayAccessInfo->numUsed; i++) {
+ ArrayAccessInfo *arrayAccessInfo =
+ GET_ELEM_N(loopAnalysis->arrayAccessInfo,
+ ArrayAccessInfo*, i);
+ int arrayReg = DECODE_REG(
+ dvmConvertSSARegToDalvik(cUnit, arrayAccessInfo->arrayReg));
+ int idxReg = DECODE_REG(
+ dvmConvertSSARegToDalvik(cUnit, arrayAccessInfo->ivReg));
+ LOGE("Array access %d", i);
+ LOGE(" arrayReg %d", arrayReg);
+ LOGE(" idxReg %d", idxReg);
+ LOGE(" endReg %d", loopAnalysis->endConditionReg);
+ LOGE(" maxC %d", arrayAccessInfo->maxC);
+ LOGE(" minC %d", arrayAccessInfo->minC);
+ LOGE(" opcode %d", loopAnalysis->loopBranchOpcode);
+ }
+}
+
+#endif
+
/*
* A loop is considered optimizable if:
* 1) It has one basic induction variable
return !loopBodyCanThrow;
}
-static void dumpHoistedChecks(CompilationUnit *cUnit)
-{
- LoopAnalysis *loopAnalysis = cUnit->loopAnalysis;
- unsigned int i;
-
- for (i = 0; i < loopAnalysis->arrayAccessInfo->numUsed; i++) {
- ArrayAccessInfo *arrayAccessInfo =
- GET_ELEM_N(loopAnalysis->arrayAccessInfo,
- ArrayAccessInfo*, i);
- int arrayReg = DECODE_REG(
- dvmConvertSSARegToDalvik(cUnit, arrayAccessInfo->arrayReg));
- int idxReg = DECODE_REG(
- dvmConvertSSARegToDalvik(cUnit, arrayAccessInfo->ivReg));
- LOGE("Array access %d", i);
- LOGE(" arrayReg %d", arrayReg);
- LOGE(" idxReg %d", idxReg);
- LOGE(" endReg %d", loopAnalysis->endConditionReg);
- LOGE(" maxC %d", arrayAccessInfo->maxC);
- LOGE(" minC %d", arrayAccessInfo->minC);
- LOGE(" opcode %d", loopAnalysis->loopBranchOpcode);
- }
-}
-
static void genHoistedChecks(CompilationUnit *cUnit)
{
unsigned int i;
bool dvmInterpHandleFillArrayData(ArrayObject* arrayObject,// OP_FILL_ARRAY_DATA
const u2* arrayData);
-/* Switch dispatch offset calculation for OP_PACKED_SWITCH & OP_SPARSE_SWITCH */
-static s8 findPackedSwitchIndex(const u2* switchData, int testVal, int pc);
-static s8 findSparseSwitchIndex(const u2* switchData, int testVal, int pc);
+/*
+ * 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
#include "compiler/CompilerIR.h"
#include "CalloutHelper.h"
+#if defined(_CODEGEN_C)
/*
* loadConstant() sometimes needs to add a small imm to a pre-existing constant
*/
static bool genConversionPortable(CompilationUnit *cUnit, MIR *mir);
+#if defined(WITH_DEADLOCK_PREDICTION) || defined(WITH_MONITOR_TRACKING) || \
+ defined(__ARM_ARCH_5__)
static void genMonitorPortable(CompilationUnit *cUnit, MIR *mir);
+#endif
static void genInterpSingleStep(CompilationUnit *cUnit, MIR *mir);
+#endif
+
+
#if defined(WITH_SELF_VERIFICATION)
/* Self Verification memory instruction decoder */
void dvmSelfVerificationMemOpDecode(int lr, int* sp);
return insn;
}
+#if defined(_ARMV7_A) || defined(_ARMV7_A_NEON)
static ArmLIR *newLIR4(CompilationUnit *cUnit, ArmOpCode opCode,
int dest, int src1, int src2, int info)
{
dvmCompilerAppendLIR(cUnit, (LIR *) insn);
return insn;
}
+#endif
/*
* If the next instruction is a move-result or move-result-long,
opReg(cUnit, kOpBlx, r2);
}
+#if defined(WITH_DEADLOCK_PREDICTION) || defined(WITH_MONITOR_TRACKING) || \
+ defined(_ARMV5TE) || defined(_ARMV5TE_VFP)
/*
* To prevent a thread in a monitor wait from blocking the Jit from
* resetting the code cache, heavyweight monitor lock will not
dvmCompilerClobberCallRegs(cUnit);
}
}
+#endif
/*
* The following are the first-level codegen routines that analyze the format
return (reg1Lo == reg2Lo) || (reg1Lo == reg2Hi) || (reg1Hi == reg2Lo);
}
+#if 0
+/* Debugging utility routine */
static void dumpDependentInsnPair(ArmLIR *thisLIR, ArmLIR *checkLIR,
const char *optimization)
{
dvmDumpLIRInsn((LIR *) thisLIR, 0);
dvmDumpLIRInsn((LIR *) checkLIR, 0);
}
+#endif
/*
* Perform a pass of top-down walk to
*/
static int coreTemps[] = {r0, r1, r2, r3, r4PC, r7};
-static int corePreserved[] = {};
static void storePair(CompilationUnit *cUnit, int base, int lowReg,
int highReg);
ArmLIR *load2 = NULL;
ArmOpCode opCode = kThumbBkpt;
bool shortForm = false;
- int shortMax = 128;
int encodedDisp = displacement;
bool pair = false;
ArmLIR *store2 = NULL;
ArmOpCode opCode = kThumbBkpt;
bool shortForm = false;
- int shortMax = 128;
int encodedDisp = displacement;
bool pair = false;
void dvmCompilerInitializeRegAlloc(CompilationUnit *cUnit)
{
- int i;
int numTemps = sizeof(coreTemps)/sizeof(int);
RegisterPool *pool = dvmCompilerNew(sizeof(*pool), true);
cUnit->regPool = pool;
* See the License for the specific language governing permissions and
* limitations under the License.
*/
+#define _CODEGEN_C
+#define _ARMV5TE_VFP
#include "Dalvik.h"
#include "interp/InterpDefs.h"
* See the License for the specific language governing permissions and
* limitations under the License.
*/
+#define _CODEGEN_C
+#define _ARMV5TE
#include "Dalvik.h"
#include "interp/InterpDefs.h"
* See the License for the specific language governing permissions and
* limitations under the License.
*/
+#define _CODEGEN_C
+#define _ARMV7_A_NEON
#include "Dalvik.h"
#include "interp/InterpDefs.h"
* See the License for the specific language governing permissions and
* limitations under the License.
*/
+#define _CODEGEN_C
+#define _ARMV7_A
#include "Dalvik.h"
#include "interp/InterpDefs.h"
LOGVV("+++ returned into break frame\n");
#if defined(WITH_JIT)
/* Let the Jit know the return is terminating normally */
- CHECK_JIT();
+ CHECK_JIT_VOID();
#endif
GOTO_bail();
}
#if defined(WITH_JIT)
/* Allow the Jit to end any pending trace building */
- CHECK_JIT();
+ CHECK_JIT_VOID();
#endif
/*
#define INTERP_TYPE INTERP_STD
#define CHECK_DEBUG_AND_PROF() ((void)0)
# define CHECK_TRACKED_REFS() ((void)0)
-#define CHECK_JIT() (0)
+#define CHECK_JIT_BOOL() (false)
+#define CHECK_JIT_VOID()
#define ABORT_JIT_TSELECT() ((void)0)
/*
#define INTERP_TYPE INTERP_STD
#define CHECK_DEBUG_AND_PROF() ((void)0)
# define CHECK_TRACKED_REFS() ((void)0)
-#define CHECK_JIT() (0)
+#define CHECK_JIT_BOOL() (false)
+#define CHECK_JIT_VOID()
#define ABORT_JIT_TSELECT() ((void)0)
/*
LOGVV("+++ returned into break frame\n");
#if defined(WITH_JIT)
/* Let the Jit know the return is terminating normally */
- CHECK_JIT();
+ CHECK_JIT_VOID();
#endif
GOTO_bail();
}
#if defined(WITH_JIT)
/* Allow the Jit to end any pending trace building */
- CHECK_JIT();
+ CHECK_JIT_VOID();
#endif
/*
#define INTERP_TYPE INTERP_STD
#define CHECK_DEBUG_AND_PROF() ((void)0)
# define CHECK_TRACKED_REFS() ((void)0)
-#define CHECK_JIT() (0)
+#define CHECK_JIT_BOOL() (false)
+#define CHECK_JIT_VOID()
#define ABORT_JIT_TSELECT() ((void)0)
/*
#define INTERP_TYPE INTERP_STD
#define CHECK_DEBUG_AND_PROF() ((void)0)
# define CHECK_TRACKED_REFS() ((void)0)
-#define CHECK_JIT() (0)
+#define CHECK_JIT_BOOL() (false)
+#define CHECK_JIT_VOID()
#define ABORT_JIT_TSELECT() ((void)0)
/*
#define INTERP_TYPE INTERP_STD
#define CHECK_DEBUG_AND_PROF() ((void)0)
# define CHECK_TRACKED_REFS() ((void)0)
-#define CHECK_JIT() (0)
+#define CHECK_JIT_BOOL() (false)
+#define CHECK_JIT_VOID()
#define ABORT_JIT_TSELECT() ((void)0)
/*
#define INTERP_TYPE INTERP_STD
#define CHECK_DEBUG_AND_PROF() ((void)0)
# define CHECK_TRACKED_REFS() ((void)0)
-#define CHECK_JIT() (0)
+#define CHECK_JIT_BOOL() (false)
+#define CHECK_JIT_VOID()
#define ABORT_JIT_TSELECT() ((void)0)
/*
#define INTERP_TYPE INTERP_STD
#define CHECK_DEBUG_AND_PROF() ((void)0)
# define CHECK_TRACKED_REFS() ((void)0)
-#define CHECK_JIT() (0)
+#define CHECK_JIT_BOOL() (false)
+#define CHECK_JIT_VOID()
#define ABORT_JIT_TSELECT() ((void)0)
/*
checkDebugAndProf(pc, fp, self, curMethod, &debugIsMethodEntry)
#if defined(WITH_JIT)
-#define CHECK_JIT() (dvmCheckJit(pc, self, interpState))
+#define CHECK_JIT_BOOL() (dvmCheckJit(pc, self, interpState))
+#define CHECK_JIT_VOID() (dvmCheckJit(pc, self, interpState))
#define ABORT_JIT_TSELECT() (dvmJitAbortTraceSelect(interpState))
#else
-#define CHECK_JIT() (0)
+#define CHECK_JIT_BOOL() (false)
+#define CHECK_JIT_VOID()
#define ABORT_JIT_TSELECT(x) ((void)0)
#endif
inst = FETCH(0); \
CHECK_DEBUG_AND_PROF(); \
CHECK_TRACKED_REFS(); \
- if (CHECK_JIT()) GOTO_bail_switch(); \
+ if (CHECK_JIT_BOOL()) GOTO_bail_switch(); \
goto *handlerTable[INST_INST(inst)]; \
}
# define FINISH_BKPT(_opcode) { \
/* just fall through to instruction loop or threaded kickstart */
break;
case kInterpEntryReturn:
- CHECK_JIT();
+ CHECK_JIT_VOID();
goto returnFromMethod;
case kInterpEntryThrow:
goto exceptionThrown;
LOGVV("+++ returned into break frame\n");
#if defined(WITH_JIT)
/* Let the Jit know the return is terminating normally */
- CHECK_JIT();
+ CHECK_JIT_VOID();
#endif
GOTO_bail();
}
#if defined(WITH_JIT)
/* Allow the Jit to end any pending trace building */
- CHECK_JIT();
+ CHECK_JIT_VOID();
#endif
/*
#define CHECK_DEBUG_AND_PROF() ((void)0)
-#define CHECK_JIT() (0)
+#define CHECK_JIT_BOOL() (false)
+#define CHECK_JIT_VOID()
#define ABORT_JIT_TSELECT() ((void)0)
/* File: portable/stubdefs.c */
inst = FETCH(0); \
CHECK_DEBUG_AND_PROF(); \
CHECK_TRACKED_REFS(); \
- if (CHECK_JIT()) GOTO_bail_switch(); \
+ if (CHECK_JIT_BOOL()) GOTO_bail_switch(); \
goto *handlerTable[INST_INST(inst)]; \
}
# define FINISH_BKPT(_opcode) { \
/* just fall through to instruction loop or threaded kickstart */
break;
case kInterpEntryReturn:
- CHECK_JIT();
+ CHECK_JIT_VOID();
goto returnFromMethod;
case kInterpEntryThrow:
goto exceptionThrown;
LOGVV("+++ returned into break frame\n");
#if defined(WITH_JIT)
/* Let the Jit know the return is terminating normally */
- CHECK_JIT();
+ CHECK_JIT_VOID();
#endif
GOTO_bail();
}
#if defined(WITH_JIT)
/* Allow the Jit to end any pending trace building */
- CHECK_JIT();
+ CHECK_JIT_VOID();
#endif
/*
#define INTERP_TYPE INTERP_STD
#define CHECK_DEBUG_AND_PROF() ((void)0)
# define CHECK_TRACKED_REFS() ((void)0)
-#define CHECK_JIT() (0)
+#define CHECK_JIT_BOOL() (false)
+#define CHECK_JIT_VOID()
#define ABORT_JIT_TSELECT() ((void)0)
/*
LOGVV("+++ returned into break frame\n");
#if defined(WITH_JIT)
/* Let the Jit know the return is terminating normally */
- CHECK_JIT();
+ CHECK_JIT_VOID();
#endif
GOTO_bail();
}
#if defined(WITH_JIT)
/* Allow the Jit to end any pending trace building */
- CHECK_JIT();
+ CHECK_JIT_VOID();
#endif
/*
#define INTERP_TYPE INTERP_STD
#define CHECK_DEBUG_AND_PROF() ((void)0)
# define CHECK_TRACKED_REFS() ((void)0)
-#define CHECK_JIT() (0)
+#define CHECK_JIT_BOOL() (false)
+#define CHECK_JIT_VOID()
#define ABORT_JIT_TSELECT() ((void)0)
/*
LOGVV("+++ returned into break frame\n");
#if defined(WITH_JIT)
/* Let the Jit know the return is terminating normally */
- CHECK_JIT();
+ CHECK_JIT_VOID();
#endif
GOTO_bail();
}
#if defined(WITH_JIT)
/* Allow the Jit to end any pending trace building */
- CHECK_JIT();
+ CHECK_JIT_VOID();
#endif
/*
/* just fall through to instruction loop or threaded kickstart */
break;
case kInterpEntryReturn:
- CHECK_JIT();
+ CHECK_JIT_VOID();
goto returnFromMethod;
case kInterpEntryThrow:
goto exceptionThrown;
checkDebugAndProf(pc, fp, self, curMethod, &debugIsMethodEntry)
#if defined(WITH_JIT)
-#define CHECK_JIT() (dvmCheckJit(pc, self, interpState))
+#define CHECK_JIT_BOOL() (dvmCheckJit(pc, self, interpState))
+#define CHECK_JIT_VOID() (dvmCheckJit(pc, self, interpState))
#define ABORT_JIT_TSELECT() (dvmJitAbortTraceSelect(interpState))
#else
-#define CHECK_JIT() (0)
+#define CHECK_JIT_BOOL() (false)
+#define CHECK_JIT_VOID()
#define ABORT_JIT_TSELECT(x) ((void)0)
#endif
#define CHECK_DEBUG_AND_PROF() ((void)0)
-#define CHECK_JIT() (0)
+#define CHECK_JIT_BOOL() (false)
+#define CHECK_JIT_VOID()
#define ABORT_JIT_TSELECT() ((void)0)
inst = FETCH(0); \
CHECK_DEBUG_AND_PROF(); \
CHECK_TRACKED_REFS(); \
- if (CHECK_JIT()) GOTO_bail_switch(); \
+ if (CHECK_JIT_BOOL()) GOTO_bail_switch(); \
goto *handlerTable[INST_INST(inst)]; \
}
# define FINISH_BKPT(_opcode) { \