cvm

package
v0.0.0-...-9fbb145 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 13, 2021 License: MIT Imports: 28 Imported by: 0

Documentation

Index

Constants

View Source
const (
	T_BOOLEAN = 4
	T_CHAR    = 5
	T_FLOAT   = 6
	T_DOUBLE  = 7
	T_BYTE    = 8
	T_SHORT   = 9
	T_INT     = 10
	T_LONG    = 11
)

array component type

View Source
const (
	FAILED        = -1
	UNINITIALIZED = 0
	INITIALIZING  = 1
	INITIALIZED   = 2
)
View Source
const (
	JAVA_LANG_STRING              = "java/lang/String"
	JAVA_LANG_CLASS               = "java/lang/Class"
	JAVA_LANG_REFLECT_FIELD       = "java/lang/reflect/Field"
	JAVA_LANG_REFLECT_CONSTRUCTOR = "java/lang/reflect/Constructor"
	JAVA_LANG_REFLECT_METHOD      = "java/lang/reflect/Method"
	JAVA_LANG_THREAD              = "java/lang/Thread"
)

*

  • Well-known reference types
View Source
const (
	JVM_CLASSFILE_MAJOR_VERSION = 53
	JVM_CLASSFILE_MINOR_VERSION = 0
)

Classfile version number for this information

View Source
const (
	CONSTANT_Class              = 7
	CONSTANT_Fieldref           = 9
	CONSTANT_Methodref          = 10
	CONSTANT_InterfaceMethodref = 11
	CONSTANT_String             = 8
	CONSTANT_Integer            = 3
	CONSTANT_Float              = 4
	CONSTANT_Long               = 5
	CONSTANT_Double             = 6
	CONSTANT_NameAndType        = 12
	CONSTANT_Utf8               = 1
	CONSTANT_MethodHandle       = 15
	CONSTANT_MethodType         = 16
	CONSTANT_InvokeDynamic      = 18
)
View Source
const (
	JVM_ACC_PUBLIC       = 0x0001
	JVM_ACC_PRIVATE      = 0x0002
	JVM_ACC_PROTECTED    = 0x0004
	JVM_ACC_STATIC       = 0x0008
	JVM_ACC_FINAL        = 0x0010
	JVM_ACC_SYNCHRONIZED = 0x0020
	JVM_ACC_SUPER        = 0x0020
	JVM_ACC_VOLATILE     = 0x0040
	JVM_ACC_BRIDGE       = 0x0040
	JVM_ACC_TRANSIENT    = 0x0080
	JVM_ACC_VARARGS      = 0x0080
	JVM_ACC_NATIVE       = 0x0100
	JVM_ACC_INTERFACE    = 0x0200
	JVM_ACC_ABSTRACT     = 0x0400
	JVM_ACC_STRICT       = 0x0800
	JVM_ACC_SYNTHETIC    = 0x1000
	JVM_ACC_ANNOTATION   = 0x2000
	JVM_ACC_ENUM         = 0x4000
)
View Source
const (
	METHOD_ACC_PUBLIC       = JVM_ACC_PUBLIC
	METHOD_ACC_PRIVATE      = JVM_ACC_PRIVATE
	METHOD_ACC_PROTECTED    = JVM_ACC_PROTECTED
	METHOD_ACC_STATIC       = JVM_ACC_STATIC
	METHOD_ACC_FINAL        = JVM_ACC_FINAL
	METHOD_ACC_SYNCHRONIZED = JVM_ACC_SYNCHRONIZED
	METHOD_ACC_BRIDGE       = JVM_ACC_BRIDGE
	METHOD_ACC_VARARGS      = JVM_ACC_VARARGS
	METHOD_ACC_NATIVE       = JVM_ACC_NATIVE
	METHOD_ACC_ABSTRACT     = JVM_ACC_ABSTRACT
	METHOD_ACC_STRICT       = JVM_ACC_STRICT
	METHOD_ACC_SYNTHETIC    = JVM_ACC_SYNTHETIC
)
View Source
const (
	FIELD_ACC_PUBLIC    = JVM_ACC_PUBLIC
	FIELD_ACC_PRIVATE   = JVM_ACC_PRIVATE
	FIELD_ACC_PROTECTED = JVM_ACC_PROTECTED
	FIELD_ACC_STATIC    = JVM_ACC_STATIC
	FIELD_ACC_FINAL     = JVM_ACC_FINAL
	FIELD_ACC_VOLATILE  = JVM_ACC_VOLATILE
	FIELD_ACC_TRANSIENT = JVM_ACC_TRANSIENT
	FIELD_ACC_SYNTHETIC = JVM_ACC_SYNTHETIC
	FIELD_ACC_ENUM      = JVM_ACC_ENUM
)
View Source
const (
	CLASS_ACC_PUBLIC     = JVM_ACC_PUBLIC
	CLASS_ACC_FINAL      = JVM_ACC_FINAL
	CLASS_ACC_SUPER      = JVM_ACC_SUPER
	CLASS_ACC_INTERFACE  = JVM_ACC_INTERFACE
	CLASS_ACC_ABSTRACT   = JVM_ACC_ABSTRACT
	CLASS_ACC_SYNTHETIC  = JVM_ACC_SYNTHETIC
	CLASS_ACC_ANNOTATION = JVM_ACC_ANNOTATION
	CLASS_ACC_ENUM       = JVM_ACC_ENUM
)
View Source
const (
	JVM_T_BOOLEAN = 4
	JVM_T_CHAR    = 5
	JVM_T_FLOAT   = 6
	JVM_T_DOUBLE  = 7
	JVM_T_BYTE    = 8
	JVM_T_SHORT   = 9
	JVM_T_INT     = 10
	JVM_T_LONG    = 11
)
View Source
const (
	JVM_CONSTANT_Utf8               = 1
	JVM_CONSTANT_Unicode            = 2 /* unused */
	JVM_CONSTANT_Integer            = 3
	JVM_CONSTANT_Float              = 4
	JVM_CONSTANT_Long               = 5
	JVM_CONSTANT_Double             = 6
	JVM_CONSTANT_Class              = 7
	JVM_CONSTANT_String             = 8
	JVM_CONSTANT_Fieldref           = 9
	JVM_CONSTANT_Methodref          = 10
	JVM_CONSTANT_InterfaceMethodref = 11
	JVM_CONSTANT_NameAndType        = 12
	JVM_CONSTANT_MethodHandle       = 15 // JSR 292
	JVM_CONSTANT_MethodType         = 16 // JSR 292
	JVM_CONSTANT_InvokeDynamic      = 18
)
View Source
const (
	JVM_REF_getField         = 1
	JVM_REF_getStatic        = 2
	JVM_REF_putField         = 3
	JVM_REF_putStatic        = 4
	JVM_REF_invokeVirtual    = 5
	JVM_REF_invokeStatic     = 6
	JVM_REF_invokeSpecial    = 7
	JVM_REF_newInvokeSpecial = 8
	JVM_REF_invokeInterface  = 9
)

JVM_CONSTANT_MethodHandle subtypes

View Source
const (
	JVM_ITEM_Top               = 0
	JVM_ITEM_Integer           = 1
	JVM_ITEM_Float             = 2
	JVM_ITEM_Double            = 3
	JVM_ITEM_Long              = 4
	JVM_ITEM_Null              = 5
	JVM_ITEM_UninitializedThis = 6
	JVM_ITEM_Object            = 7
	JVM_ITEM_Uninitialized     = 8
)
View Source
const (
	JVM_SIGNATURE_ARRAY    = "["
	JVM_SIGNATURE_BYTE     = "B"
	JVM_SIGNATURE_CHAR     = "C"
	JVM_SIGNATURE_CLASS    = "L"
	JVM_SIGNATURE_ENDCLASS = ";"
	JVM_SIGNATURE_ENUM     = "E"
	JVM_SIGNATURE_FLOAT    = "F"
	JVM_SIGNATURE_DOUBLE   = "D"
	JVM_SIGNATURE_FUNC     = "("
	JVM_SIGNATURE_ENDFUNC  = ")"
	JVM_SIGNATURE_INT      = "I"
	JVM_SIGNATURE_LONG     = "J"
	JVM_SIGNATURE_SHORT    = "S"
	JVM_SIGNATURE_VOID     = "V"
	JVM_SIGNATURE_BOOLEAN  = "Z"
)
View Source
const (
	JVM_OPC_nop             = 0
	JVM_OPC_aconst_null     = 1
	JVM_OPC_iconst_m1       = 2
	JVM_OPC_iconst_0        = 3
	JVM_OPC_iconst_1        = 4
	JVM_OPC_iconst_2        = 5
	JVM_OPC_iconst_3        = 6
	JVM_OPC_iconst_4        = 7
	JVM_OPC_iconst_5        = 8
	JVM_OPC_lconst_0        = 9
	JVM_OPC_lconst_1        = 10
	JVM_OPC_fconst_0        = 11
	JVM_OPC_fconst_1        = 12
	JVM_OPC_fconst_2        = 13
	JVM_OPC_dconst_0        = 14
	JVM_OPC_dconst_1        = 15
	JVM_OPC_bipush          = 16
	JVM_OPC_sipush          = 17
	JVM_OPC_ldc             = 18
	JVM_OPC_ldc_w           = 19
	JVM_OPC_ldc2_w          = 20
	JVM_OPC_iload           = 21
	JVM_OPC_lload           = 22
	JVM_OPC_fload           = 23
	JVM_OPC_dload           = 24
	JVM_OPC_aload           = 25
	JVM_OPC_iload_0         = 26
	JVM_OPC_iload_1         = 27
	JVM_OPC_iload_2         = 28
	JVM_OPC_iload_3         = 29
	JVM_OPC_lload_0         = 30
	JVM_OPC_lload_1         = 31
	JVM_OPC_lload_2         = 32
	JVM_OPC_lload_3         = 33
	JVM_OPC_fload_0         = 34
	JVM_OPC_fload_1         = 35
	JVM_OPC_fload_2         = 36
	JVM_OPC_fload_3         = 37
	JVM_OPC_dload_0         = 38
	JVM_OPC_dload_1         = 39
	JVM_OPC_dload_2         = 40
	JVM_OPC_dload_3         = 41
	JVM_OPC_aload_0         = 42
	JVM_OPC_aload_1         = 43
	JVM_OPC_aload_2         = 44
	JVM_OPC_aload_3         = 45
	JVM_OPC_iaload          = 46
	JVM_OPC_laload          = 47
	JVM_OPC_faload          = 48
	JVM_OPC_daload          = 49
	JVM_OPC_aaload          = 50
	JVM_OPC_baload          = 51
	JVM_OPC_caload          = 52
	JVM_OPC_saload          = 53
	JVM_OPC_istore          = 54
	JVM_OPC_lstore          = 55
	JVM_OPC_fstore          = 56
	JVM_OPC_dstore          = 57
	JVM_OPC_astore          = 58
	JVM_OPC_istore_0        = 59
	JVM_OPC_istore_1        = 60
	JVM_OPC_istore_2        = 61
	JVM_OPC_istore_3        = 62
	JVM_OPC_lstore_0        = 63
	JVM_OPC_lstore_1        = 64
	JVM_OPC_lstore_2        = 65
	JVM_OPC_lstore_3        = 66
	JVM_OPC_fstore_0        = 67
	JVM_OPC_fstore_1        = 68
	JVM_OPC_fstore_2        = 69
	JVM_OPC_fstore_3        = 70
	JVM_OPC_dstore_0        = 71
	JVM_OPC_dstore_1        = 72
	JVM_OPC_dstore_2        = 73
	JVM_OPC_dstore_3        = 74
	JVM_OPC_astore_0        = 75
	JVM_OPC_astore_1        = 76
	JVM_OPC_astore_2        = 77
	JVM_OPC_astore_3        = 78
	JVM_OPC_iastore         = 79
	JVM_OPC_lastore         = 80
	JVM_OPC_fastore         = 81
	JVM_OPC_dastore         = 82
	JVM_OPC_aastore         = 83
	JVM_OPC_bastore         = 84
	JVM_OPC_castore         = 85
	JVM_OPC_sastore         = 86
	JVM_OPC_pop             = 87
	JVM_OPC_pop2            = 88
	JVM_OPC_dup             = 89
	JVM_OPC_dup_x1          = 90
	JVM_OPC_dup_x2          = 91
	JVM_OPC_dup2            = 92
	JVM_OPC_dup2_x1         = 93
	JVM_OPC_dup2_x2         = 94
	JVM_OPC_swap            = 95
	JVM_OPC_iadd            = 96
	JVM_OPC_ladd            = 97
	JVM_OPC_fadd            = 98
	JVM_OPC_dadd            = 99
	JVM_OPC_isub            = 100
	JVM_OPC_lsub            = 101
	JVM_OPC_fsub            = 102
	JVM_OPC_dsub            = 103
	JVM_OPC_imul            = 104
	JVM_OPC_lmul            = 105
	JVM_OPC_fmul            = 106
	JVM_OPC_dmul            = 107
	JVM_OPC_idiv            = 108
	JVM_OPC_ldiv            = 109
	JVM_OPC_fdiv            = 110
	JVM_OPC_ddiv            = 111
	JVM_OPC_irem            = 112
	JVM_OPC_lrem            = 113
	JVM_OPC_frem            = 114
	JVM_OPC_drem            = 115
	JVM_OPC_ineg            = 116
	JVM_OPC_lneg            = 117
	JVM_OPC_fneg            = 118
	JVM_OPC_dneg            = 119
	JVM_OPC_ishl            = 120
	JVM_OPC_lshl            = 121
	JVM_OPC_ishr            = 122
	JVM_OPC_lshr            = 123
	JVM_OPC_iushr           = 124
	JVM_OPC_lushr           = 125
	JVM_OPC_iand            = 126
	JVM_OPC_land            = 127
	JVM_OPC_ior             = 128
	JVM_OPC_lor             = 129
	JVM_OPC_ixor            = 130
	JVM_OPC_lxor            = 131
	JVM_OPC_iinc            = 132
	JVM_OPC_i2l             = 133
	JVM_OPC_i2f             = 134
	JVM_OPC_i2d             = 135
	JVM_OPC_l2i             = 136
	JVM_OPC_l2f             = 137
	JVM_OPC_l2d             = 138
	JVM_OPC_f2i             = 139
	JVM_OPC_f2l             = 140
	JVM_OPC_f2d             = 141
	JVM_OPC_d2i             = 142
	JVM_OPC_d2l             = 143
	JVM_OPC_d2f             = 144
	JVM_OPC_i2b             = 145
	JVM_OPC_i2c             = 146
	JVM_OPC_i2s             = 147
	JVM_OPC_lcmp            = 148
	JVM_OPC_fcmpl           = 149
	JVM_OPC_fcmpg           = 150
	JVM_OPC_dcmpl           = 151
	JVM_OPC_dcmpg           = 152
	JVM_OPC_ifeq            = 153
	JVM_OPC_ifne            = 154
	JVM_OPC_iflt            = 155
	JVM_OPC_ifge            = 156
	JVM_OPC_ifgt            = 157
	JVM_OPC_ifle            = 158
	JVM_OPC_if_icmpeq       = 159
	JVM_OPC_if_icmpne       = 160
	JVM_OPC_if_icmplt       = 161
	JVM_OPC_if_icmpge       = 162
	JVM_OPC_if_icmpgt       = 163
	JVM_OPC_if_icmple       = 164
	JVM_OPC_if_acmpeq       = 165
	JVM_OPC_if_acmpne       = 166
	JVM_OPC_goto            = 167
	JVM_OPC_jsr             = 168
	JVM_OPC_ret             = 169
	JVM_OPC_tableswitch     = 170
	JVM_OPC_lookupswitch    = 171
	JVM_OPC_ireturn         = 172
	JVM_OPC_lreturn         = 173
	JVM_OPC_freturn         = 174
	JVM_OPC_dreturn         = 175
	JVM_OPC_areturn         = 176
	JVM_OPC_return          = 177
	JVM_OPC_getstatic       = 178
	JVM_OPC_putstatic       = 179
	JVM_OPC_getfield        = 180
	JVM_OPC_putfield        = 181
	JVM_OPC_invokevirtual   = 182
	JVM_OPC_invokespecial   = 183
	JVM_OPC_invokestatic    = 184
	JVM_OPC_invokeinterface = 185
	JVM_OPC_invokedynamic   = 186
	JVM_OPC_new             = 187
	JVM_OPC_newarray        = 188
	JVM_OPC_anewarray       = 189
	JVM_OPC_arraylength     = 190
	JVM_OPC_athrow          = 191
	JVM_OPC_checkcast       = 192
	JVM_OPC_instanceof      = 193
	JVM_OPC_monitorenter    = 194
	JVM_OPC_monitorexit     = 195
	JVM_OPC_wide            = 196
	JVM_OPC_multianewarray  = 197
	JVM_OPC_ifnull          = 198
	JVM_OPC_ifnonnull       = 199
	JVM_OPC_goto_w          = 200
	JVM_OPC_jsr_w           = 201
	JVM_OPC_breakpoint      = 202
	JVM_OPC_MAX             = 202
)
View Source
const (
	THROWN_BY_ATHROW  = "thrown by \"athrow\"" // ATHROW instruction
	THROWN_BY_RETHROW = "rethrown"
	THROWN_BY_VM      = "thrown by VM"
)
View Source
const (
	ALL   = 0
	TRACE = 1
	DEBUG = 2
	INFO  = 3
	WARN  = 4
	ERROR = 5
)
View Source
const CLASS_FILE_SUFFIX = ".class"
View Source
const DEFAULT_VM_STACK_SIZE = 512

