diff options
author | Dan Bornstein <danfuzz@android.com> | 2010-12-02 17:47:47 -0800 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2010-12-02 17:47:47 -0800 |
commit | 285800878fd5f733290e1085b958c94e7b50bf5b (patch) | |
tree | c531d38c1a7fb0c32e61ffdfac5412fd12b1490a | |
parent | 0d2867d5af324fedb06a984e2e36aac62218cdd0 (diff) | |
parent | 0e7fb57b0a6c045bf15c2ada3d1c4eb3dde1cc76 (diff) | |
download | libcore-285800878fd5f733290e1085b958c94e7b50bf5b.zip libcore-285800878fd5f733290e1085b958c94e7b50bf5b.tar.gz libcore-285800878fd5f733290e1085b958c94e7b50bf5b.tar.bz2 |
Merge "Expose the "packed opcode" concept, just a bit." into dalvik-dev
-rw-r--r-- | dalvik/src/main/java/dalvik/bytecode/OpcodeInfo.java | 32 |
1 files changed, 24 insertions, 8 deletions
diff --git a/dalvik/src/main/java/dalvik/bytecode/OpcodeInfo.java b/dalvik/src/main/java/dalvik/bytecode/OpcodeInfo.java index bbd524b..05c8fe8 100644 --- a/dalvik/src/main/java/dalvik/bytecode/OpcodeInfo.java +++ b/dalvik/src/main/java/dalvik/bytecode/OpcodeInfo.java @@ -29,6 +29,21 @@ public final class OpcodeInfo { */ public static final int MAXIMUM_VALUE; + /** + * The maximum possible "packed value" of a Dalvik opcode. The + * packed value of an opcode is a denser representation that is + * only used when reporting usage statistics. The mapping between + * packed opcode values and regular opcode values is + * implementation-specific and may vary over time. + * + * <p><b>Note:</b>: This is constant in any given VM incarnation, + * but it is subject to change over time, so it is not appropriate + * to represent as a compile-time constant value.</p> + * + * @see dalvik.system.VMDebug.getInstructionCount() + */ + public static final int MAXIMUM_PACKED_VALUE; + static { /* * See note on the definition of MAXIMUM_VALUE, above, for @@ -38,9 +53,10 @@ public final class OpcodeInfo { * by the opcode-gen tool. Any edits will get wiped out the * next time the tool is run. */ - // BEGIN(libcore-maximum-value); GENERATED AUTOMATICALLY BY opcode-gen + // BEGIN(libcore-maximum-values); GENERATED AUTOMATICALLY BY opcode-gen MAXIMUM_VALUE = 255; - // END(libcore-maximum-value) + MAXIMUM_PACKED_VALUE = 255; + // END(libcore-maximum-values) } /** @@ -51,15 +67,15 @@ public final class OpcodeInfo { } /** - * Returns whether the given opcode represents a method invocation - * operation. This includes most things that look like method - * invocation at the source level, but it notably excludes methods - * that are implemented directly in the VM as well as ones the VM - * knows to have empty implementations. + * Returns whether the given packed opcode value represents a + * method invocation operation. This includes most things that + * look like method invocation at the source level, but it notably + * excludes methods that are implemented directly in the VM as + * well as ones the VM knows to have empty implementations. * * @hide Unclear if this is useful enough to publish as supported API. * * @param opcode one of the values defined in {@link Opcodes} */ - public static native boolean isInvoke(int opcode); + public static native boolean isInvoke(int packedOpcode); } |