Initial port of the Dalvik JIT enging to the internal repository.
Fixed files with trailing spaces.
Addressed review comments from Dan.
Addressed review comments from fadden.
Addressed review comments from Dan x 2.
Addressed review comments from Dan x 3.
diff --git a/libdex/InstrUtils.c b/libdex/InstrUtils.c
index 33c7e7d..b58e647 100644
--- a/libdex/InstrUtils.c
+++ b/libdex/InstrUtils.c
@@ -539,16 +539,6 @@
case OP_SPUT_SHORT:
case OP_SPUT_WIDE:
case OP_SPUT_OBJECT:
- case OP_INVOKE_VIRTUAL:
- case OP_INVOKE_VIRTUAL_RANGE:
- case OP_INVOKE_SUPER:
- case OP_INVOKE_SUPER_RANGE:
- case OP_INVOKE_DIRECT:
- case OP_INVOKE_DIRECT_RANGE:
- case OP_INVOKE_STATIC:
- case OP_INVOKE_STATIC_RANGE:
- case OP_INVOKE_INTERFACE:
- case OP_INVOKE_INTERFACE_RANGE:
case OP_DIV_INT:
case OP_REM_INT:
case OP_DIV_LONG:
@@ -564,6 +554,19 @@
flags = kInstrCanContinue | kInstrCanThrow;
break;
+ case OP_INVOKE_VIRTUAL:
+ case OP_INVOKE_VIRTUAL_RANGE:
+ case OP_INVOKE_SUPER:
+ case OP_INVOKE_SUPER_RANGE:
+ case OP_INVOKE_DIRECT:
+ case OP_INVOKE_DIRECT_RANGE:
+ case OP_INVOKE_STATIC:
+ case OP_INVOKE_STATIC_RANGE:
+ case OP_INVOKE_INTERFACE:
+ case OP_INVOKE_INTERFACE_RANGE:
+ flags = kInstrCanContinue | kInstrCanThrow | kInstrInvoke;
+ break;
+
case OP_RETURN_VOID:
case OP_RETURN:
case OP_RETURN_WIDE:
@@ -579,7 +582,7 @@
case OP_GOTO:
case OP_GOTO_16:
case OP_GOTO_32:
- flags = kInstrCanBranch;
+ flags = kInstrCanBranch | kInstrUnconditional;
break;
/* conditional branches */
@@ -617,12 +620,15 @@
case OP_IPUT_QUICK:
case OP_IPUT_WIDE_QUICK:
case OP_IPUT_OBJECT_QUICK:
+ flags = kInstrCanContinue | kInstrCanThrow;
+ break;
+
case OP_INVOKE_VIRTUAL_QUICK:
case OP_INVOKE_VIRTUAL_QUICK_RANGE:
case OP_INVOKE_SUPER_QUICK:
case OP_INVOKE_SUPER_QUICK_RANGE:
case OP_INVOKE_DIRECT_EMPTY:
- flags = kInstrCanContinue | kInstrCanThrow;
+ flags = kInstrCanContinue | kInstrCanThrow | kInstrInvoke;
break;
/* these should never appear */
@@ -651,6 +657,7 @@
case OP_UNUSED_FD:
case OP_UNUSED_FE:
case OP_UNUSED_FF:
+ flags = kInstrNoJit;
break;
/*
@@ -1238,4 +1245,3 @@
}
return width;
}
-
diff --git a/libdex/InstrUtils.h b/libdex/InstrUtils.h
index 7621b8e..5ca175e 100644
--- a/libdex/InstrUtils.h
+++ b/libdex/InstrUtils.h
@@ -99,6 +99,9 @@
kInstrCanSwitch = 1 << 2, // switch statement
kInstrCanThrow = 1 << 3, // could cause an exception to be thrown
kInstrCanReturn = 1 << 4, // returns, no additional statements
+ kInstrInvoke = 1 << 5, // a flavor of invoke
+ kInstrUnconditional = 1 << 6, // unconditional branch
+ kInstrNoJit = 1 << 7, // don't jit trace containing this
};