We choose fix-sized stack size

View Source
const JAR_FILE_SUFFIX = ".jar"

Variables

View Source
var (
	BYTE_TYPE    = &ByteType{}
	CHAR_TYPE    = &CharType{}
	SHORT_TYPE   = &ShortType{}
	INT_TYPE     = &IntType{}
	LONG_TYPE    = &LongType{}
	FLOAT_TYPE   = &FloatType{}
	DOUBLE_TYPE  = &DoubleType{}
	BOOLEAN_TYPE = &BooleanType{}

	RETURN_ADDRESS_TYPE = &ReturnAddressType{}
)

their singletons

View Source
var (
	TRUE  = Boolean(1)
	FALSE = Boolean(0)

	VOID = Void{}
)
View Source
var (
	TRIGGER_BY_JAVA_REFLECTION    = &ClassTriggerReason{"JR", "java reflection from name"}
	TRIGGER_BY_JAVA_CLASSLOADER   = &ClassTriggerReason{"JR", "user defined classloader except bootstrap classloader"}
	TRIGGER_BY_CHECK_OBJECT_TYPE  = &ClassTriggerReason{"CT", "check java object type"}
	TRIGGER_BY_AS_SUPERCLASS      = &ClassTriggerReason{"SC", "as superclass"}
	TRIGGER_BY_AS_SUPERINTERFACE  = &ClassTriggerReason{"SI", "as superinterface"}
	TRIGGER_BY_AS_ARRAY_COMPONENT = &ClassTriggerReason{"AC", "as array component"}
	TRIGGER_BY_RESOLVE_CLASS_REF  = &ClassTriggerReason{"RR", "revolve symbol_ref in constant pool"}
	TRIGGER_BY_NEW_INSTANCE       = &ClassTriggerReason{"NI", "new instance"}
	TRIGGER_BY_ACCESS_MEMBER      = &ClassTriggerReason{"AM", "access field or method"}
)
View Source
var JVM_OPCODE_LENGTH_INITIALIZER = [JVM_OPC_MAX + 1]int{}/* 202 elements not displayed */

Opcode length initializer use with something like: * unsigned char opcode_length[JVM_OPC_MAX+1] = JVM_OPCODE_LENGTH_INITIALIZER;

View Source
var NULL = Reference{nil}
View Source
var VM = NewVM()
View Source
var VM_CurrentPath = ""
View Source
var VM_WG = &sync.WaitGroup{}

Functions

func AALOAD

func AALOAD(t *Thread, f *Frame, c *Class, m *Method)

aaload

== Operation

Load reference from array

== Format

aaload

== Forms

aaload = 50 (0x32)

== Operand Stack

..., arrayref, index →

..., value

== Description

The arrayref must be of type reference and must refer to an array whose components are of type reference. The index must be of type int. Both arrayref and index are popped from the operand stack. The reference value in the component of the array at index is retrieved and pushed onto the operand stack.

== Run-time Exceptions

If arrayref is NULL, aaload throws a NullPointerException.

Otherwise, if index is not within the bounds of the array referenced by arrayref, the aaload instruction throws an ArrayIndexOutOfBoundsException.

50 (0x32)

func AASTORE

func AASTORE(t *Thread, f *Frame, c *Class, m *Method)

83 (0x53)

func ACONST_NULL

func ACONST_NULL(t *Thread, f *Frame, c *Class, m *Method)

01 (0x01)

aconst_null

== Operation

Push NULL

== Format

aconst_null

== Forms

aconst_null = 1 (0x1)

== Operand Stack

... →

..., NULL

== Description

Push the NULL object reference onto the operand stack.

== Notes

The Java Virtual Machine does not mandate a concrete value for NULL.

func ALOAD

func ALOAD(t *Thread, f *Frame, c *Class, m *Method)

aload

== Operation

Load reference from local variable

== Format

aload index

== Forms

aload = 25 (0x19)

== Operand Stack

... →

..., objectref

== Description

The index is an unsigned byte that must be an index into the local variable array of the current this (§2.6). The local variable at index must contain a reference. The objectref in the local variable at index is pushed onto the operand stack.

== Notes

The aload instruction cannot be used to load a value of type returnAddress from a local variable onto the operand stack. This asymmetry with the astore instruction (§astore) is intentional.

The aload opcode can be used in conjunction with the wide instruction (§wide) to access a local variable using a two-byte unsigned index.

25 (0x19)

func ALOAD_0

func ALOAD_0(t *Thread, f *Frame, c *Class, m *Method)

42 (0x2A)

func ALOAD_1

func ALOAD_1(t *Thread, f *Frame, c *Class, m *Method)

43 (0x2B)

func ALOAD_2

func ALOAD_2(t *Thread, f *Frame, c *Class, m *Method)

44 (0x2C)

func ALOAD_3

func ALOAD_3(t *Thread, f *Frame, c *Class, m *Method)

45 (0x2D)

func ANEWARRAY

func ANEWARRAY(t *Thread, f *Frame, c *Class, m *Method)

189 (0xBD)

func ARETURN

func ARETURN(t *Thread, f *Frame, c *Class, m *Method)

176 (0xB0)

func ARRAYLENGTH

func ARRAYLENGTH(t *Thread, f *Frame, c *Class, m *Method)

190 (0xBE)

func ASTORE

func ASTORE(t *Thread, f *Frame, c *Class, m *Method)

astore

== Operation

Store reference into local variable

== Format

astore index

== Forms

astore = 58 (0x3a)

== Operand Stack

..., objectref →

...

== Description

The index is an unsigned byte that must be an index into the local variable array of the current this (§2.6). The objectref on the top of the operand stack must be of type returnAddress or of type reference. It is popped from the operand stack, and the value of the local variable at index is set to objectref.

Notes

The astore instruction is used with an objectref of type returnAddress when implementing the finally clause of the Java programming language (§3.13).

The aload instruction (§aload) cannot be used to load a value of type returnAddress from a local variable onto the operand stack. This asymmetry with the astore instruction is intentional.

The astore opcode can be used in conjunction with the wide instruction (§wide) to access a local variable using a two-byte unsigned index.

58 (0x3A)

func ASTORE_0

func ASTORE_0(t *Thread, f *Frame, c *Class, m *Method)

75 (0x4B)

func ASTORE_1

func ASTORE_1(t *Thread, f *Frame, c *Class, m *Method)

76 (0x4C)

func ASTORE_2

func ASTORE_2(t *Thread, f *Frame, c *Class, m *Method)

77 (0x4D)

func ASTORE_3

func ASTORE_3(t *Thread, f *Frame, c *Class, m *Method)

78 (0x4E)

func ATHROW

func ATHROW(t *Thread, f *Frame, c *Class, m *Method)

191 (0xBF)

func Assert

func Assert(expression bool, format string, args ...interface{})

func BALOAD

func BALOAD(t *Thread, f *Frame, c *Class, m *Method)

baload

== Operation

Load byte or boolean from array

== Format

baload

== Forms

baload = 51 (0x33)

== Operand Stack

..., arrayref, index →

..., value

== Description

The arrayref must be of type reference and must refer to an array whose components are of type byte or of type boolean. The index must be of type int. Both arrayref and index are popped from the operand stack. The byte value in the component of the array at index is retrieved, sign-extended to an int value, and pushed onto the top of the operand stack.

== Run-time Exceptions

If arrayref is NULL, baload throws a NullPointerException.

Otherwise, if index is not within the bounds of the array referenced by arrayref, the baload instruction throws an ArrayIndexOutOfBoundsException.

== Notes

The baload instruction is used to load values from both byte and boolean arrays. In Oracle's Java Virtual Machine implementation, boolean arrays - that is, arrays of type T_BOOLEAN (§2.2, §newarray) - are implemented as arrays of 8-bit values. Other implementations may implement packed boolean arrays; the baload instruction of such implementations must be used to access those arrays.

51 (0x33)

func BASTORE

func BASTORE(t *Thread, f *Frame, c *Class, m *Method)

84 (0x54)

func BIPUSH

func BIPUSH(t *Thread, f *Frame, c *Class, m *Method)

bipush

== Operation

Push byte

== Format

bipush byte

== Forms

bipush = 16 (0x10)

== Operand Stack

... →

..., value

== Description

The immediate byte is sign-extended to an int value. That value is pushed onto the operand stack.

16 (0x10)

func BREAKPOINT

func BREAKPOINT(t *Thread, f *Frame, c *Class, m *Method)

202 (0xCA)

func Bug

func Bug(format string, args ...interface{})

func CALOAD

func CALOAD(t *Thread, f *Frame, c *Class, m *Method)

caload

== Operation

Load char from array

== Format

caload

== Forms

caload = 52 (0x34)

== Operand Stack

..., arrayref, index →

..., value

== Description

The arrayref must be of type reference and must refer to an array whose components are of type char. The index must be of type int. Both arrayref and index are popped from the operand stack. The component of the array at index is retrieved and zero-extended to an int value. That value is pushed onto the operand stack.

== Run-time Exceptions

If arrayref is NULL, caload throws a NullPointerException.

Otherwise, if index is not within the bounds of the array referenced by arrayref, the caload instruction throws an ArrayIndexOutOfBoundsException.

52 (0x34)

func CASTORE

func CASTORE(t *Thread, f *Frame, c *Class, m *Method)

85 (0x55)

func CHECKCAST

func CHECKCAST(t *Thread, f *Frame, c *Class, m *Method)

192 (0xC0)

func CVM_init

func CVM_init(registerNative func())

func D2F

func D2F(t *Thread, f *Frame, c *Class, m *Method)

d2f

== Operation

Convert double to float

== Format

d2f

== Forms

d2f = 144 (0x90)

== Operand Stack

..., value →

..., result

== Description

The value on the top of the operand stack must be of type double. It is popped from the operand stack and undergoes value set conversion (§2.8.3) resulting in value'. Then value' is converted to a float result using IEEE 754 round to nearest mode. The result is pushed onto the operand stack.

Where an d2f instruction is FP-strict (§2.8.2), the result of the conversion is always rounded to the nearest representable value in the float value set (§2.3.2).

Where an d2f instruction is not FP-strict, the result of the conversion may be taken from the float-extended-exponent value set (§2.3.2); it is not necessarily rounded to the nearest representable value in the float value set.

A finite value' too small to be represented as a float is converted to a zero of the same sign; a finite value' too large to be represented as a float is converted to an infinity of the same sign. A double NaN is converted to a float NaN.

== Notes

The d2f instruction performs a narrowing primitive conversion (JLS §5.1.3). It may lose information about the overall magnitude of value' and may also lose precision.

144 (0x90)

func D2I

func D2I(t *Thread, f *Frame, c *Class, m *Method)

d2i

== Operation

Convert double to int

== Format

d2i

== Forms

d2i = 142 (0x8e)

== Operand Stack

..., value →

..., result

== Description

The value on the top of the operand stack must be of type double. It is popped from the operand stack and undergoes value set conversion (§2.8.3) resulting in value'. Then value' is converted to an int. The result is pushed onto the operand stack:

If the value' is NaN, the result of the conversion is an int 0.

Otherwise, if the value' is not an infinity, it is rounded to an integer value V, rounding towards zero using IEEE 754 round towards zero mode. If this integer value V can be represented as an int, then the result is the int value V.

Otherwise, either the value' must be too small (a negative value of large magnitude or negative infinity), and the result is the smallest representable value of type int, or the value' must be too large (a positive value of large magnitude or positive infinity), and the result is the largest representable value of type int.

== Notes

The d2i instruction performs a narrowing primitive conversion (JLS §5.1.3). It may lose information about the overall magnitude of value' and may also lose precision.

142 (0x8E)

func D2L

func D2L(t *Thread, f *Frame, c *Class, m *Method)

d2l

== Operation

Convert double to long

== Format

d2l

== Forms

d2l = 143 (0x8f)

== Operand Stack

..., value →

..., result

== Description

The value on the top of the operand stack must be of type double. It is popped from the operand stack and undergoes value set conversion (§2.8.3) resulting in value'. Then value' is converted to a long. The result is pushed onto the operand stack: If the value' is NaN, the result of the conversion is a long 0.

Otherwise, if the value' is not an infinity, it is rounded to an integer value V, rounding towards zero using IEEE 754 round towards zero mode. If this integer value V can be represented as a long, then the result is the long value V.

Otherwise, either the value' must be too small (a negative value of large magnitude or negative infinity), and the result is the smallest representable value of type long, or the value' must be too large (a positive value of large magnitude or positive infinity), and the result is the largest representable value of type long.

== Notes

The d2l instruction performs a narrowing primitive conversion (JLS §5.1.3). It may lose information about the overall magnitude of value' and may also lose precision.

143 (0x8F)

func DADD

func DADD(t *Thread, f *Frame, c *Class, m *Method)

99 (0x63)

func DALOAD

func DALOAD(t *Thread, f *Frame, c *Class, m *Method)

daload

== Operation

Load double from array

== Format

daload

== Forms

daload = 49 (0x31)

== Operand Stack

..., arrayref, index →

..., value

== Description

The arrayref must be of type reference and must refer to an array whose components are of type double. The index must be of type int. Both arrayref and index are popped from the operand stack. The double value in the component of the array at index is retrieved and pushed onto the operand stack.

== Run-time Exceptions

If arrayref is NULL, daload throws a NullPointerException.

Otherwise, if index is not within the bounds of the array referenced by arrayref, the daload instruction throws an ArrayIndexOutOfBoundsException.

49 (0x31)

func DASTORE

func DASTORE(t *Thread, f *Frame, c *Class, m *Method)

82 (0x52)

func DCMPG

func DCMPG(t *Thread, f *Frame, c *Class, m *Method)

152 (0x98)

func DCMPL

func DCMPL(t *Thread, f *Frame, c *Class, m *Method)

151 (0x97)

func DCONST_0

func DCONST_0(t *Thread, f *Frame, c *Class, m *Method)

14 (0x0E)

func DCONST_1

func DCONST_1(t *Thread, f *Frame, c *Class, m *Method)

15 (0x0F)

func DDIV

func DDIV(t *Thread, f *Frame, c *Class, m *Method)

111 (0x6F)

func DLOAD

func DLOAD(t *Thread, f *Frame, c *Class, m *Method)

dload

== Operation

Load double from local variable

== Format

dload index

== Forms

dload = 24 (0x18)

== Operand Stack

... →

..., value

== Description

The index is an unsigned byte. Both index and index+1 must be indices into the local variable array of the current this (§2.6). The local variable at index must contain a double. The value of the local variable at index is pushed onto the operand stack.

Notes

The dload opcode can be used in conjunction with the wide instruction (§wide) to access a local variable using a two-byte unsigned index.

24 (0x18)

func DLOAD_0

func DLOAD_0(t *Thread, f *Frame, c *Class, m *Method)

38 (0x26)

func DLOAD_1

func DLOAD_1(t *Thread, f *Frame, c *Class, m *Method)

39 (0x27)

func DLOAD_2

func DLOAD_2(t *Thread, f *Frame, c *Class, m *Method)

40 (0x28)

func DLOAD_3

func DLOAD_3(t *Thread, f *Frame, c *Class, m *Method)

41 (0x29)

func DMUL

func DMUL(t *Thread, f *Frame, c *Class, m *Method)

107 (0x6B)

func DNEG

func DNEG(t *Thread, f *Frame, c *Class, m *Method)

119 (0x77)

func DREM

func DREM(t *Thread, f *Frame, c *Class, m *Method)

115 (0x73)

func DRETURN

func DRETURN(t *Thread, f *Frame, c *Class, m *Method)

175 (0xAF)

func DSTORE

func DSTORE(t *Thread, f *Frame, c *Class, m *Method)

dstore

== Operation

Store double into local variable

== Format

dstore index

== Forms

dstore = 57 (0x39)

== Operand Stack

..., value →

...

== Description

The index is an unsigned byte. Both index and index+1 must be indices into the local variable array of the current this (§2.6). The value on the top of the operand stack must be of type double. It is popped from the operand stack and undergoes value set conversion (§2.8.3), resulting in value'. The local variables at index and index+1 are set to value'.

== Notes

The dstore opcode can be used in conjunction with the wide instruction (§wide) to access a local variable using a two-byte unsigned index.

57 (0x39)

func DSTORE_0

func DSTORE_0(t *Thread, f *Frame, c *Class, m *Method)

dstore_<n>

== Operation

Store double into local variable

== Format

dstore_<n>

== Forms

dstore_0 = 71 (0x47)

dstore_1 = 72 (0x48)

dstore_2 = 73 (0x49)

dstore_3 = 74 (0x4a)

Operand Stack

..., value →

...

== Description

Both <n> and <n>+1 must be indices into the local variable array of the current this (§2.6). The value on the top of the operand stack must be of type double. It is popped from the operand stack and undergoes value set conversion (§2.8.3), resulting in value'. The local variables at <n> and <n>+1 are set to value'.

== Notes

Each of the dstore_<n> instructions is the same as dstore with an index of <n>, except that the operand <n> is implicit.

71 (0x47)

func DSTORE_1

func DSTORE_1(t *Thread, f *Frame, c *Class, m *Method)

72 (0x48)

func DSTORE_2

func DSTORE_2(t *Thread, f *Frame, c *Class, m *Method)

73 (0x49)

func DSTORE_3

func DSTORE_3(t *Thread, f *Frame, c *Class, m *Method)

74 (0x4A)

func DSUB

func DSUB(t *Thread, f *Frame, c *Class, m *Method)

103 (0x67)

func DUP

func DUP(t *Thread, f *Frame, c *Class, m *Method)

89 (0x59)

func DUP2

func DUP2(t *Thread, f *Frame, c *Class, m *Method)

92 (0x5C)

func DUP2_X1

func DUP2_X1(t *Thread, f *Frame, c *Class, m *Method)

93 (0x5D)

func DUP2_X2

func DUP2_X2(t *Thread, f *Frame, c *Class, m *Method)

94 (0x5E)

func DUP_X1

func DUP_X1(t *Thread, f *Frame, c *Class, m *Method)

90 (0x5A)

func DUP_X2

func DUP_X2(t *Thread, f *Frame, c *Class, m *Method)

91 (0x5B)

func F2D

func F2D(t *Thread, f *Frame, c *Class, m *Method)

f2d

== Operation

Convert float to double

== Format

f2d

== Forms

f2d = 141 (0x8d)

== Operand Stack

..., value →

..., result

== Description

The value on the top of the operand stack must be of type float. It is popped from the operand stack and undergoes value

set conversion (§2.8.3), resulting in value'. Then value' is converted to a double result. This result is pushed onto
the operand stack.

== Notes

Where an f2d instruction is FP-strict (§2.8.2) it performs a widening primitive conversion (JLS §5.1.2). Because all values of the float value set (§2.3.2) are exactly representable by values of the double value set (§2.3.2), such a conversion is exact.

Where an f2d instruction is not FP-strict, the result of the conversion may be taken from the double-extended-exponent value set; it is not necessarily rounded to the nearest representable value in the double value set. However, if the operand value is taken from the float-extended-exponent value set and the target result is constrained to the double value set, rounding of value may be required.

141 (0x8D)

func F2I

func F2I(t *Thread, f *Frame, c *Class, m *Method)

f2i

== Operation

Convert float to int

== Format

f2i

== Forms

f2i = 139 (0x8b)

== Operand Stack

..., value →

..., result

== Description

The value on the top of the operand stack must be of type float. It is popped from the operand stack and undergoes value set conversion (§2.8.3), resulting in value'. Then value' is converted to an int result. This result is pushed onto the operand stack:

  • If the value' is NaN, the result of the conversion is an int 0.
  • Otherwise, if the value' is not an infinity, it is rounded to an integer value V, rounding towards zero using IEEE 754 round towards zero mode. If this integer value V can be represented as an int, then the result is the int value V.
  • Otherwise, either the value' must be too small (a negative value of large magnitude or negative infinity), and the result is the smallest representable value of type int, or the value' must be too large (a positive value of large magnitude or positive infinity), and the result is the largest representable value of type int.

== Notes

The f2i instruction performs a narrowing primitive conversion (JLS §5.1.3). It may lose information about the overall magnitude of value' and may also lose precision.

139 (0x8B)

func F2L

func F2L(t *Thread, f *Frame, c *Class, m *Method)

f2l

== Operation

Convert float to long

== Format

f2l

== Forms

f2l = 140 (0x8c)

== Operand Stack

..., value →

..., result

== Description

The value on the top of the operand stack must be of type float. It is popped from the operand stack and undergoes value set conversion (§2.8.3), resulting in value'. Then value' is converted to a long result. This result is pushed onto the operand stack:

  • If the value' is NaN, the result of the conversion is a long 0.
  • Otherwise, if the value' is not an infinity, it is rounded to an integer value V, rounding towards zero using IEEE 754 round towards zero mode. If this integer value V can be represented as a long, then the result is the long value V.
  • Otherwise, either the value' must be too small (a negative value of large magnitude or negative infinity), and the result is the smallest representable value of type long, or the value' must be too large (a positive value of large magnitude or positive infinity), and the result is the largest representable value of type long.

== Notes

The f2l instruction performs a narrowing primitive conversion (JLS §5.1.3). It may lose information about the overall magnitude of value' and may also lose precision.

140 (0x8C)

func FADD

func FADD(t *Thread, f *Frame, c *Class, m *Method)

98 (0x62)

func FALOAD

func FALOAD(t *Thread, f *Frame, c *Class, m *Method)

faload

== Operation

Load float from array

== Format

faload

== Forms

faload = 48 (0x30)

== Operand Stack

..., arrayref, index →

..., value

== Description

The arrayref must be of type reference and must refer to an array whose components are of type float. The index must be of type int. Both arrayref and index are popped from the operand stack. The float value in the component of the array at index is retrieved and pushed onto the operand stack.

Run-time Exceptions

If arrayref is NULL, faload throws a NullPointerException.

Otherwise, if index is not within the bounds of the array referenced by arrayref, the faload instruction throws an ArrayIndexOutOfBoundsException.

48 (0x30)

func FASTORE

func FASTORE(t *Thread, f *Frame, c *Class, m *Method)

81 (0x51)

func FCMPG

func FCMPG(t *Thread, f *Frame, c *Class, m *Method)

150 (0x96)

func FCMPL

func FCMPL(t *Thread, f *Frame, c *Class, m *Method)

149 (0x95)

func FCONST_0

func FCONST_0(t *Thread, f *Frame, c *Class, m *Method)

11 (0x0B)

func FCONST_1

func FCONST_1(t *Thread, f *Frame, c *Class, m *Method)

12 (0x0C)

func FCONST_2

func FCONST_2(t *Thread, f *Frame, c *Class, m *Method)

13 (0x0D)

func FDIV

func FDIV(t *Thread, f *Frame, c *Class, m *Method)

110 (0x6E)

func FLOAD

func FLOAD(t *Thread, f *Frame, c *Class, m *Method)

fload

== Operation

Load float from local variable

== Format

fload index

== Forms

fload = 23 (0x17)

== Operand Stack

... →

..., value

== Description

The index is an unsigned byte that must be an index into the local variable array of the current this (§2.6). The local variable at index must contain a float. The value of the local variable at index is pushed onto the operand stack.

== Notes

The fload opcode can be used in conjunction with the wide instruction (§wide) to access a local variable using a two-byte unsigned index.

23 (0x17)

func FLOAD_0

func FLOAD_0(t *Thread, f *Frame, c *Class, m *Method)

34 (0x22)

func FLOAD_1

func FLOAD_1(t *Thread, f *Frame, c *Class, m *Method)

35 (0x23)

func FLOAD_2

func FLOAD_2(t *Thread, f *Frame, c *Class, m *Method)

36 (0x24)

func FLOAD_3

func FLOAD_3(t *Thread, f *Frame, c *Class, m *Method)

37 (0x25)

func FMUL

func FMUL(t *Thread, f *Frame, c *Class, m *Method)

106 (0x6A)

func FNEG

func FNEG(t *Thread, f *Frame, c *Class, m *Method)

118 (0x76)

func FREM

func FREM(t *Thread, f *Frame, c *Class, m *Method)

114 (0x72)

func FRETURN

func FRETURN(t *Thread, f *Frame, c *Class, m *Method)

174 (0xAE)

func FSTORE

func FSTORE(t *Thread, f *Frame, c *Class, m *Method)

fstore

== Operation

Store float into local variable

== Format

fstore index

== Forms

fstore = 56 (0x38)

== Operand Stack

..., value →

...

== Description

The index is an unsigned byte that must be an index into the local variable array of the current this (§2.6). The value on the top of the operand stack must be of type float. It is popped from the operand stack and undergoes value set conversion (§2.8.3), resulting in value'. The value of the local variable at index is set to value'.

== Notes

The fstore opcode can be used in conjunction with the wide instruction (§wide) to access a local variable using a two-byte unsigned index.

56 (0x38)

func FSTORE_0

func FSTORE_0(t *Thread, f *Frame, c *Class, m *Method)

fstore_<n>

== Operation

Store float into local variable

== Format

fstore_<n>

== Forms

fstore_0 = 67 (0x43)

fstore_1 = 68 (0x44)

fstore_2 = 69 (0x45)

fstore_3 = 70 (0x46)

== Operand Stack

..., value →

...

== Description

The <n> must be an index into the local variable array of the current this (§2.6). The value on the top of the operand stack must be of type float. It is popped from the operand stack and undergoes value set conversion (§2.8.3), resulting in value'. The value of the local variable at <n> is set to value'.

Notes

Each of the fstore_<n> instructions is the same as fstore with an index of <n>, except that the operand <n> is implicit.

67 (0x43)

func FSTORE_1

func FSTORE_1(t *Thread, f *Frame, c *Class, m *Method)

68 (0x44)

