Skip to content

Instantly share code, notes, and snippets.

@pmichaud
Created February 11, 2013 18:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pmichaud/4756511 to your computer and use it in GitHub Desktop.
Save pmichaud/4756511 to your computer and use it in GitHub Desktop.
pmichaud@kiwi:~/p6/parrot$ cat x.pir
.sub 'main'
'foo'()
.end
.sub 'foo'
say 'hello'
.end
pmichaud@kiwi:~/p6/parrot$ ./parrot x.pir
hello
pmichaud@kiwi:~/p6/parrot$ ./parrot -t1 x.pir
0142 get_params PC2 (1), P4 PC2=FixedIntegerArray=PMC(0xdcc1c8) P4=PMCNULL
0145 set P5, PC8 P5=PMCNULL PC8=Sub=PMC(0xdcc588 pc:0)
0148 set P6, PC14 P6=PMCNULL PC14=Sub=PMC(0xdcc970 pc:513)
014b new P3, "ExceptionHandler" P3=PMCNULL
014e set_label P3, 30 P3=ExceptionHandler=PMC(0xe86ed8)
0151 push_eh P3 P3=ExceptionHandler=PMC(0xe86ed8)
0153 set_args PC2 (1), P4 PC2=FixedIntegerArray=PMC(0xdcc1c8) P4=ResizableStringArray=PMC(0xdb5b68)
0156 invokecc P5 P5=Sub=PMC(0xdcc588 pc:0)
0000 get_params PC2 (1), P4 PC2=FixedIntegerArray=PMC(0xdcc1c8) P4=PMCNULL
0003 set P5, PC15 P5=PMCNULL PC15=Sub=PMC(0xdcca10 pc:699)
0006 set P6, PC16 P6=PMCNULL PC16=Sub=PMC(0xdccab0 pc:708)
0009 set P7, PC21 P7=PMCNULL PC21=Sub=PMC(0xdccdd0 pc:766)
000c set P8, PC24 P8=PMCNULL PC24=Sub=PMC(0xdccfb0 pc:784)
000f set P9, PC12 P9=PMCNULL PC12=Sub=PMC(0xdcc808 pc:450)
0012 set P10, PC22 P10=PMCNULL PC22=Sub=PMC(0xdcce70 pc:773)
0015 set P11, PC10 P11=PMCNULL PC10=Sub=PMC(0xdcc6c8 pc:380)
0018 null S0 S0=""
001a shift S0, P4 S0="" P4=ResizableStringArray=PMC(0xdb5b68)
001d null S1 S1=""
001f null I0 I0=0
0021 null S2 S2=""
0023 null P0 P0=PMCNULL
0025 null S3 S3=""
0027 null I1 I1=0
0029 elements I2, P4 I2=0 P4=ResizableStringArray=PMC(0xdb5b68)
002c le I2, 0, 95 I2=1
0030 set S4, P4[0] S4="" P4=ResizableStringArray=PMC(0xdb5b68)
0034 eq S4, "-o", 30 S4="x.pir"
0038 eq S4, "-c", 34 S4="x.pir"
003c eq S4, "-r", 38 S4="x.pir"
0040 eq S4, "-E", 42 S4="x.pir"
0044 eq S4, "--runtime-prefix", 46 S4="x.pir"
0048 eq S4, "-V", 48 S4="x.pir"
004c eq S4, "-h", 50 S4="x.pir"
0050 branch 52
0084 set S1, S4 S1="" S4="x.pir"
0087 branch 4
008b isnull I2, S1 I2=1 S1="x.pir"
008e if I2, 7 I2=0
0091 iseq I2, S1, "" I2=0 S1="x.pir"
0095 unless I2, 10 I2=0
009f ne I1, 1, 18 I1=0
00b1 if I0, 28 I0=0
00b4 set_args PC1 (1), S1 PC1=FixedIntegerArray=PMC(0xdb5cf8) S1="x.pir"
00b7 invokecc P9 P9=Sub=PMC(0xdcc808 pc:450)
01c2 get_params PC1 (1), S1 PC1=FixedIntegerArray=PMC(0xdb5cf8) S1=""
01c5 length I1, S1 I1=0 S1="x.pir"
01c8 sub I0, I1, 4 I0=0 I1=5
01cc lt I0, 0, 10 I0=1
01d0 substr S0, S1, I0 S0="" S1="x.pir" I0=1
01d4 branch 5
01d9 ne S0, ".pir", 8 S0=".pir"
01dd set_returns PC11 (1), 2
01e0 returncc
00b9 get_results PC2 (1), P2 PC2=FixedIntegerArray=PMC(0xdcc1c8) P2=PMCNULL
00bc set I0, P2 I0=0 P2=Integer=PMC(0xe87108: 2)
00bf if I0, 14 I0=2
00cd ne I1, 2, 54 I1=0
0103 unless_null P0, 12 P0=PMCNULL
0106 set_args PC4 (2), S1, I0 PC4=FixedIntegerArray=PMC(0xdcc308) S1="x.pir" I0=2
010a invokecc P11 P11=Sub=PMC(0xdcc6c8 pc:380)
017c get_params PC4 (2), S0, I0 PC4=FixedIntegerArray=PMC(0xdcc308) S0="" I0=0
0180 eq I0, 2, 14 I0=2
018e compreg P0, "PIR" P0=PMCNULL
0191 set_args PC5 (2), P0, S0 PC5=FixedIntegerArray=PMC(0xdcc3a8) P0=IMCCompiler=PMC(0xdb5af0) S0="x.pir"
0195 callmethodcc P0, "compile_file" P0=IMCCompiler=PMC(0xdb5af0)
0198 get_results PC2 (1), P1 PC2=FixedIntegerArray=PMC(0xdcc1c8) P1=PMCNULL
019b set_returns PC2 (1), P1 PC2=FixedIntegerArray=PMC(0xdcc1c8) P1=PackfileView=PMC(0xe87220)
019e returncc
010c get_results PC2 (1), P0 PC2=FixedIntegerArray=PMC(0xdcc1c8) P0=PMCNULL
010f if_null S2, 14 S2=""
011d set_args PC3 (2), P0, "init" PC3=FixedIntegerArray=PMC(0xdcc268) P0=PackfileView=PMC(0xe87220)
0121 callmethodcc P0, "subs_by_tag" P0=PackfileView=PMC(0xe87220)
0124 get_results PC2 (1), P2 PC2=FixedIntegerArray=PMC(0xdcc1c8) P2=Integer=PMC(0xe87108: 2)
0127 if_null P2, 23 P2=ResizablePMCArray=PMC(0xe87518)
012a iter P3, P2 P3=PMCNULL P2=ResizablePMCArray=PMC(0xe87518)
012d set P3, 0 P3=ArrayIterator=PMC(0xe87568)
0130 unless P3, 14 P3=ArrayIterator=PMC(0xe87568)
013e set_returns PC2 (1), P0 PC2=FixedIntegerArray=PMC(0xdcc1c8) P0=PackfileView=PMC(0xe87220)
0141 returncc
0158 get_results PC2 (1), P0 PC2=FixedIntegerArray=PMC(0xdcc1c8) P0=PMCNULL
015b set_args PC2 (1), P0 PC2=FixedIntegerArray=PMC(0xdcc1c8) P0=PackfileView=PMC(0xe87220)
015e callmethodcc P0, "main_sub" P0=PackfileView=PMC(0xe87220)
0161 get_results PC2 (1), P1 PC2=FixedIntegerArray=PMC(0xdcc1c8) P1=PMCNULL
0164 set_args PC2 (1), P4 PC2=FixedIntegerArray=PMC(0xdcc1c8) P4=ResizableStringArray=PMC(0xdb5b68)
0167 tailcall P1 P1=Sub=PMC(0xe872e8 pc:0)
0000 set_args PC0
0002 set P0, PC2 P0=PMCNULL PC2=Sub=PMC(0xe873b0 pc:12)
0005 invokecc P0 P0=Sub=PMC(0xe873b0 pc:12)
000c say "hello"
hello
000e set_returns PC0
0010 returncc
0007 get_results PC0
0009 set_returns PC0
000b returncc
FileHandle objects (like stdout and stderr)are about to be closed, so clearing trace flags.
pmichaud@kiwi:~/p6/parrot$
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment