Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add class name as prefix to VM labels in the compiler #465

Merged
merged 4 commits into from
Sep 17, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions projects/src/samples/project_11/average.ts
Original file line number Diff line number Diff line change
Expand Up @@ -334,12 +334,12 @@ export const compiled = `function Main.main 4
pop local 0
push constant 0
pop local 2
label L0
label Main_L0
push local 2
push local 1
lt
not
if-goto L1
if-goto Main_L1
push local 2
push local 0
add
Expand Down Expand Up @@ -394,8 +394,8 @@ label L0
push constant 1
add
pop local 2
goto L0
label L1
goto Main_L0
label Main_L1
push constant 15
call String.new 1
push constant 84
Expand Down
16 changes: 8 additions & 8 deletions projects/src/samples/project_11/complex_arrays.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1472,7 +1472,7 @@ export const compiled = `function Main.main 3
push constant 0
eq
not
if-goto L1
if-goto Main_L1
push local 0
push constant 10
call Main.fill 2
Expand Down Expand Up @@ -1529,9 +1529,9 @@ export const compiled = `function Main.main 3
pop pointer 1
push temp 0
pop that 0
goto L0
label L1
label L0
goto Main_L0
label Main_L1
label Main_L0
push constant 44
call String.new 1
push constant 84
Expand Down Expand Up @@ -1744,12 +1744,12 @@ function Main.double 0
call Math.multiply 2
return
function Main.fill 0
label L2
label Main_L2
push argument 1
push constant 0
gt
not
if-goto L3
if-goto Main_L3
push argument 1
push constant 1
sub
Expand All @@ -1763,7 +1763,7 @@ label L2
pop pointer 1
push temp 0
pop that 0
goto L2
label L3
goto Main_L2
label Main_L3
push constant 0
return`;
40 changes: 20 additions & 20 deletions projects/src/samples/project_11/convert_to_bin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -645,10 +645,10 @@ function Main.convert 3
push constant 1
neg
pop local 2
label L0
label Main_L0
push local 2
not
if-goto L1
if-goto Main_L1
push local 1
push constant 1
add
Expand All @@ -661,61 +661,61 @@ label L0
gt
not
not
if-goto L3
if-goto Main_L3
push argument 0
push local 0
and
push constant 0
eq
not
not
if-goto L5
if-goto Main_L5
push constant 8000
push local 1
add
push constant 1
call Memory.poke 2
pop temp 0
goto L4
label L5
goto Main_L4
label Main_L5
push constant 8000
push local 1
add
push constant 0
call Memory.poke 2
pop temp 0
label L4
goto L2
label L3
label Main_L4
goto Main_L2
label Main_L3
push constant 0
pop local 2
label L2
goto L0
label L1
label Main_L2
goto Main_L0
label Main_L1
push constant 0
return
function Main.nextMask 0
push argument 0
push constant 0
eq
not
if-goto L7
if-goto Main_L7
push constant 1
return
goto L6
label L7
goto Main_L6
label Main_L7
push argument 0
push constant 2
call Math.multiply 2
return
label L6
label Main_L6
function Main.fillMemory 0
label L8
label Main_L8
push argument 1
push constant 0
gt
not
if-goto L9
if-goto Main_L9
push argument 0
push argument 2
call Memory.poke 2
Expand All @@ -728,7 +728,7 @@ label L8
push constant 1
add
pop argument 0
goto L8
label L9
goto Main_L8
label Main_L9
push constant 0
return`;
Loading
Loading