func FSTORE_2

func FSTORE_2(t *Thread, f *Frame, c *Class, m *Method)

69 (0x45)

func FSTORE_3

func FSTORE_3(t *Thread, f *Frame, c *Class, m *Method)

70 (0x46)

func FSUB

func FSUB(t *Thread, f *Frame, c *Class, m *Method)

102 (0x66)

func Fatal

func Fatal(format string, args ...interface{})

func GETFIELD

func GETFIELD(t *Thread, f *Frame, c *Class, m *Method)

180 (0xB4)

func GETSTATIC

func GETSTATIC(t *Thread, f *Frame, c *Class, m *Method)

178 (0xB2)

func GOTO

func GOTO(t *Thread, f *Frame, c *Class, m *Method)

167 (0xA7)

func GOTO_W

func GOTO_W(t *Thread, f *Frame, c *Class, m *Method)

200 (0xC8)

func I2B

func I2B(t *Thread, f *Frame, c *Class, m *Method)

i2b

== Operation

Convert int to byte

== Format

i2b

== Forms

i2b = 145 (0x91)

== Operand Stack

..., value →

..., result

== Description

The value on the top of the operand stack must be of type int. It is popped from the operand stack, truncated to a byte,

then sign-extended to an int result. That result is pushed onto the operand stack.

== Notes

The i2b instruction performs a narrowing primitive conversion (JLS §5.1.3). It may lose information about the overall magnitude of value. The result may also not have the same sign as value.

145 (0x91)

func I2C

func I2C(t *Thread, f *Frame, c *Class, m *Method)

i2c

== Operation

Convert int to char

== Format

i2c

== Forms

i2c = 146 (0x92)

== Operand Stack

..., value →

..., result

== Description

The value on the top of the operand stack must be of type int. It is popped from the operand stack, truncated to char, then zero-extended to an int result. That result is pushed onto the operand stack.

== Notes

The i2c instruction performs a narrowing primitive conversion (JLS §5.1.3). It may lose information about the overall magnitude of value. The result (which is always positive) may also not have the same sign as value.

146 (0x92)

func I2D

func I2D(t *Thread, f *Frame, c *Class, m *Method)

i2d

== Operation

Convert int to double

== Format

i2d

== Forms

i2d = 135 (0x87)

== Operand Stack

..., value →

..., result

== Description

The value on the top of the operand stack must be of type int. It is popped from the operand stack and converted to a double result. The result is pushed onto the operand stack.

== Notes

The i2d instruction performs a widening primitive conversion (JLS §5.1.2). Because all values of type int are exactly representable by type double, the conversion is exact.

135 (0x87)

func I2F

func I2F(t *Thread, f *Frame, c *Class, m *Method)

i2f

== Operation

Convert int to float

== Format

i2f

== Forms

i2f = 134 (0x86)

== Operand Stack

..., value →

..., result

== Description

The value on the top of the operand stack must be of type int. It is popped from the operand stack and converted to the float result using IEEE 754 round to nearest mode. The result is pushed onto the operand stack.

== Notes

The i2f instruction performs a widening primitive conversion (JLS §5.1.2), but may result in a loss of precision because values of type float have only 24 significand bits.

134 (0x86)

func I2L

func I2L(t *Thread, f *Frame, c *Class, m *Method)

i2l

== Operation

Convert int to long

== Format

i2l

== Forms

i2l = 133 (0x85)

== Operand Stack

..., value →

..., result

== Description

The value on the top of the operand stack must be of type int. It is popped from the operand stack and sign-extended to a long result. That result is pushed onto the operand stack.

== Notes

The i2l instruction performs a widening primitive conversion (JLS §5.1.2). Because all values of type int are exactly representable by type long, the conversion is exact.

133 (0x85)

func I2S

func I2S(t *Thread, f *Frame, c *Class, m *Method)

i2s

== Operation

Convert int to short

== Format

i2s

== Forms

i2s = 147 (0x93)

== Operand Stack

..., value →

..., result

== Description

The value on the top of the operand stack must be of type int. It is popped from the operand stack, truncated to a short, then sign-extended to an int result. That result is pushed onto the operand stack.

== Notes

The i2s instruction performs a narrowing primitive conversion (JLS §5.1.3). It may lose information about the overall magnitude of value. The result may also not have the same sign as value.

147 (0x93)

func IADD

func IADD(t *Thread, f *Frame, c *Class, m *Method)

96 (0x60)

func IALOAD

func IALOAD(t *Thread, f *Frame, c *Class, m *Method)

iaload

== Operation

Load int from array

== Format

iaload

== Forms

iaload = 46 (0x2e)

== Operand Stack

..., arrayref, index →

..., value

== Description

The arrayref must be of type reference and must refer to an array whose components are of type int. The index must be of type int. Both arrayref and index are popped from the operand stack. The int value in the component

of the array at index is retrieved and pushed onto the operand stack.

== Run-time Exceptions

If arrayref is NULL, iaload throws a NullPointerException.

Otherwise, if index is not within the bounds of the array referenced by arrayref, the iaload instruction throws an ArrayIndexOutOfBoundsException.

46 (0x2E)

func IAND

func IAND(t *Thread, f *Frame, c *Class, m *Method)

126 (0x7E)

func IASTORE

func IASTORE(t *Thread, f *Frame, c *Class, m *Method)

79 (0x4F)

func ICONST_0

func ICONST_0(t *Thread, f *Frame, c *Class, m *Method)

03 (0x03)

func ICONST_1

func ICONST_1(t *Thread, f *Frame, c *Class, m *Method)

04 (0x04)

func ICONST_2

func ICONST_2(t *Thread, f *Frame, c *Class, m *Method)

05 (0x05)

func ICONST_3

func ICONST_3(t *Thread, f *Frame, c *Class, m *Method)

06 (0x06)

func ICONST_4

func ICONST_4(t *Thread, f *Frame, c *Class, m *Method)

07 (0x07)

func ICONST_5

func ICONST_5(t *Thread, f *Frame, c *Class, m *Method)

08 (0x08)

func ICONST_M1

func ICONST_M1(t *Thread, f *Frame, c *Class, m *Method)

02 (0x02)

func IDIV

func IDIV(t *Thread, f *Frame, c *Class, m *Method)

108 (0x6C)

func IFEQ

func IFEQ(t *Thread, f *Frame, c *Class, m *Method)

153 (0x99)

func IFGE

func IFGE(t *Thread, f *Frame, c *Class, m *Method)

156 (0x9C)

func IFGT

func IFGT(t *Thread, f *Frame, c *Class, m *Method)

157 (0x9D)

func IFLE

func IFLE(t *Thread, f *Frame, c *Class, m *Method)

158 (0x9E)

func IFLT

func IFLT(t *Thread, f *Frame, c *Class, m *Method)

155 (0x9B)

func IFNE

func IFNE(t *Thread, f *Frame, c *Class, m *Method)

154 (0x9A)

func IFNONNULL

func IFNONNULL(t *Thread, f *Frame, c *Class, m *Method)

199 (0xC7)

func IFNULL

func IFNULL(t *Thread, f *Frame, c *Class, m *Method)

198 (0xC6)

func IF_ACMPEQ

func IF_ACMPEQ(t *Thread, f *Frame, c *Class, m *Method)

165 (0xA5)

func IF_ACMPNE

func IF_ACMPNE(t *Thread, f *Frame, c *Class, m *Method)

166 (0xA6)

func IF_ICMPEQ

func IF_ICMPEQ(t *Thread, f *Frame, c *Class, m *Method)

159 (0x9F)

func IF_ICMPGE

func IF_ICMPGE(t *Thread, f *Frame, c *Class, m *Method)

162 (0xA2)

func IF_ICMPGT

func IF_ICMPGT(t *Thread, f *Frame, c *Class, m *Method)

163 (0xA3)

func IF_ICMPLE

func IF_ICMPLE(t *Thread, f *Frame, c *Class, m *Method)

164 (0xA4)

func IF_ICMPLT

func IF_ICMPLT(t *Thread, f *Frame, c *Class, m *Method)

161 (0xA1)

func IF_ICMPNE

func IF_ICMPNE(t *Thread, f *Frame, c *Class, m *Method)

160 (0xA0)

func IINC

func IINC(t *Thread, f *Frame, c *Class, m *Method)

132 (0x84)

func ILOAD

func ILOAD(t *Thread, f *Frame, c *Class, m *Method)

iload

== Operation

Load int from local variable

== Format

iload index

== Forms

iload = 21 (0x15)

== Operand Stack

... →

..., value

== Description

The index is an unsigned byte that must be an index into the local variable array of the current this (§2.6). The local variable at index must contain an int. The value of the local variable at index is pushed onto the operand stack.

== Notes

The iload opcode can be used in conjunction with the wide instruction (§wide) to access a local variable using a two-byte unsigned index.

21 (0x15)

func ILOAD_0

func ILOAD_0(t *Thread, f *Frame, c *Class, m *Method)

26 (0x1A)

func ILOAD_1

func ILOAD_1(t *Thread, f *Frame, c *Class, m *Method)

27 (0x1B)

func ILOAD_2

func ILOAD_2(t *Thread, f *Frame, c *Class, m *Method)

28 (0x1C)

func ILOAD_3

func ILOAD_3(t *Thread, f *Frame, c *Class, m *Method)

29 (0x1D)

func IMPDEP1

func IMPDEP1(t *Thread, f *Frame, c *Class, m *Method)

254 (0xFE)

func IMPDEP2

func IMPDEP2(t *Thread, f *Frame, c *Class, m *Method)

255 (0xFF)

func IMUL

func IMUL(t *Thread, f *Frame, c *Class, m *Method)

104 (0x68)

func INEG

func INEG(t *Thread, f *Frame, c *Class, m *Method)

116 (0x74)

func INSTANCEOF

func INSTANCEOF(t *Thread, f *Frame, c *Class, m *Method)

193 (0xC1)

func INVOKEDYNAMIC

func INVOKEDYNAMIC(t *Thread, f *Frame, c *Class, m *Method)

186 (0xBA)

func INVOKEINTERFACE

func INVOKEINTERFACE(t *Thread, f *Frame, c *Class, m *Method)

185 (0xB9)

func INVOKESPECIAL

func INVOKESPECIAL(t *Thread, f *Frame, c *Class, m *Method)

like invokevirtual with objectref, but don't find along the inheritance 183 (0xB7)

func INVOKESTATIC

func INVOKESTATIC(t *Thread, f *Frame, c *Class, m *Method)

184 (0xB8)

func INVOKEVIRTUAL

func INVOKEVIRTUAL(t *Thread, f *Frame, c *Class, m *Method)

182 (0xB6)

func IOR

func IOR(t *Thread, f *Frame, c *Class, m *Method)

128 (0x80)

func IREM

func IREM(t *Thread, f *Frame, c *Class, m *Method)

112 (0x70)

func IRETURN

func IRETURN(t *Thread, f *Frame, c *Class, m *Method)

172 (0xAC)

func ISHL

func ISHL(t *Thread, f *Frame, c *Class, m *Method)

120 (0x78)

func ISHR

func ISHR(t *Thread, f *Frame, c *Class, m *Method)

122 (0x7A)

func ISTORE

func ISTORE(t *Thread, f *Frame, c *Class, m *Method)

istore

== Operation

Store int into local variable

== Format

istore index

== Forms

istore = 54 (0x36)

== Operand Stack

..., value →

...

== Description

The index is an unsigned byte that must be an index into the local variable array of the current this (§2.6). The value on the top of the operand stack must be of type int. It is popped from the operand stack, and the value of the local variable at index is set to value.

== Notes

The istore opcode can be used in conjunction with the wide instruction (§wide) to access a local variable using a two-byte unsigned index.

54 (0x36)

func ISTORE_0

func ISTORE_0(t *Thread, f *Frame, c *Class, m *Method)

59 (0x3B)

func ISTORE_1

func ISTORE_1(t *Thread, f *Frame, c *Class, m *Method)

60 (0x3C)

func ISTORE_2

func ISTORE_2(t *Thread, f *Frame, c *Class, m *Method)

61 (0x3D)

func ISTORE_3

func ISTORE_3(t *Thread, f *Frame, c *Class, m *Method)

62 (0x3E)

func ISUB

func ISUB(t *Thread, f *Frame, c *Class, m *Method)

100 (0x64)

func IUSHR

func IUSHR(t *Thread, f *Frame, c *Class, m *Method)

124 (0x7C)

func IXOR

func IXOR(t *Thread, f *Frame, c *Class, m *Method)

130 (0x82)

func IsHidden

func IsHidden(filename string) (bool, error)

func JDK_jang_lang_Class_registerNatives

func JDK_jang_lang_Class_registerNatives()

private static void registerNatives()

func JDK_jang_lang_Object_registerNatives

func JDK_jang_lang_Object_registerNatives()

private static void registerNatives()

func JDK_jang_lang_Thread_registerNatives

func JDK_jang_lang_Thread_registerNatives()

private static void registerNatives()

func JDK_java_io_FileDescriptor_initIDs

func JDK_java_io_FileDescriptor_initIDs()

private static void registers()

func JDK_java_io_FileInputStream_close0

func JDK_java_io_FileInputStream_close0(this Reference)

func JDK_java_io_FileInputStream_initIDs

func JDK_java_io_FileInputStream_initIDs()

func JDK_java_io_FileInputStream_open0

func JDK_java_io_FileInputStream_open0(this Reference, name JavaLangString)

func JDK_java_io_FileOutputStream_initIDs

func JDK_java_io_FileOutputStream_initIDs()

----------------------------------------------------------------------------------------------

func JDK_java_io_FileOutputStream_writeBytes

func JDK_java_io_FileOutputStream_writeBytes(this Reference, byteArr ArrayRef, offset Int, length Int, append Boolean)

func JDK_java_io_MemCheck

func JDK_java_io_MemCheck() bool

func JDK_java_io_MemGetLength

func JDK_java_io_MemGetLength() int64

func JDK_java_io_MemRead

func JDK_java_io_MemRead(buf []byte, offset int64) (int, error)

func JDK_java_io_UnixFileSystem_initIDs

func JDK_java_io_UnixFileSystem_initIDs()

----------------------------------------------------------------------------------------------

func JDK_java_lang_ClassLoader_NativeLibrary_load

func JDK_java_lang_ClassLoader_NativeLibrary_load(this JavaLangClassLoader, name JavaLangString, flag Boolean)

func JDK_java_lang_ClassLoader_registerNatives

func JDK_java_lang_ClassLoader_registerNatives()

