Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Jason Zaugg
asm
Commits
07fde51b
Commit
07fde51b
authored
May 05, 2018
by
Remi Forax
Browse files
forget to run google-format :(
parent
785f47ac
Changes
2
Hide whitespace changes
Inline
Side-by-side
asm/src/main/java/org/objectweb/asm/Opcodes.java
View file @
07fde51b
...
...
@@ -34,7 +34,7 @@ package org.objectweb.asm;
* xSTORE_n opcodes are therefore not defined in this interface. Likewise for LDC, automatically
* replaced by LDC_W or LDC2_W when necessary, WIDE, GOTO_W and JSR_W.
*
* @see <a href="https://docs.oracle.com/javase/specs/jvms/se11/html/jvms-6.html">JVMS 6</a>
* @see <a href=
"https://docs.oracle.com/javase/specs/jvms/se11/html/jvms-6.html">JVMS 6</a>
* @author Eric Bruneton
* @author Eugene Kuleshov
*/
...
...
@@ -54,7 +54,8 @@ public interface Opcodes {
*/
@Deprecated
int
ASM7_EXPERIMENTAL
=
1
<<
24
|
7
<<
16
|
0
<<
8
;
// Java ClassFile versions (the minor version is stored in the 16 most significant bits, and the
// Java ClassFile versions (the minor version is stored in the 16 most
// significant bits, and the
// major version in the 16 least significant bits).
int
V1_1
=
3
<<
16
|
45
;
...
...
@@ -69,18 +70,21 @@ public interface Opcodes {
int
V10
=
0
<<
16
|
54
;
int
V11
=
0
<<
16
|
55
;
/**
* Version flag indicating that the class is using 'preview' features.
*
* {@code version & V_PREVIEW == V_PREVIEW} tests if a version is flagged with {@code V_PREVIEW}.
* Version flag indicating that the class is using 'preview' features.
*
* <p>{@code version & V_PREVIEW == V_PREVIEW} tests if a version is flagged with {@code
* V_PREVIEW}.
*/
int
V_PREVIEW
=
0xFFFF0000
;
// Access flags values, defined in
// - https://docs.oracle.com/javase/specs/jvms/se9/html/jvms-4.html#jvms-4.1-200-E.1
// - https://docs.oracle.com/javase/specs/jvms/se9/html/jvms-4.html#jvms-4.5-200-A.1
// - https://docs.oracle.com/javase/specs/jvms/se9/html/jvms-4.html#jvms-4.6-200-A.1
// -
// https://docs.oracle.com/javase/specs/jvms/se9/html/jvms-4.html#jvms-4.1-200-E.1
// -
// https://docs.oracle.com/javase/specs/jvms/se9/html/jvms-4.html#jvms-4.5-200-A.1
// -
// https://docs.oracle.com/javase/specs/jvms/se9/html/jvms-4.html#jvms-4.6-200-A.1
// - https://docs.oracle.com/javase/specs/jvms/se9/html/jvms-4.html#jvms-4.7.25
int
ACC_PUBLIC
=
0x0001
;
// class, field, method
...
...
@@ -108,14 +112,17 @@ public interface Opcodes {
int
ACC_MODULE
=
0x8000
;
// class
// ASM specific access flags.
// WARNING: the 16 least significant bits must NOT be used, to avoid conflicts with standard
// access flags, and also to make sure that these flags are automatically filtered out when
// WARNING: the 16 least significant bits must NOT be used, to avoid conflicts
// with standard
// access flags, and also to make sure that these flags are automatically
// filtered out when
// written in class files (because access flags are stored using 16 bits only).
int
ACC_DEPRECATED
=
0x20000
;
// class, field, method
// Possible values for the type operand of the NEWARRAY instruction.
// See https://docs.oracle.com/javase/specs/jvms/se9/html/jvms-6.html#jvms-6.5.newarray.
// See
// https://docs.oracle.com/javase/specs/jvms/se9/html/jvms-6.html#jvms-6.5.newarray.
int
T_BOOLEAN
=
4
;
int
T_CHAR
=
5
;
...
...
@@ -126,8 +133,10 @@ public interface Opcodes {
int
T_INT
=
10
;
int
T_LONG
=
11
;
// Possible values for the reference_kind field of CONSTANT_MethodHandle_info structures.
// See https://docs.oracle.com/javase/specs/jvms/se9/html/jvms-4.html#jvms-4.4.8.
// Possible values for the reference_kind field of CONSTANT_MethodHandle_info
// structures.
// See
// https://docs.oracle.com/javase/specs/jvms/se9/html/jvms-4.html#jvms-4.4.8.
int
H_GETFIELD
=
1
;
int
H_GETSTATIC
=
2
;
...
...
@@ -170,7 +179,8 @@ public interface Opcodes {
*/
int
F_SAME1
=
4
;
// Standard stack map frame element types, used in {@link ClassVisitor#visitFrame}.
// Standard stack map frame element types, used in {@link
// ClassVisitor#visitFrame}.
Integer
TOP
=
Frame
.
ITEM_TOP
;
Integer
INTEGER
=
Frame
.
ITEM_INTEGER
;
...
...
@@ -180,7 +190,8 @@ public interface Opcodes {
Integer
NULL
=
Frame
.
ITEM_NULL
;
Integer
UNINITIALIZED_THIS
=
Frame
.
ITEM_UNINITIALIZED_THIS
;
// The JVM opcode values (with the MethodVisitor method name used to visit them in comment, and
// The JVM opcode values (with the MethodVisitor method name used to visit them
// in comment, and
// where '-' means 'same method name as on the previous line').
// See https://docs.oracle.com/javase/specs/jvms/se9/html/jvms-6.html.
...
...
asm/src/test/java/org/objectweb/asm/ClassReaderTest.java
View file @
07fde51b
...
...
@@ -427,14 +427,19 @@ public class ClassReaderTest extends AsmTest implements Opcodes {
0
);
assertTrue
(
success
.
get
());
}
@Test
public
void
testPreviewMinorVersion
()
{
ClassReader
classReader
=
new
ClassReader
(
PrecompiledClass
.
JDK11_LAMBDA_CONDY
.
getBytes
());
classReader
.
accept
(
new
ClassVisitor
(
Opcodes
.
ASM7_EXPERIMENTAL
)
{
@Override
public
void
visit
(
int
version
,
int
access
,
String
name
,
String
signature
,
String
superName
,
public
void
visit
(
int
version
,
int
access
,
String
name
,
String
signature
,
String
superName
,
String
[]
interfaces
)
{
assertTrue
((
version
&
Opcodes
.
V_PREVIEW
)
==
Opcodes
.
V_PREVIEW
);
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment