summaryrefslogtreecommitdiffstats
path: root/opcode-gen/opcode-gen
diff options
context:
space:
mode:
Diffstat (limited to 'opcode-gen/opcode-gen')
-rwxr-xr-xopcode-gen/opcode-gen11
1 files changed, 11 insertions, 0 deletions
diff --git a/opcode-gen/opcode-gen b/opcode-gen/opcode-gen
index 8a99134ad..64011ce83 100755
--- a/opcode-gen/opcode-gen
+++ b/opcode-gen/opcode-gen
@@ -480,6 +480,17 @@ function flagsToC(f, parts, result, i) {
return result;
}
+# Given a packed opcode, returns the raw (unpacked) opcode value.
+function unpackOpcode(idx) {
+ # Note: This must be the inverse of the corresponding code in
+ # libdex/OpCode.h.
+ if (idx <= 0xff) {
+ return idx;
+ } else {
+ return (idx << 8) | 0xff;
+ }
+}
+
# Returns true if the given opcode (by index) is an "optimized" opcode.
function isOptimized(idx, parts, f) {
# locals: parts, f