func JDK_java_lang_Object_notifyAll

func JDK_java_lang_Object_notifyAll(this Reference)

func JDK_java_lang_Object_wait

func JDK_java_lang_Object_wait(this Reference, millis Long)

func JDK_java_lang_System_arraycopy

func JDK_java_lang_System_arraycopy(src ArrayRef, srcPos Int, dest ArrayRef, destPos Int, length Int)

public static void arraycopy(Object fromArray, int fromIndex, Object toArray, int toIndex, int length)

func JDK_java_lang_System_registerNatives

func JDK_java_lang_System_registerNatives()

private static void registers()

func JDK_java_lang_System_setErr0

func JDK_java_lang_System_setErr0(ps ObjectRef)

private static void setErr0(PrintStream ps)

func JDK_java_lang_System_setIn0

func JDK_java_lang_System_setIn0(is ObjectRef)

private static void setIn0(InputStream is)

func JDK_java_lang_System_setOut0

func JDK_java_lang_System_setOut0(ps ObjectRef)

private static void setOut0(PrintStream ps)

func JDK_java_lang_Thread_interrupt0

func JDK_java_lang_Thread_interrupt0(this JavaLangThread)

func JDK_java_lang_Thread_setPriority0

func JDK_java_lang_Thread_setPriority0(this Reference, priority Int)

func JDK_java_lang_Thread_sleep

func JDK_java_lang_Thread_sleep(millis Long)

func JDK_java_lang_Thread_start0

func JDK_java_lang_Thread_start0(this Reference)

func JDK_java_util_zip_ZipFile_initIDs

func JDK_java_util_zip_ZipFile_initIDs()

func JDK_sun_misc_Unsafe_ensureClassInitialized

func JDK_sun_misc_Unsafe_ensureClassInitialized(this Reference, class JavaLangClass)

func JDK_sun_misc_Unsafe_freeMemory

func JDK_sun_misc_Unsafe_freeMemory(this Reference, size Long)

func JDK_sun_misc_Unsafe_putLong

func JDK_sun_misc_Unsafe_putLong(this Reference, address Long, val Long)

func JDK_sun_misc_Unsafe_putObjectVolatile

func JDK_sun_misc_Unsafe_putObjectVolatile(this Reference, obj Reference, offset Long, val Reference)

func JDK_sun_misc_Unsafe_registerNatives

func JDK_sun_misc_Unsafe_registerNatives()

private static void registerNatives()

func JDK_sun_misc_VM_initialize

func JDK_sun_misc_VM_initialize()

----------------------------------------------------------------------------------------------------------------

func JSR

func JSR(t *Thread, f *Frame, c *Class, m *Method)

168 (0xA8)

func JSR_W

func JSR_W(t *Thread, f *Frame, c *Class, m *Method)

201 (0xC9)

func JavaName2BinaryName0

func JavaName2BinaryName0(name string) string

func L2D

func L2D(t *Thread, f *Frame, c *Class, m *Method)

l2d

== Operation

Convert long to double

== Format

l2d

== Forms

l2d = 138 (0x8a)

== Operand Stack

..., value →

..., result

== Description

The value on the top of the operand stack must be of type long. It is popped from the operand stack and converted to a double result using IEEE 754 round to nearest mode. The result is pushed onto the operand stack.

== Notes

The l2d instruction performs a widening primitive conversion (JLS §5.1.2) that may lose precision because values of type double have only 53 significand bits.

138 (0x8A)

func L2F

func L2F(t *Thread, f *Frame, c *Class, m *Method)

l2f

== Operation

Convert long to float

== Format

l2f

== Forms

l2f = 137 (0x89)

== Operand Stack

..., value →

..., result

== Description

The value on the top of the operand stack must be of type long. It is popped from the operand stack and converted to a float result using IEEE 754 round to nearest mode. The result is pushed onto the operand stack.

Notes

The l2f instruction performs a widening primitive conversion (JLS §5.1.2) that may lose precision because values of type float have only 24 significand bits.

137 (0x89)

func L2I

func L2I(t *Thread, f *Frame, c *Class, m *Method)

l2i

== Operation

Convert long to int

== Format

l2i

== Forms

l2i = 136 (0x88)

== Operand Stack

..., value →

..., result

== Description

The value on the top of the operand stack must be of type long. It is popped from the operand stack and converted to an int result by taking the low-order 32 bits of the long value and discarding the high-order 32 bits. The result is pushed onto the operand stack.

== Notes

The l2i instruction performs a narrowing primitive conversion (JLS §5.1.3). It may lose information about the overall magnitude of value. The result may also not have the same sign as value.

136 (0x88)

func LADD

func LADD(t *Thread, f *Frame, c *Class, m *Method)

97 (0x61)

func LALOAD

func LALOAD(t *Thread, f *Frame, c *Class, m *Method)

laload

== Operation

Load long from array

== Format

laload

== Forms

laload = 47 (0x2f)

== Operand Stack

..., arrayref, index →

..., value

== Description

The arrayref must be of type reference and must refer to an array whose components are of type long. The index must be of type int. Both arrayref and index are popped from the operand stack. The long value in the component of the array at index is retrieved and pushed onto the operand stack.

== Run-time Exceptions

If arrayref is NULL, laload throws a NullPointerException.

Otherwise, if index is not within the bounds of the array referenced by arrayref, the laload instruction throws an ArrayIndexOutOfBoundsException.

47 (0x2F)

func LAND

func LAND(t *Thread, f *Frame, c *Class, m *Method)

127 (0x7F)

func LASTORE

func LASTORE(t *Thread, f *Frame, c *Class, m *Method)

80 (0x50)

func LCMP

func LCMP(t *Thread, f *Frame, c *Class, m *Method)

148 (0x94)

== Operation

Compare long

== Format

lcmp

== Forms

lcmp = 148 (0x94)

== Operand Stack

..., value1, value2 →

..., result

== Description

Both value1 and value2 must be of type long. They are both popped from the operand stack, and a signed integer comparison is performed. If value1 is greater than value2, the int value 1 is pushed onto the operand stack. If value1 is equal to value2, the int value 0 is pushed onto the operand stack. If value1 is less than value2, the int value -1 is pushed onto the operand stack.

func LCONST_0

func LCONST_0(t *Thread, f *Frame, c *Class, m *Method)

09 (0x09)

func LCONST_1

func LCONST_1(t *Thread, f *Frame, c *Class, m *Method)

10 (0x0A)

func LDC

func LDC(t *Thread, f *Frame, c *Class, m *Method)

ldc

== Operation

Push item from run-time constant pool

== Format

ldc index

== Forms

ldc = 18 (0x12)

== Operand Stack

... →

..., value

== Description

The index is an unsigned byte that must be a valid index into the run-time constant pool of the current class (§2.6). The run-time constant pool entry at index either must be a run-time constant of type int or float, or a reference to a string literal, or a symbolic reference to a class, method type, or method handle (§5.1).

If the run-time constant pool entry is a run-time constant of type int or float, the numeric value of that run-time constant is pushed onto the operand stack as an int or float, respectively.

Otherwise, if the run-time constant pool entry is a reference to an instance of class String representing a string literal (§5.1), then a reference to that instance, value, is pushed onto the operand stack.

Otherwise, if the run-time constant pool entry is a symbolic reference to a class (§5.1), then the named class is resolved (§5.4.3.1) and a reference to the Class object representing that class, value, is pushed onto the operand stack.

Otherwise, the run-time constant pool entry must be a symbolic reference to a method type or a method handle (§5.1). The method type or method handle is resolved (§5.4.3.5) and a reference to the resulting instance of java.lang.invoke.MethodType or java.lang.invoke.MethodHandle, value, is pushed onto the operand stack.

== Linking Exceptions

During resolution of a symbolic reference to a class, any of the exceptions pertaining to class resolution (§5.4.3.1) can be thrown.

During resolution of a symbolic reference to a method type or method handle, any of the exception pertaining to method type or method handle resolution (§5.4.3.5) can be thrown.

== Notes

The ldc instruction can only be used to push a value of type float taken from the float value set (§2.3.2) because a constant of type float in the constant pool (§4.4.4) must be taken from the float value set.

18 (0x12)

func LDC2_W

func LDC2_W(t *Thread, f *Frame, c *Class, m *Method)

ldc2_w

== Operation

Push long or double from run-time constant pool (wide index)

== Format

ldc2_w indexbyte1 indexbyte2

== Forms

ldc2_w = 20 (0x14)

== Operand Stack

... →

..., value

== Description

The unsigned indexbyte1 and indexbyte2 are assembled into an unsigned 16-bit index into the run-time constant pool of the current class (§2.6), where the value of the index is calculated as (indexbyte1 << 8) | indexbyte2. The index must be a valid index into the run-time constant pool of the current class. The run-time constant pool entry at the index must be a run-time constant of type long or double (§5.1). The numeric value of that run-time constant is pushed onto the operand stack as a long or double, respectively.

== Notes

Only a wide-index version of the ldc2_w instruction exists; there is no ldc2 instruction that pushes a long or double with a single-byte index.

The ldc2_w instruction can only be used to push a value of type double taken from the double value set (§2.3.2) because a constant of type double in the constant pool (§4.4.5) must be taken from the double value set.

20 (0x14)

func LDC_W

func LDC_W(t *Thread, f *Frame, c *Class, m *Method)

ldc_w

== Operation

Push item from run-time constant pool (wide index)

== Format

ldc_w indexbyte1 indexbyte2

== Forms

ldc_w = 19 (0x13)

== Operand Stack

... →

..., value

== Description

The unsigned indexbyte1 and indexbyte2 are assembled into an unsigned 16-bit index into the run-time constant pool of the current class (§2.6), where the value of the index is calculated as (indexbyte1 << 8) | indexbyte2. The index must be a valid index into the run-time constant pool of the current class. The run-time constant pool entry at the index either must be a run-time constant of type int or float, or a reference to a string literal, or a symbolic reference to a class, method type, or method handle (§5.1).

If the run-time constant pool entry is a run-time constant of type int or float, the numeric value of that run-time constant is pushed onto the operand stack as an int or float, respectively.

Otherwise, if the run-time constant pool entry is a reference to an instance of class String representing a string literal (§5.1), then a reference to that instance, value, is pushed onto the operand stack.

Otherwise, if the run-time constant pool entry is a symbolic reference to a class (§4.4.1). The named class is resolved

(§5.4.3.1) and a reference to the Class object representing that class, value, is pushed onto the operand stack.

Otherwise, the run-time constant pool entry must be a symbolic reference to a method type or a method handle (§5.1). The method type or method handle is resolved (§5.4.3.5) and a reference to the resulting instance of java.lang.invoke.MethodType or java.lang.invoke.MethodHandle, value, is pushed onto the operand stack.

== Linking Exceptions

During resolution of the symbolic reference to a class, any of the exceptions pertaining to class resolution (§5.4.3.1) can be thrown.

During resolution of a symbolic reference to a method type or method handle, any of the exception pertaining to method type or method handle resolution (§5.4.3.5) can be thrown.

== Notes

The ldc_w instruction is identical to the ldc instruction (§ldc) except for its wider run-time constant pool index.

The ldc_w instruction can only be used to push a value of type float taken from the float value set (§2.3.2) because a constant of type float in the constant pool (§4.4.4) must be taken from the float value set.

19 (0x13)

func LDIV

func LDIV(t *Thread, f *Frame, c *Class, m *Method)

109 (0x6D)

func LLOAD

func LLOAD(t *Thread, f *Frame, c *Class, m *Method)

lload

== Operation

Load long from local variable

== Format

lload index

== Forms

lload = 22 (0x16)

== Operand Stack

... →

..., value

== Description

The index is an unsigned byte. Both index and index+1 must be indices into the local variable array of the current this (§2.6). The local variable at index must contain a long. The value of the local variable at index is pushed onto

the operand stack.

Notes

The lload opcode can be used in conjunction with the wide instruction (§wide) to access a local variable using a two-byte unsigned index.

22 (0x16)

func LLOAD_0

func LLOAD_0(t *Thread, f *Frame, c *Class, m *Method)

30 (0x1E)

func LLOAD_1

func LLOAD_1(t *Thread, f *Frame, c *Class, m *Method)

31 (0x1F)

func LLOAD_2

func LLOAD_2(t *Thread, f *Frame, c *Class, m *Method)

32 (0x20)

func LLOAD_3

func LLOAD_3(t *Thread, f *Frame, c *Class, m *Method)

33 (0x21)

func LMUL

func LMUL(t *Thread, f *Frame, c *Class, m *Method)

105 (0x69)

func LNEG

func LNEG(t *Thread, f *Frame, c *Class, m *Method)

117 (0x75)

func LOOKUPSWITCH

func LOOKUPSWITCH(t *Thread, f *Frame, c *Class, m *Method)

171 (0xAB)

func LOR

func LOR(t *Thread, f *Frame, c *Class, m *Method)

129 (0x81)

func LREM

func LREM(t *Thread, f *Frame, c *Class, m *Method)

113 (0x71)

func LRETURN

func LRETURN(t *Thread, f *Frame, c *Class, m *Method)

173 (0xAD)

func LSHL

func LSHL(t *Thread, f *Frame, c *Class, m *Method)

121 (0x79)

func LSHR

func LSHR(t *Thread, f *Frame, c *Class, m *Method)

123 (0x7B)

func LSTORE

func LSTORE(t *Thread, f *Frame, c *Class, m *Method)

lstore

== Operation

Store long into local variable

== Format

lstore index

== Forms

lstore = 55 (0x37)

== Operand Stack

..., value →

...

== Description

The index is an unsigned byte. Both index and index+1 must be indices into the local variable array of the current this (§2.6). The value on the top of the operand stack must be of type long. It is popped from the operand stack, and the local variables at index and index+1 are set to value.

== Notes

The lstore opcode can be used in conjunction with the wide instruction (§wide) to access a local variable using a two-byte unsigned index.

55 (0x37)

func LSTORE_0

func LSTORE_0(t *Thread, f *Frame, c *Class, m *Method)

lstore_<n>

== Operation

Store long into local variable

== Format

lstore_<n>

== Forms

lstore_0 = 63 (0x3f)

lstore_1 = 64 (0x40)

lstore_2 = 65 (0x41)

lstore_3 = 66 (0x42)

== Operand Stack

..., value →

...

== Description

Both <n> and <n>+1 must be indices into the local variable array of the current this (§2.6). The value on the top of the operand stack must be of type long. It is popped from the operand stack, and the local variables at <n> and <n>+1 are set to value.

== Notes

Each of the lstore_<n> instructions is the same as lstore with an index of <n>, except that the operand <n> is implicit.

63 (0x3F)

func LSTORE_1

func LSTORE_1(t *Thread, f *Frame, c *Class, m *Method)

64 (0x40)

func LSTORE_2

func LSTORE_2(t *Thread, f *Frame, c *Class, m *Method)

65 (0x41)

func LSTORE_3

func LSTORE_3(t *Thread, f *Frame, c *Class, m *Method)

66 (0x42)

func LSUB

func LSUB(t *Thread, f *Frame, c *Class, m *Method)

101 (0x65)

func LUSHR

func LUSHR(t *Thread, f *Frame, c *Class, m *Method)

125 (0x7D)

func LXOR

func LXOR(t *Thread, f *Frame, c *Class, m *Method)

131 (0x83)

func MONITORENTER

func MONITORENTER(t *Thread, f *Frame, c *Class, m *Method)

194 (0xC2)

func MONITOREXIT

func MONITOREXIT(t *Thread, f *Frame, c *Class, m *Method)

195 (0xC3)

func MULTIANEWARRAY

func MULTIANEWARRAY(t *Thread, f *Frame, c *Class, m *Method)

197 (0xC5)

func NEW

func NEW(t *Thread, f *Frame, c *Class, m *Method)

187 (0xBB)

func NEWARRAY

func NEWARRAY(t *Thread, f *Frame, c *Class, m *Method)

188 (0xBC)

func NOP

func NOP(t *Thread, f *Frame, c *Class, m *Method)

00 (0x00)

func POP

func POP(t *Thread, f *Frame, c *Class, m *Method)

87 (0x57)

func POP2

func POP2(t *Thread, f *Frame, c *Class, m *Method)

88 (0x58)

func PUTFIELD

func PUTFIELD(t *Thread, f *Frame, c *Class, m *Method)

181 (0xB5)

func PUTSTATIC

func PUTSTATIC(t *Thread, f *Frame, c *Class, m *Method)

179 (0xB3)

func RET

func RET(t *Thread, f *Frame, c *Class, m *Method)

169 (0xA9)

func RETURN

func RETURN(t *Thread, f *Frame, c *Class, m *Method)

177 (0xB1)

func SALOAD

func SALOAD(t *Thread, f *Frame, c *Class, m *Method)

saload

== Operation

Load short from array

== Format

saload

== Forms

saload = 53 (0x35)

== Operand Stack

..., arrayref, index →

..., value

== Description

The arrayref must be of type reference and must refer to an array whose components are of type short. The index must be of type int. Both arrayref and index are popped from the operand stack. The component of the array at index is retrieved and sign-extended to an int value. That value is pushed onto the operand stack.

== Run-time Exceptions

If arrayref is NULL, saload throws a NullPointerException.

Otherwise, if index is not within the bounds of the array referenced by arrayref, the saload instruction throws an ArrayIndexOutOfBoundsException.

53 (0x35)

func SASTORE

func SASTORE(t *Thread, f *Frame, c *Class, m *Method)

86 (0x56)

func SIPUSH

func SIPUSH(t *Thread, f *Frame, c *Class, m *Method)

sipush

== Operation

Push short

== Format

sipush byte1 byte2

== Forms

sipush = 17 (0x11)

== Operand Stack

... →

..., value

== Description

The immediate unsigned byte1 and byte2 values are assembled into an intermediate short, where the value of the short is (byte1 << 8) | byte2. The intermediate value is then sign-extended to an int value. That value is pushed onto the operand stack.

17 (0x11)

func SWAP

func SWAP(t *Thread, f *Frame, c *Class, m *Method)

95 (0x5F)

func TABLESWITCH

func TABLESWITCH(t *Thread, f *Frame, c *Class, m *Method)

170 (0xAA)

func WIDE

func WIDE(t *Thread, f *Frame, c *Class, m *Method)

196 (0xC4)

Types

type Annotation

type Annotation struct {
	// contains filtered or unexported fields
}
annotation {
    u2 type_index;
    u2 num_element_value_pairs;
    {   u2            element_name_index;
        element_value value;
    } element_value_pairs[num_element_value_pairs];
}

type ArrayRef

type ArrayRef = Reference

func JDK_java_lang_Class_getDeclaredConstructors0

func JDK_java_lang_Class_getDeclaredConstructors0(this JavaLangClass, publicOnly Boolean) ArrayRef

func JDK_java_lang_Class_getDeclaredFields0

func JDK_java_lang_Class_getDeclaredFields0(this JavaLangClass, publicOnly Boolean) ArrayRef

func JDK_java_lang_Class_getEnclosingMethod0

func JDK_java_lang_Class_getEnclosingMethod0(this JavaLangClass) ArrayRef

func JDK_java_lang_reflect_Array_newArray

func JDK_java_lang_reflect_Array_newArray(componentClassObject JavaLangClass, length Int) ArrayRef

func JDK_sun_misc_URLClassPath_getLookupCacheURLs

func JDK_sun_misc_URLClassPath_getLookupCacheURLs(classloader JavaLangClassLoader) ArrayRef

func (ArrayRef) ArrayElements

func (this ArrayRef) ArrayElements() []Value

func (ArrayRef) ArrayLength

func (this ArrayRef) ArrayLength() Int

func (ArrayRef) GetArrayElement

func (this ArrayRef) GetArrayElement(index Int) Value

func (ArrayRef) SetArrayElement

func (this ArrayRef) SetArrayElement(index Int, value Value)

type AttributeInfo

type AttributeInfo interface {
	// contains filtered or unexported methods
}
attribute_info {
    u2 attribute_name_index;
    u4 attribute_length;
    u1 info[attribute_length];
}

type Block

type Block struct {
	// contains filtered or unexported fields
}

A Java try {} catch() {} finally {} block

func (Block) Do

func (tcf Block) Do()

type Boolean

type Boolean Byte // for boolean array, store as byte array. For other instruction, regarded as int

func JDK_java_lang_Class_desiredAssertionStatus0

func JDK_java_lang_Class_desiredAssertionStatus0(clazz JavaLangClass) Boolean

private static boolean desiredAssertionStatus0(Class javaClass)

func JDK_java_lang_Class_isArray

func JDK_java_lang_Class_isArray(this JavaLangClass) Boolean

func JDK_java_lang_Class_isAssignableFrom

func JDK_java_lang_Class_isAssignableFrom(this JavaLangClass, cls JavaLangClass) Boolean

func JDK_java_lang_Class_isInterface

func JDK_java_lang_Class_isInterface(this JavaLangClass) Boolean

func JDK_java_lang_Class_isPrimitive

func JDK_java_lang_Class_isPrimitive(this JavaLangClass) Boolean

func JDK_java_lang_Thread_isAlive

func JDK_java_lang_Thread_isAlive(this Reference) Boolean

func JDK_java_lang_Thread_isInterrupted

func JDK_java_lang_Thread_isInterrupted(this JavaLangThread, clearInterrupted Boolean) Boolean

func JDK_java_util_concurrent_atomic_AtomicLong_VMSupportsCS8

func JDK_java_util_concurrent_atomic_AtomicLong_VMSupportsCS8() Boolean

func JDK_sun_misc_Unsafe_compareAndSwapInt

func JDK_sun_misc_Unsafe_compareAndSwapInt(this Reference, obj Reference, offset Long, expected Int, newVal Int) Boolean

func JDK_sun_misc_Unsafe_compareAndSwapLong

func JDK_sun_misc_Unsafe_compareAndSwapLong(this Reference, obj Reference, offset Long, expected Long, newVal Long) Boolean

func JDK_sun_misc_Unsafe_compareAndSwapObject

func JDK_sun_misc_Unsafe_compareAndSwapObject(this Reference, obj Reference, offset Long, expected Reference, newVal Reference) Boolean

func (Boolean) IsFalse

func (this Boolean) IsFalse() bool

func (Boolean) IsTrue

func (this Boolean) IsTrue() bool

func (Boolean) ToInt

func (this Boolean) ToInt() Int

func (Boolean) Type

func (this Boolean) Type() Type

type BooleanType

type BooleanType struct {
	// contains filtered or unexported fields
}

func (*BooleanType) ClassObject

func (this *BooleanType) ClassObject() JavaLangClass

func (*BooleanType) Descriptor

func (this *BooleanType) Descriptor() string

func (*BooleanType) Name

func (this *BooleanType) Name() string

type BootstrapClassLoader

type BootstrapClassLoader struct {
	*Logger
	// contains filtered or unexported fields
}

func (*BootstrapClassLoader) LoadClass

func (this *BootstrapClassLoader) LoadClass(N string, triggerReason *ClassTriggerReason) *Class

type Byte

type Byte int8

func JDK_sun_misc_Unsafe_getByte

func JDK_sun_misc_Unsafe_getByte(this Reference, address Long) Byte

func (Byte) Type

func (this Byte) Type() Type

type ByteType

type ByteType struct {
	// contains filtered or unexported fields
}

func (*ByteType) ClassObject

func (this *ByteType) ClassObject() JavaLangClass

func (*ByteType) Descriptor

func (this *ByteType) Descriptor() string

func (*ByteType) Name

func (this *ByteType) Name() string

type CVM

type CVM struct {
	SystemSettings
	*ExecutionEngine
	*MethodArea
	*Heap
	*OS
	*LoggerFactory
	*Logger

	Classloader JavaLangClassLoader

	In      interface{}
	TotalPc int
	// contains filtered or unexported fields
}

func NewVM

func NewVM() *CVM

func (*CVM) InitMe

func (this *CVM) InitMe()

Before vm initialization, all lot of system settings can be set.

func (*CVM) StarMain

func (this *CVM) StarMain(memCode []byte, className string) string

func (*CVM) StartFunction

func (this *CVM) StartFunction(memCode []byte, className, methodName string, javaArgs []byte) string

type Char

type Char uint16

func (Char) Type

func (this Char) Type() Type

type CharType

type CharType struct {
	// contains filtered or unexported fields
}

func (*CharType) ClassObject

func (this *CharType) ClassObject() JavaLangClass

func (*CharType) Descriptor

func (this *CharType) Descriptor() string

func (*CharType) Name

func (this *CharType) Name() string

type Class

type Class struct {
	T  *Thread
	LC *sync.Cond
	// contains filtered or unexported fields
}

func (*Class) ClassObject

func (this *Class) ClassObject() JavaLangClass

func (*Class) Descriptor

func (this *Class) Descriptor() string

func (*Class) FindField

func (this *Class) FindField(name string, descriptor string) *Field

*

  • Find field with its name and descriptor in the class hierarchy
  • Java doesn't permit a static and instance field with same name + signature

func (*Class) FindMethod

func (this *Class) FindMethod(name string, descriptor string) *Method

*

  • Find field with its name and descriptor in the class hierarchy
  • Java doesn't permit a static and instance method with same name + signature

func (*Class) GetClassInitializer

func (this *Class) GetClassInitializer() *Method

<clinit>()V method

func (*Class) GetConstructor

func (this *Class) GetConstructor(descriptor string) *Method

func (*Class) GetConstructors

func (this *Class) GetConstructors(publicOnly bool) []*Method

<init>(..)V methods

func (*Class) GetDeclaredFields

func (this *Class) GetDeclaredFields(publicOnly bool) []*Field

func (*Class) GetMethod

func (this *Class) GetMethod(name string, descriptor string) *Method

Only find its own defined method

func (*Class) GetStaticVariable

func (this *Class) GetStaticVariable(name string, descriptor string) Value

func (*Class) IsArray

func (this *Class) IsArray() bool

func (*Class) IsAssignableFrom

func (this *Class) IsAssignableFrom(class *Class) bool

func (*Class) IsInterface

func (this *Class) IsInterface() bool

func (*Class) Name

func (this *Class) Name() string

func (*Class) SetStaticVariable

func (this *Class) SetStaticVariable(name string, descriptor string, value Value)

type ClassFile

type ClassFile struct {
	// contains filtered or unexported fields
}
ClassFile {
	u4				magic;
	u2 				minor_version;
	u2 				major_version;
	u2 				constant_pool_count;
	cp_info 		constant_pool[constant_pool_count-1];
	u2 				access_flags;
	u2 				this_class;
	u2 				super_class;
	u2 				interfaces_count;
	u2 				interfaces[interfaces_count];
	u2 				fields_count;
	field_info 		fields[fields_count];
	u2 				methods_count;
	method_info 	methods[methods_count];
	u2 				attributes_count;
	attribute_info 	attributes[attributes_count];
}

type ClassPath

type ClassPath struct {
	// contains filtered or unexported fields
}

func NewClassPath

func NewClassPath(classPathStr string) *ClassPath

func (*ClassPath) ReadClass

func (this *ClassPath) ReadClass(className string) ([]byte, error)

func (*ClassPath) String

func (this *ClassPath) String() string

type ClassPathEntry

type ClassPathEntry interface {
	String() string
	// contains filtered or unexported methods
}

type ClassReader

type ClassReader struct {
	// contains filtered or unexported fields
}

type ClassRef

type ClassRef struct {
	// contains filtered or unexported fields
}

func (*ClassRef) ResolvedClass

func (this *ClassRef) ResolvedClass() *Class

type ClassTriggerReason

type ClassTriggerReason struct {
	// contains filtered or unexported fields
}

type CodeAttribute

type CodeAttribute struct {
	// contains filtered or unexported fields
}
Code_attribute {
    u2 attribute_name_index;
    u4 attribute_length;
    u2 max_stack;
    u2 max_locals;
    u4 code_length;
    u1 code[code_length];
    u2 exception_table_length;
    {   u2 start_pc;
        u2 end_pc;
        u2 handler_pc;
        u2 catch_type;
    } exception_table[exception_table_length];
    u2 attributes_count;
    attribute_info attributes[attributes_count];
}

type Constant

type Constant interface{}

*

  • Runtime constant pool

type ConstantClassInfo

type ConstantClassInfo struct {
	// contains filtered or unexported fields
}
CONSTANT_Class_info {
    u1 tag;
    u2 name_index;
}

type ConstantDoubleInfo

type ConstantDoubleInfo struct {
	// contains filtered or unexported fields
}
CONSTANT_Double_info {
    u1 tag;
    u4 high_bytes;
    u4 low_bytes;
}

type ConstantFieldrefInfo

type ConstantFieldrefInfo struct {
	// contains filtered or unexported fields
}
CONSTANT_Fieldref_info {
    u1 tag;
    u2 class_index;
    u2 name_and_type_index;
}

type ConstantFloatInfo

