Jimple Types
represents primary types i.e. non-reference types and non-void
PrimaryType
BooleanType
ByteType
CharType
ShortType
IntType
LongType
DoubleType
FloatType
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75 | public class target.exercise1.DemoClass extends java.lang.Object
{
public void <init>()
{
target.exercise1.DemoClass this;
this := @this: target.exercise1.DemoClass;
specialinvoke this.<java.lang.Object: void <init>()>();
return;
}
public void display()
{
java.io.PrintStream $stack11, $stack13, $stack15,
$stack17, $stack19, $stack21, $stack23, $stack25;
int $stack12, $stack14, $stack16, $stack18;
long $stack20;
double $stack22;
float $stack24;
target.exercise1.DemoClass this;
boolean $stack26;
this := @this: target.exercise1.DemoClass;
$stack11 = <java.lang.System: java.io.PrintStream out>;
goto label1;
label1:
$stack26 = 0;
virtualinvoke $stack11.<java.io.PrintStream:
void println(boolean)>($stack26);
$stack13 = <java.lang.System: java.io.PrintStream out>;
$stack12 = 127 - 1;
virtualinvoke $stack13.<java.io.PrintStream:
void println(int)>($stack12);
$stack15 = <java.lang.System: java.io.PrintStream out>;
$stack14 = 97 + 1;
virtualinvoke $stack15.<java.io.PrintStream:
void println(int)>($stack14);
$stack17 = <java.lang.System: java.io.PrintStream out>;
$stack16 = 1123 + 1;
virtualinvoke $stack17.<java.io.PrintStream:
void println(int)>($stack16);
$stack19 = <java.lang.System: java.io.PrintStream out>;
$stack18 = 123456 + 1;
virtualinvoke $stack19.<java.io.PrintStream:
void println(int)>($stack18);
$stack21 = <java.lang.System: java.io.PrintStream out>;
$stack20 = 10L + 1L;
virtualinvoke $stack21.<java.io.PrintStream:
void println(long)>($stack20);
$stack23 = <java.lang.System: java.io.PrintStream out>;
$stack22 = 10.1 + 1.0;
virtualinvoke $stack23.<java.io.PrintStream:
void println(double)>($stack22);
$stack25 = <java.lang.System: java.io.PrintStream out>;
$stack24 = 10.1F + 1.0F;
virtualinvoke $stack25.<java.io.PrintStream:
void println(float)>($stack24);
return;
}
}
/*
The JimpleLocal $stack12, $stack14, $stack16, $stack18 are of IntType.
Similarly, $stack20 is of LongType, $stack22 is of DoubleType and so on.
*/
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24 | package target.exercise1;
public class DemoClass {
public void display(){
boolean varBoolean = true;
byte varByte = 127;
char varChar = 'a';
short varShort = 1123;
int varInt = 123456;
long varLong = 10L;
double varDouble = 10.10;
float varFloat = 10.10f;
System.out.println(!varBoolean);
System.out.println(varByte-1);
System.out.println(varChar+1);
System.out.println(varShort+1);
System.out.println(varInt+1);
System.out.println(varLong+1);
System.out.println(varDouble+1);
System.out.println(varFloat+1);
}
}
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132 | // class version 52.0 (52)
// access flags 0x21
public class target/exercise1/DemoClass {
// compiled from: DemoClass.java
// access flags 0x1
public <init>()V
L0
LINENUMBER 3 L0
ALOAD 0
INVOKESPECIAL java/lang/Object.<init> ()V
RETURN
L1
LOCALVARIABLE this Ltarget/exercise1/DemoClass; L0 L1 0
MAXSTACK = 1
MAXLOCALS = 1
// access flags 0x1
public display()V
L0
LINENUMBER 5 L0
ICONST_1
ISTORE 1
L1
LINENUMBER 6 L1
BIPUSH 127
ISTORE 2
L2
LINENUMBER 7 L2
BIPUSH 97
ISTORE 3
L3
LINENUMBER 8 L3
SIPUSH 1123
ISTORE 4
L4
LINENUMBER 9 L4
LDC 123456
ISTORE 5
L5
LINENUMBER 10 L5
LDC 10
LSTORE 6
L6
LINENUMBER 11 L6
LDC 10.1
DSTORE 8
L7
LINENUMBER 12 L7
LDC 10.1
FSTORE 10
L8
LINENUMBER 14 L8
GETSTATIC java/lang/System.out : Ljava/io/PrintStream;
ILOAD 1
IFNE L9
ICONST_1
GOTO L10
L9
FRAME FULL [target/exercise1/DemoClass I I I I I J D F]
[java/io/PrintStream]
ICONST_0
L10
FRAME FULL [target/exercise1/DemoClass I I I I I J D F]
[java/io/PrintStream I]
INVOKEVIRTUAL java/io/PrintStream.println (Z)V
L11
LINENUMBER 15 L11
GETSTATIC java/lang/System.out : Ljava/io/PrintStream;
ILOAD 2
ICONST_1
ISUB
INVOKEVIRTUAL java/io/PrintStream.println (I)V
L12
LINENUMBER 16 L12
GETSTATIC java/lang/System.out : Ljava/io/PrintStream;
ILOAD 3
ICONST_1
IADD
INVOKEVIRTUAL java/io/PrintStream.println (I)V
L13
LINENUMBER 17 L13
GETSTATIC java/lang/System.out : Ljava/io/PrintStream;
ILOAD 4
ICONST_1
IADD
INVOKEVIRTUAL java/io/PrintStream.println (I)V
L14
LINENUMBER 18 L14
GETSTATIC java/lang/System.out : Ljava/io/PrintStream;
ILOAD 5
ICONST_1
IADD
INVOKEVIRTUAL java/io/PrintStream.println (I)V
L15
LINENUMBER 19 L15
GETSTATIC java/lang/System.out : Ljava/io/PrintStream;
LLOAD 6
LCONST_1
LADD
INVOKEVIRTUAL java/io/PrintStream.println (J)V
L16
LINENUMBER 20 L16
GETSTATIC java/lang/System.out : Ljava/io/PrintStream;
DLOAD 8
DCONST_1
DADD
INVOKEVIRTUAL java/io/PrintStream.println (D)V
L17
LINENUMBER 21 L17
GETSTATIC java/lang/System.out : Ljava/io/PrintStream;
FLOAD 10
FCONST_1
FADD
INVOKEVIRTUAL java/io/PrintStream.println (F)V
L18
LINENUMBER 23 L18
RETURN
L19
LOCALVARIABLE this Ltarget/exercise1/DemoClass; L0 L19 0
LOCALVARIABLE varBoolean Z L1 L19 1
LOCALVARIABLE varByte B L2 L19 2
LOCALVARIABLE varChar C L3 L19 3
LOCALVARIABLE varShort S L4 L19 4
LOCALVARIABLE varInt I L5 L19 5
LOCALVARIABLE varLong J L6 L19 6
LOCALVARIABLE varDouble D L7 L19 8
LOCALVARIABLE varFloat F L8 L19 10
MAXSTACK = 5
MAXLOCALS = 11
}
|
ReferenceType
(Java)ClassType
- represents the type of a Class.
ArrayType
- represents an array.
NullType
- assignable to one of the other ReferenceTypes.
VoidType
Used as a possible return type of a method.