Merge "Make the scan and the visit routines look more alike." into dalvik-dev
diff --git a/docs/verifier.html b/docs/verifier.html
index 4c1f2e6..276967f 100644
--- a/docs/verifier.html
+++ b/docs/verifier.html
@@ -115,9 +115,14 @@
held in register N, you can exit the monitor using register N or any
subsequently-made copies of register N. The verifier does not attempt
to identify previously-made copies, track loads and stores through
-fields, or recognize identical constant values (e.g. the result of two
-<code>const-class</code> instructions on the same class will always result
-in the same reference).
+fields, or recognize identical constant values (for example, the result
+values from two <code>const-class</code> instructions on the same class
+will be the same reference, but the verifier doesn't recognize this).
+
+<p>
+Further, you may only exit the monitor most recently entered. "Hand
+over hand" locking techniques, e.g. "lock A; lock B; unlock A; unlock B",
+are not allowed.
<p>
This means that there are a number of situations in which the verifier
diff --git a/opcode-gen/opcode-gen b/opcode-gen/opcode-gen
index 17560d1..8a99134 100755
--- a/opcode-gen/opcode-gen
+++ b/opcode-gen/opcode-gen
@@ -138,6 +138,28 @@
next;
}
+/BEGIN\(libcore-opcodes\)/ {
+ consumeUntil = "END(libcore-opcodes)";
+ print;
+
+ for (i = 0; i <= MAX_LIBDEX_OPCODE; i++) {
+ if (isUnusedByte(i) || isOptimized(i)) continue;
+ printf(" int OP_%-28s = 0x%02x;\n", constName[i], i);
+ }
+
+ next;
+}
+
+/BEGIN\(libcore-maximum-value\)/ {
+ consumeUntil = "END(libcore-maximum-value)";
+ print;
+
+ # TODO: Make this smarter.
+ printf(" MAXIMUM_VALUE = %d;\n", MAX_LIBDEX_OPCODE);
+
+ next;
+}
+
/BEGIN\(libdex-opcode-enum\)/ {
consumeUntil = "END(libdex-opcode-enum)";
print;
diff --git a/opcode-gen/regen-all b/opcode-gen/regen-all
index 276893e..fbf8359 100755
--- a/opcode-gen/regen-all
+++ b/opcode-gen/regen-all
@@ -40,3 +40,10 @@
${progdir}/opcode-gen libdex/InstrUtils.c
${progdir}/opcode-gen libdex/OpCode.h
${progdir}/opcode-gen libdex/OpCodeNames.c
+
+# It's a minor shame that these files live in a different top-level project.
+# So it goes.
+${progdir}/opcode-gen \
+ ../libcore/dalvik/src/main/java/dalvik/bytecode/OpcodeInfo.java
+${progdir}/opcode-gen \
+ ../libcore/dalvik/src/main/java/dalvik/bytecode/Opcodes.java