-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[WIP] Implement live variable analysis
Signed-off-by: Adam Laszlo Kulcsar <kuladam@inf.u-szeged.hu>
- Loading branch information
1 parent
a22a568
commit 2b9957b
Showing
9 changed files
with
1,087 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,133 @@ | ||
live_analysis | ||
|
||
get-ből való kiindulás azért jobb mert valaminek be kell állítania az értékét | ||
|
||
egy adott getből keresem vissza hogy milyen utakon lehet visszamenni az őt beállító utasításokig | ||
multimap jó | ||
|
||
listákban tartom az összes változóra a set-jeit és a get-jeit | ||
|
||
jump + sets [T,p] | ||
T - target, ahova ugrunk | ||
p - position, ahonnan ugrottunk | ||
+ listában a set-ek amelyek abban a blokban vannak | ||
|
||
dump!!! - variableRange | ||
|
||
required stack size: 104 bytes | ||
stack: [(parameter 0, i32, pos 0) (parameter 1, i32, pos 8) (parameter 2, i32, pos 16) | ||
(local 0, i32, pos 24) (local 1, i32, pos 28) (local 2, i32, pos 32) | ||
(local 3, i32, pos 36) (local 4, i32, pos 40) (local 5, i32, pos 44) | ||
(local 6, i32, pos 48) (local 7, i32, pos 52) (constant 1, i32, pos 56) | ||
(constant 2, i32, pos 60) (constant 0, i32, pos 64) (constant 4, i32, pos 68) ....] | ||
bytecode size: 936 bytes | ||
|
||
0 const32 dstOffset: 24 value: 0 | ||
16 const32 dstOffset: 28 value: 0 | ||
32 const32 dstOffset: 32 value: 0 | ||
48 const32 dstOffset: 36 value: 0 | ||
64 const32 dstOffset: 40 value: 0 | ||
80 const32 dstOffset: 44 value: 0 | ||
96 const32 dstOffset: 48 value: 0 | ||
112 const32 dstOffset: 56 value: 1 | ||
128 const32 dstOffset: 60 value: 2 | ||
144 const32 dstOffset: 64 value: 0 | ||
160 const32 dstOffset: 68 value: 4 | ||
176 I32LtS src1: 8 src2: 16 dst: 72 | ||
192 jump_if_false srcOffset: 72 dst: 920 | ||
208 I32Shl src1: 16 src2: 60 dst: 80 | ||
224 I32Add src1: 0 src2: 80 dst: 40 | ||
240 move32 srcOffset: 64 dstOffset: 24 | ||
256 I32Sub src1: 16 src2: 8 dst: 72 | ||
272 move32 srcOffset: 72 dstOffset: 44 | ||
288 I32GtS src1: 72 src2: 64 dst: 72 | ||
304 jump_if_false srcOffset: 72 dst: 752 | ||
320 load32 srcOffset: 40 dstOffset: 36 | ||
336 move32 srcOffset: 64 dstOffset: 28 | ||
352 I32Add src1: 8 src2: 24 dst: 88 | ||
368 I32Shl src1: 88 src2: 60 dst: 88 | ||
384 I32Add src1: 0 src2: 88 dst: 80 | ||
400 move32 srcOffset: 80 dstOffset: 32 | ||
416 load32 srcOffset: 80 dstOffset: 80 | ||
432 move32 srcOffset: 80 dstOffset: 48 | ||
448 I32GtS src1: 36 src2: 80 dst: 72 | ||
464 jump_if_false srcOffset: 72 dst: 512 | ||
480 I32Add src1: 24 src2: 56 dst: 24 | ||
496 jump dst: 704 | ||
512 move32 srcOffset: 32 dstOffset: 72 | ||
528 I32Sub src1: 16 src2: 28 dst: 88 | ||
544 I32Shl src1: 88 src2: 60 dst: 88 | ||
560 I32Add src1: 0 src2: 88 dst: 80 | ||
576 move32 srcOffset: 80 dstOffset: 32 | ||
592 I32Sub src1: 80 src2: 68 dst: 80 | ||
608 move32 srcOffset: 80 dstOffset: 52 | ||
624 load32 srcOffset: 80 dstOffset: 80 | ||
640 store32 src0Offset: 72 src1Offset: 80 | ||
656 store32 src0Offset: 32 src1Offset: 48 | ||
672 store32 src0Offset: 52 src1Offset: 36 | ||
688 I32Add src1: 28 src2: 56 dst: 28 | ||
704 I32Add src1: 24 src2: 28 dst: 72 | ||
720 I32LtS src1: 72 src2: 44 dst: 72 | ||
736 jump_if_true srcOffset: 72 dst: 352 | ||
752 move32 srcOffset: 8 dstOffset: 80 | ||
768 move32 srcOffset: 8 dstOffset: 88 | ||
784 I32Add src1: 88 src2: 24 dst: 88 | ||
800 move32 srcOffset: 88 dstOffset: 8 | ||
816 I32Sub src1: 88 src2: 56 dst: 88 | ||
832 call index: 1 paramOffsets: 0 80 88 resultOffsets: | ||
856 I32Add src1: 8 src2: 56 dst: 72 | ||
872 move32 srcOffset: 72 dstOffset: 8 | ||
888 I32LtS src1: 72 src2: 16 dst: 72 | ||
904 jump_if_true srcOffset: 72 dst: 240 | ||
920 end | ||
|
||
|
||
required stack size: 48 bytes | ||
stack: [(local 0, i32, pos 0) (local 1, i32, pos 8) (constant 4, i32, pos 16) (constant 1, i32, pos 24) ....] | ||
bytecode size: 200 bytes | ||
|
||
0 const32 dstOffset: 0 value: 0 | ||
16 const32 dstOffset: 16 value: 4 | ||
32 const32 dstOffset: 24 value: 1 | ||
48 global.get32 dstOffset: 8 index: 0 | ||
64 I32Mul src1: 0 src2: 16 dst: 32 | ||
80 load32 srcOffset: 32 dstOffset: 32 | ||
96 call index: 0 paramOffsets: 32 resultOffsets: | ||
120 I32Add src1: 0 src2: 24 dst: 32 | ||
136 move32 srcOffset: 32 dstOffset: 0 | ||
152 I32Ne src1: 32 src2: 8 dst: 32 | ||
168 jump_if_true srcOffset: 32 dst: 64 | ||
184 end | ||
|
||
|
||
required stack size: 64 bytes | ||
stack: [(local 0, i32, pos 0) (local 1, i32, pos 8) (constant 0, i32, pos 16) (constant 4, i32, pos 24) (constant 1, i32, pos 32) ....] | ||
bytecode size: 248 bytes | ||
|
||
0 const32 dstOffset: 0 value: 0 | ||
16 const32 dstOffset: 16 value: 0 | ||
32 const32 dstOffset: 24 value: 4 | ||
48 const32 dstOffset: 32 value: 1 | ||
64 global.get32 dstOffset: 8 index: 0 | ||
80 I32Mul src1: 0 src2: 24 dst: 40 | ||
96 I32Sub src1: 8 src2: 0 dst: 48 | ||
112 store32 src0Offset: 40 src1Offset: 48 | ||
128 I32Add src1: 0 src2: 32 dst: 40 | ||
144 move32 srcOffset: 40 dstOffset: 0 | ||
160 I32Ne src1: 40 src2: 8 dst: 40 | ||
176 jump_if_true srcOffset: 40 dst: 80 | ||
192 global.get32 dstOffset: 56 index: 0 | ||
208 call index: 1 paramOffsets: 16 16 56 resultOffsets: | ||
232 end | ||
|
||
|
||
required stack size: 16 bytes | ||
stack: [(parameter 0, i32, pos 0) ....] | ||
bytecode size: 40 bytes | ||
|
||
0 load32 srcOffset: 0 dstOffset: 8 | ||
16 end resultOffsets: 8 | ||
|
||
invoke read(0) expect value(0) (line: 212) : OK | ||
invoke read(4) expect value(1) (line: 213) : OK | ||
invoke read(8) expect value(2) (line: 214) : OK |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.