type ConstantFloatInfo struct {
	// contains filtered or unexported fields
}
CONSTANT_Float_info {
    u1 tag;
    u4 bytes;
}

type ConstantIntegerInfo

type ConstantIntegerInfo struct {
	// contains filtered or unexported fields
}
CONSTANT_Integer_info {
    u1 tag;
    u4 bytes;
}

type ConstantInterfaceMethodrefInfo

type ConstantInterfaceMethodrefInfo struct {
	// contains filtered or unexported fields
}
CONSTANT_InterfaceMethodref_info {
    u1 tag;
    u2 class_index;
    u2 name_and_type_index;
}

type ConstantInvokeDynamicInfo

type ConstantInvokeDynamicInfo struct {
	// contains filtered or unexported fields
}
CONSTANT_InvokeDynamic_info {
    u1 tag;
    u2 bootstrap_method_attr_index;
    u2 name_and_type_index;
}

type ConstantLongInfo

type ConstantLongInfo struct {
	// contains filtered or unexported fields
}
CONSTANT_Long_info {
    u1 tag;
    u4 high_bytes;
    u4 low_bytes;
}

type ConstantMethodHandleInfo

type ConstantMethodHandleInfo struct {
	// contains filtered or unexported fields
}
CONSTANT_MethodHandle_info {
    u1 tag;
    u1 reference_kind;
    u2 reference_index;
}

type ConstantMethodTypeInfo

type ConstantMethodTypeInfo struct {
	// contains filtered or unexported fields
}
CONSTANT_MethodType_info {
    u1 tag;
    u2 descriptor_index;
}

type ConstantMethodrefInfo

type ConstantMethodrefInfo struct {
	// contains filtered or unexported fields
}
CONSTANT_Methodref_info {
    u1 tag;
    u2 class_index;
    u2 name_and_type_index;
}

type ConstantNameAndTypeInfo

type ConstantNameAndTypeInfo struct {
	// contains filtered or unexported fields
}
CONSTANT_NameAndType_info {
    u1 tag;
    u2 name_index;
    u2 descriptor_index;
}

type ConstantPoolInfo

type ConstantPoolInfo interface {
	// contains filtered or unexported methods
}
cp_info {
    u1 tag;
    u1 info[];
}

type ConstantStringInfo

type ConstantStringInfo struct {
	// contains filtered or unexported fields
}
CONSTANT_String_info {
    u1 tag;
    u2 string_index;
}

type ConstantUtf8Info

type ConstantUtf8Info struct {
	// contains filtered or unexported fields
}
CONSTANT_Utf8_info {
    u1 tag;
    u2 length;
    u1 bytes[length];
}

type DirectoryClassPathEntry

type DirectoryClassPathEntry struct {
	// contains filtered or unexported fields
}

func (*DirectoryClassPathEntry) String

func (this *DirectoryClassPathEntry) String() string

type Double

type Double float64

func JDK_jang_lang_Double_longBitsToDouble

func JDK_jang_lang_Double_longBitsToDouble(bits Long) Double

public static native int floatToRawIntBits(float value)

func JDK_java_lang_StrictMath_pow

func JDK_java_lang_StrictMath_pow(base Double, exponent Double) Double

private static void registers()

func (Double) Type

func (this Double) Type() Type

type DoubleConstant

type DoubleConstant struct {
	// contains filtered or unexported fields
}

type DoubleType

type DoubleType struct {
	// contains filtered or unexported fields
}

func (*DoubleType) ClassObject

func (this *DoubleType) ClassObject() JavaLangClass

func (*DoubleType) Descriptor

func (this *DoubleType) Descriptor() string

func (*DoubleType) Name

func (this *DoubleType) Name() string

type ElementValue

type ElementValue struct {
	// contains filtered or unexported fields
}

type ExceptionHandler

type ExceptionHandler struct {
	// contains filtered or unexported fields
}

type ExceptionTableEntry

type ExceptionTableEntry struct {
	// contains filtered or unexported fields
}

func (*ExceptionTableEntry) ReadInfo

func (this *ExceptionTableEntry) ReadInfo(reader *ClassReader)

type ExecutionEngine

type ExecutionEngine struct {
	InstructionRegistry
	NativeMethodRegistry
	// contains filtered or unexported fields
}

func (*ExecutionEngine) CurrentClass

func (this *ExecutionEngine) CurrentClass() *Class

func (*ExecutionEngine) CurrentThread

func (this *ExecutionEngine) CurrentThread() *Thread

func (*ExecutionEngine) InvokeMethod

func (this *ExecutionEngine) InvokeMethod(method *Method, params ...Value) Value

This method is used to run a method and return value (even void method return a void value)

func (*ExecutionEngine) InvokeMethodOf

func (this *ExecutionEngine) InvokeMethodOf(className string, methodName string, methodDescriptor string, params ...Value) Value

func (*ExecutionEngine) NewThread

func (this *ExecutionEngine) NewThread(name string, run func(), exitHook func()) *Thread

func (*ExecutionEngine) RegisterThread

func (this *ExecutionEngine) RegisterThread(thread *Thread)

func (*ExecutionEngine) RunBootstrapThread

func (this *ExecutionEngine) RunBootstrapThread(run func())

func (*ExecutionEngine) Throw

func (this *ExecutionEngine) Throw(exception string, message string, args ...interface{})

func (*ExecutionEngine) Throw0

func (this *ExecutionEngine) Throw0(throwable Reference, thrownReason string)

The whole project should use panic only here !!!!!

func (*ExecutionEngine) UnregisterThread

func (this *ExecutionEngine) UnregisterThread(thread *Thread)

type Field

type Field struct {
	// contains filtered or unexported fields
}

func (*Field) IsStatic

func (this *Field) IsStatic() bool

func (*Field) Qualifier

func (this *Field) Qualifier() string

func (*Field) Signature

func (this *Field) Signature() string

type FieldInfo

type FieldInfo struct {
	// contains filtered or unexported fields
}
field_info {
    u2             access_flags;
    u2             name_index;
    u2             descriptor_index;
    u2             attributes_count;
    attribute_info attributes[attributes_count];
}

type FieldRef

type FieldRef struct {
	MemberRef
	// contains filtered or unexported fields
}

func (*FieldRef) ResolvedField

func (this *FieldRef) ResolvedField() *Field

type Float

type Float float32

func JDK_java_lang_Float_intBitsToFloat

func JDK_java_lang_Float_intBitsToFloat(bits Int) Float

func (Float) Type

func (this Float) Type() Type

type FloatConstant

type FloatConstant struct {
	// contains filtered or unexported fields
}

type FloatType

type FloatType struct {
	// contains filtered or unexported fields
}

func (*FloatType) ClassObject

func (this *FloatType) ClassObject() JavaLangClass

func (*FloatType) Descriptor

func (this *FloatType) Descriptor() string

func (*FloatType) Name

func (this *FloatType) Name() string

type Frame

type Frame struct {
	// contains filtered or unexported fields
}
type Header struct {
	// contains filtered or unexported fields
}

type Heap

type Heap struct {
}

func (*Heap) NewArray

func (this *Heap) NewArray(arrayClass *Class, length Int) ArrayRef

func (*Heap) NewArrayOfComponent

func (this *Heap) NewArrayOfComponent(arrayComponentType Type, length Int) ArrayRef

func (*Heap) NewArrayOfName

func (this *Heap) NewArrayOfName(arrayClassName string, length Int) ArrayRef

arrayClassName is the full array class, not its component type

func (*Heap) NewJavaLangClass

func (this *Heap) NewJavaLangClass(type0 Type) JavaLangClass

func (*Heap) NewJavaLangReflectConstructor

func (this *Heap) NewJavaLangReflectConstructor(method *Method) JavaLangReflectConstructor

Constructor(Class<T> declaringClass,

            Class<?>[] parameterTypes,
            Class<?>[] checkedExceptions,
            int modifiers,
            int slot,
            String signature,
            byte[] annotations,
            byte[] parameterAnnotations)
}

func (*Heap) NewJavaLangReflectField

func (this *Heap) NewJavaLangReflectField(field *Field) JavaLangReflectField

Field(Class<?> declaringClass,

      String name,
      Class<?> type,
      int modifiers,
      int slot,
      String signature,
      byte[] annotations)

      	"(Ljava/lang/Class;" +
	"Ljava/lang/String;" +
	"Ljava/lang/Class;" +
	"II" +
	"Ljava/lang/String;" +
	"[B)V"

func (*Heap) NewJavaLangString

func (this *Heap) NewJavaLangString(str string) JavaLangString

Create interned java.lang.String

func (*Heap) NewJavaLangThread

func (this *Heap) NewJavaLangThread(name string) JavaLangThread

func (*Heap) NewMultiDimensionalArray

func (this *Heap) NewMultiDimensionalArray(arrayClass *Class, lengths []Int) ArrayRef

func (*Heap) NewObject

func (this *Heap) NewObject(class *Class) ObjectRef

func (*Heap) NewObjectOfName

func (this *Heap) NewObjectOfName(className string) ObjectRef

func (*Heap) NewThrowable

func (this *Heap) NewThrowable(exception string, message string, args ...interface{}) Reference

type InitializeSate

type InitializeSate struct {
	// contains filtered or unexported fields
}

type Instruction

type Instruction struct {
	// contains filtered or unexported fields
}

type InstructionRegistry

type InstructionRegistry []Instruction

func (InstructionRegistry) GetInstruction

func (this InstructionRegistry) GetInstruction(opcode uint8) Instruction

func (InstructionRegistry) RegisterInstructions

func (this InstructionRegistry) RegisterInstructions()

type Int

type Int int32

func JDK_jang_lang_Runtime_availableProcessors

func JDK_jang_lang_Runtime_availableProcessors(this Reference) Int

func JDK_jang_lang_Throwable_getStackTraceDepth

func JDK_jang_lang_Throwable_getStackTraceDepth(this Reference) Int

func JDK_java_io_FileInputStream_readBytes

func JDK_java_io_FileInputStream_readBytes(this Reference, byteArr ArrayRef, offset Int, length Int) Int

func JDK_java_io_UnixFileSystem_getBooleanAttributes0

func JDK_java_io_UnixFileSystem_getBooleanAttributes0(this Reference, file Reference) Int

@Native public static final int BA_EXISTS = 0x01; @Native public static final int BA_REGULAR = 0x02; @Native public static final int BA_DIRECTORY = 0x04; @Native public static final int BA_HIDDEN = 0x08;

func JDK_java_lang_Class_getModifiers

func JDK_java_lang_Class_getModifiers(this JavaLangClass) Int

func JDK_java_lang_Float_floatToRawIntBits

func JDK_java_lang_Float_floatToRawIntBits(value Float) Int

public static native int floatToRawIntBits(float value)

func JDK_java_lang_Object_hashCode

func JDK_java_lang_Object_hashCode(this Reference) Int

func JDK_java_lang_System_identityHashCode

func JDK_java_lang_System_identityHashCode(object Reference) Int

public static int identityHashCode(Object object)

func JDK_sun_misc_Unsafe_addressSize

func JDK_sun_misc_Unsafe_addressSize(this Reference) Int

func JDK_sun_misc_Unsafe_arrayBaseOffset

func JDK_sun_misc_Unsafe_arrayBaseOffset(this Reference, arrayClass JavaLangClass) Int

func JDK_sun_misc_Unsafe_arrayIndexScale

func JDK_sun_misc_Unsafe_arrayIndexScale(this Reference, arrayClass JavaLangClass) Int

func JDK_sun_misc_Unsafe_getIntVolatile

func JDK_sun_misc_Unsafe_getIntVolatile(this Reference, obj Reference, offset Long) Int

func JDK_sun_reflect_Reflection_getClassAccessFlags

func JDK_sun_reflect_Reflection_getClassAccessFlags(classObj JavaLangClass) Int

func (Int) ToBoolean

func (this Int) ToBoolean() Boolean

func (Int) Type

func (this Int) Type() Type

type IntType

type IntType struct {
	// contains filtered or unexported fields
}

func (*IntType) ClassObject

func (this *IntType) ClassObject() JavaLangClass

func (*IntType) Descriptor

func (this *IntType) Descriptor() string

func (*IntType) Name

func (this *IntType) Name() string

type IntegerConstant

type IntegerConstant struct {
	// contains filtered or unexported fields
}

type InterfaceMethodRef

type InterfaceMethodRef struct {
	MemberRef
	// contains filtered or unexported fields
}

func (*InterfaceMethodRef) ResolvedMethod

func (this *InterfaceMethodRef) ResolvedMethod() *Method

type InvokeDynamicConstant

type InvokeDynamicConstant struct {
	// contains filtered or unexported fields
}

type JarClassPathEntry

type JarClassPathEntry struct {
	// contains filtered or unexported fields
}

func (*JarClassPathEntry) String

func (this *JarClassPathEntry) String() string

type JavaLangClass

type JavaLangClass = Reference

func JDK_java_lang_ClassLoader_defineClass1

func JDK_java_lang_ClassLoader_defineClass1(this JavaLangClassLoader, className JavaLangString, byteArrRef ArrayRef, offset Int, length Int, pd Reference, source JavaLangString) JavaLangClass

func JDK_java_lang_ClassLoader_findBootstrapClass

func JDK_java_lang_ClassLoader_findBootstrapClass(this JavaLangClassLoader, className JavaLangString) JavaLangClass

func JDK_java_lang_ClassLoader_findLoadedClass0

func JDK_java_lang_ClassLoader_findLoadedClass0(this JavaLangClassLoader, className JavaLangString) JavaLangClass

func JDK_java_lang_Class_forName0

func JDK_java_lang_Class_forName0(name JavaLangString, initialize Boolean, loader JavaLangClassLoader, caller JavaLangClass) JavaLangClass

func JDK_java_lang_Class_getComponentType

func JDK_java_lang_Class_getComponentType(this JavaLangClass) JavaLangClass

func JDK_java_lang_Class_getDeclaringClass0

func JDK_java_lang_Class_getDeclaringClass0(this JavaLangClass) JavaLangClass

func JDK_java_lang_Class_getPrimitiveClass

func JDK_java_lang_Class_getPrimitiveClass(name JavaLangString) JavaLangClass

static Class getPrimitiveClass(String name)

func JDK_java_lang_Class_getSuperclass

func JDK_java_lang_Class_getSuperclass(this JavaLangClass) JavaLangClass

func JDK_java_lang_Object_getClass

func JDK_java_lang_Object_getClass(this Reference) JavaLangClass

func JDK_sun_reflect_Reflection_getCallerClass

func JDK_sun_reflect_Reflection_getCallerClass() JavaLangClass

type JavaLangClassLoader

type JavaLangClassLoader = Reference

type JavaLangReflectConstructor

type JavaLangReflectConstructor = Reference

type JavaLangReflectField

type JavaLangReflectField = Reference

type JavaLangReflectMethod

type JavaLangReflectMethod = Reference

type JavaLangString

type JavaLangString = Reference

func JDK_jang_lang_String_intern

func JDK_jang_lang_String_intern(this JavaLangString) JavaLangString

func JDK_java_io_UnixFileSystem_canonicalize0

func JDK_java_io_UnixFileSystem_canonicalize0(this Reference, path JavaLangString) JavaLangString

func JDK_java_lang_ClassLoader_findBuiltinLib

func JDK_java_lang_ClassLoader_findBuiltinLib(name JavaLangString) JavaLangString

func JDK_java_lang_Class_getName0

func JDK_java_lang_Class_getName0(this JavaLangClass) JavaLangString

func JDK_java_lang_Package_getSystemPackage0

func JDK_java_lang_Package_getSystemPackage0(vmPackageName JavaLangString) JavaLangString

func JDK_java_lang_System_mapLibraryName

func JDK_java_lang_System_mapLibraryName(name JavaLangString) JavaLangString

func JDK_java_util_TimeZone_getSystemTimeZoneID

func JDK_java_util_TimeZone_getSystemTimeZoneID(javaHome JavaLangString) JavaLangString

func (JavaLangString) ToNativeString

func (this JavaLangString) ToNativeString() string

type JavaLangThread

type JavaLangThread = Reference

func JDK_java_lang_Thread_currentThread

func JDK_java_lang_Thread_currentThread() JavaLangThread

type JavaLangThrowable

type JavaLangThrowable = JavaLangThread

type LineNumber

type LineNumber struct {
	// contains filtered or unexported fields
}

type LineNumberTableAttribute

type LineNumberTableAttribute struct {
	// contains filtered or unexported fields
}
LineNumberTable_attribute {
    u2 attribute_name_index;
    u4 attribute_length;
    u2 line_number_table_length;
    {   u2 start_pc;
        u2 line_number;
    } line_number_table[line_number_table_length];
}

type LineNumberTableEntry

type LineNumberTableEntry struct {
	// contains filtered or unexported fields
}

type LocalVariable

type LocalVariable struct {
	// contains filtered or unexported fields
}

type LocalVariableTableAttribute

type LocalVariableTableAttribute struct {
	// contains filtered or unexported fields
}
LocalVariableTable_attribute {
    u2 attribute_name_index;
    u4 attribute_length;
    u2 local_variable_table_length;
    {   u2 start_pc;
        u2 length;
        u2 name_index;
        u2 descriptor_index;
        u2 index;
    } local_variable_table[local_variable_table_length];
}

type LocalVariableTableEntry

type LocalVariableTableEntry struct {
	// contains filtered or unexported fields
}

type Logger

type Logger struct {
	// contains filtered or unexported fields
}

func (*Logger) All

func (this *Logger) All(format string, args ...interface{})

func (*Logger) Debug

func (this *Logger) Debug(format string, args ...interface{})

func (*Logger) Error

func (this *Logger) Error(format string, args ...interface{})

func (*Logger) Info

func (this *Logger) Info(format string, args ...interface{})

func (*Logger) Trace

func (this *Logger) Trace(format string, args ...interface{})

func (*Logger) Warn

func (this *Logger) Warn(format string, args ...interface{})

type LoggerFactory

type LoggerFactory struct{}

func (*LoggerFactory) NewLogger

func (this *LoggerFactory) NewLogger(category string, level int, logfile string) *Logger

type Long

type Long int64

func JDK_jang_lang_Double_doubleToRawLongBits

func JDK_jang_lang_Double_doubleToRawLongBits(value Double) Long

public static native int floatToRawIntBits(float value)

func JDK_java_io_UnixFileSystem_getLength

func JDK_java_io_UnixFileSystem_getLength(this Reference, file Reference) Long

func JDK_java_lang_System_currentTimeMillis

func JDK_java_lang_System_currentTimeMillis() Long

public static long currentTimeMillis()

func JDK_java_lang_System_nanoTime

func JDK_java_lang_System_nanoTime() Long

public static long nanoTime()

func JDK_sun_misc_Unsafe_allocateMemory

func JDK_sun_misc_Unsafe_allocateMemory(this Reference, size Long) Long

func JDK_sun_misc_Unsafe_objectFieldOffset

func JDK_sun_misc_Unsafe_objectFieldOffset(this Reference, fieldObject JavaLangReflectField) Long

func (Long) Type

func (this Long) Type() Type

type LongConstant

type LongConstant struct {
	// contains filtered or unexported fields
}

type LongType

type LongType struct {
	// contains filtered or unexported fields
}

func (*LongType) ClassObject

func (this *LongType) ClassObject() JavaLangClass

func (*LongType) Descriptor

func (this *LongType) Descriptor() string

func (*LongType) Name

func (this *LongType) Name() string

type MemberRef

type MemberRef struct {
	// contains filtered or unexported fields
}

func (*MemberRef) ResolvedClass

func (this *MemberRef) ResolvedClass() *Class

type Method

type Method struct {
	// contains filtered or unexported fields
}

func (*Method) Qualifier

func (this *Method) Qualifier() string

func (*Method) Signature

func (this *Method) Signature() string

type MethodArea

type MethodArea struct {
	DefinedClasses   map[NL]*Class // TODO lock
	InitiatedClasses map[NL]*Class
	StringPool
	*BootstrapClassLoader //bootstrap classloader
}

func (MethodArea) GetDefinedClass

func (this MethodArea) GetDefinedClass(className string, classLoader JavaLangClassLoader) (*Class, bool)

func (*MethodArea) GetTypeClass

func (this *MethodArea) GetTypeClass(descriptor string) JavaLangClass

func (*MethodArea) ResolveClass

func (this *MethodArea) ResolveClass(N string, reason *ClassTriggerReason) *Class

Always use current class's class loader to resolve class

type MethodHandleConstant

type MethodHandleConstant struct {
	// contains filtered or unexported fields
}

type MethodInfo

type MethodInfo struct {
	// contains filtered or unexported fields
}
method_info {
    u2             access_flags;
    u2             name_index;
    u2             descriptor_index;
    u2             attributes_count;
    attribute_info attributes[attributes_count];
}

type MethodRef

type MethodRef struct {
	MemberRef
	// contains filtered or unexported fields
}

func (*MethodRef) ResolvedMethod

func (this *MethodRef) ResolvedMethod() *Method

type MethodTypeConstant

type MethodTypeConstant struct {
	// contains filtered or unexported fields
}

type Monitor

type Monitor struct {
	// contains filtered or unexported fields
}

func NewMonitor

func NewMonitor(obj *Object) *Monitor

func (*Monitor) Enter

func (self *Monitor) Enter()

func (*Monitor) Exit

func (self *Monitor) Exit()

func (*Monitor) HasOwner

func (self *Monitor) HasOwner(thread *Thread) bool

func (*Monitor) NotifyAll

func (self *Monitor) NotifyAll()

func (*Monitor) Wait

func (self *Monitor) Wait(millis int64) (interrupted bool)

type NL

type NL struct {
	N string // binary class name, NO L; for non-array class
	L *Object
}

type NameAndTypeConstant

type NameAndTypeConstant struct {
	// contains filtered or unexported fields
}

type NativeMethodRegistry

type NativeMethodRegistry map[string]reflect.Value

func (NativeMethodRegistry) FindNative

func (this NativeMethodRegistry) FindNative(qualifier string) (reflect.Value, bool)

func (NativeMethodRegistry) RegisterNative

func (this NativeMethodRegistry) RegisterNative(qualifier string, function interface{})

func (NativeMethodRegistry) RegisterNatives

func (this NativeMethodRegistry) RegisterNatives()

type OS

type OS struct{}

func (*OS) CurrentTimeMillis

func (this *OS) CurrentTimeMillis() Long

func (*OS) CurrentTimeNano

func (this *OS) CurrentTimeNano() Long

func (*OS) StderrPrintf

func (this *OS) StderrPrintf(format string, args ...interface{})

func (*OS) StdoutPrintf

func (this *OS) StdoutPrintf(format string, args ...interface{})

type Object

type Object struct {
	// contains filtered or unexported fields
}

type ObjectRef

type ObjectRef = Reference

func JDK_jang_lang_Throwable_getStackTraceElement

func JDK_jang_lang_Throwable_getStackTraceElement(this JavaLangThrowable, i Int) ObjectRef

func JDK_java_lang_System_initProperties

func JDK_java_lang_System_initProperties(properties ObjectRef) ObjectRef

private static Properties initProperties(Properties properties)

func JDK_sun_reflect_NativeConstructorAccessorImpl_newInstance0

func JDK_sun_reflect_NativeConstructorAccessorImpl_newInstance0(constructor JavaLangReflectConstructor, args ArrayRef) ObjectRef

func (ObjectRef) GetInstanceVariable

func (this ObjectRef) GetInstanceVariable(index Int) Value

func (ObjectRef) GetInstanceVariableByName

func (this ObjectRef) GetInstanceVariableByName(name string, descriptor string) Value

func (ObjectRef) SetInstanceVariable

func (this ObjectRef) SetInstanceVariable(index Int, value Value)

func (ObjectRef) SetInstanceVariableByName

func (this ObjectRef) SetInstanceVariableByName(name string, descriptor string, value Value)

type Reference

type Reference struct {
	// contains filtered or unexported fields
}

func JDK_jang_lang_Throwable_fillInStackTrace

func JDK_jang_lang_Throwable_fillInStackTrace(this Reference, dummy Int) Reference

func JDK_java_lang_Object_clone

func JDK_java_lang_Object_clone(this Reference) Reference

func JDK_java_security_AccessController_doPrivileged

func JDK_java_security_AccessController_doPrivileged(action Reference) Reference

because here need to call java method, so the return value will automatically be placed in the stack

func JDK_java_security_AccessController_doPrivilegedContext

func JDK_java_security_AccessController_doPrivilegedContext(action Reference, context Reference) Reference

func JDK_java_security_AccessController_getStackAccessControlContext

func JDK_java_security_AccessController_getStackAccessControlContext() Reference

func JDK_sun_misc_Unsafe_getObjectVolatile

func JDK_sun_misc_Unsafe_getObjectVolatile(this Reference, obj Reference, offset Long) Reference

func (Reference) Class

func (this Reference) Class() *Class

func (Reference) Clone

func (this Reference) Clone() Reference

func (Reference) IHashCode

func (this Reference) IHashCode() Int

func (Reference) IsArray

func (this Reference) IsArray() bool

func (Reference) IsEqual

func (this Reference) IsEqual(reference Reference) bool

func (Reference) IsNull

func (this Reference) IsNull() bool

func (Reference) Monitor

func (this Reference) Monitor() *Monitor

func (Reference) Type

func (this Reference) Type() Type

type ReturnAddress

type ReturnAddress uint32

func (ReturnAddress) Type

func (this ReturnAddress) Type() Type

type ReturnAddressType

type ReturnAddressType struct{}

func (*ReturnAddressType) ClassObject

func (this *ReturnAddressType) ClassObject() JavaLangClass

func (*ReturnAddressType) Descriptor

func (this *ReturnAddressType) Descriptor() string

func (*ReturnAddressType) Name

func (this *ReturnAddressType) Name() string

type RuntimeVisibleAnnotationsAttribute

type RuntimeVisibleAnnotationsAttribute struct {
	// contains filtered or unexported fields
}

type Short

type Short int16

func (Short) Type

func (this Short) Type() Type

type ShortType

type ShortType struct {
	// contains filtered or unexported fields
}

func (*ShortType) ClassObject

func (this *ShortType) ClassObject() JavaLangClass

func (*ShortType) Descriptor

func (this *ShortType) Descriptor() string

func (*ShortType) Name

func (this *ShortType) Name() string

type SourceFileAttribue

type SourceFileAttribue struct {
	// contains filtered or unexported fields
}

type StackTraceElement

type StackTraceElement struct {
	// contains filtered or unexported fields
}

type StringConstant

type StringConstant struct {
	// contains filtered or unexported fields
}

func (*StringConstant) ResolvedString

func (this *StringConstant) ResolvedString() ObjectRef

type StringPool

type StringPool map[string]JavaLangString

func (StringPool) GetStringInPool

func (this StringPool) GetStringInPool(str string) (JavaLangString, bool)

func (StringPool) InternString

func (this StringPool) InternString(stringobj JavaLangString) JavaLangString

type SymbolRef

type SymbolRef interface {
	Constant
	// contains filtered or unexported methods
}

type SystemSettings

type SystemSettings map[string]string

func (SystemSettings) GetSystemSetting

func (this SystemSettings) GetSystemSetting(key string) string

func (SystemSettings) SetSystemSetting

func (this SystemSettings) SetSystemSetting(key string, value string)

type Thread

type Thread struct {
	*Logger
	// contains filtered or unexported fields
}

func (*Thread) ExecuteFrame

func (this *Thread) ExecuteFrame() bool
_____
|   |   <-  a new frame added on top, no touch existing. just run this frame

----------

|   |   <- existing
______
|   |
______

Only run one single frame

func (*Thread) NewFrame

func (this *Thread) NewFrame(method *Method) *Frame

type Type

type Type interface {
	Name() string
	Descriptor() string
	ClassObject() Reference
}

type UTF8Constant

type UTF8Constant struct {
	// contains filtered or unexported fields
}

type Value

type Value interface {
	Type() Type
}

---------------------------------------------------------------------------------------

Value system:

<Value>

|- Byte     -> int8
|- Short    -> int16
|- Char     -> uint16
|- Int      -> int32
|- Long     -> int64
|- Float    -> float32
|- Double   -> float64
|- Boolean  -> int8
|- Reference ( -> *Object)
	|= : ObjectRef
	|= : ArrayRef
    |= : JavaLangString
    |= : JavaLangThread
    |= : JavaLangClass
    |= : JavaLangClassLoader
    |= : ...

ObjectRef and ArrayRef are only reference value holding a pointer to real heap object <Object> or <Array>. The reference itself will be never nil, but its containing pointer can be nil, which means the reference is `NULL` in Java. In Java, all the values are passed by copying, so never use pointers of these values including Reference.

type Void

type Void struct{} // void value has not type

func (Void) Type

func (this Void) Type() Type

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL