Skip to content

Instantly share code, notes, and snippets.

@ashgti
Created January 22, 2010 15:44
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 ashgti/283857 to your computer and use it in GitHub Desktop.
Save ashgti/283857 to your computer and use it in GitHub Desktop.
.HLL "perl6"
.namespace []
.sub "_block11" :anon :subid("18_1264098611.86549")
.param pmc param_141 :slurpy
.annotate "line", 0
.const 'Sub' $P15 = "19_1264098611.86549"
capture_lex $P15
.annotate "line", 1
get_hll_global $P13, "!UNIT_START"
.const 'Sub' $P15 = "19_1264098611.86549"
capture_lex $P15
.lex "@_", param_141
.tailcall $P13($P15, param_141)
.const 'Sub' $P146 = "31_1264098611.86549"
.return ($P146)
.end
.HLL "perl6"
.namespace []
.sub "_block14" :anon :subid("19_1264098611.86549") :outer("18_1264098611.86549")
.annotate "line", 1
get_hll_global $P105, ["Bar"], "_block104"
capture_lex $P105
get_hll_global $P89, ["Foo"], "_block88"
capture_lex $P89
get_hll_global $P22, ["F[::T]"], "!class_init_15"
capture_lex $P22
.local pmc true
true = get_hll_global 'True'
find_lex_skip_current $P16, "$_"
$P17 = new ['Perl6Scalar'], $P16
setprop $P17, "rw", true
.lex "$_", $P17
find_lex_skip_current $P18, "$/"
$P19 = new ['Perl6Scalar'], $P18
setprop $P19, "rw", true
.lex "$/", $P19
find_lex_skip_current $P20, "$!"
$P21 = new ['Perl6Scalar'], $P20
setprop $P21, "rw", true
.lex "$!", $P21
.annotate "line", 7
get_hll_global $P89, ["Foo"], "_block88"
capture_lex $P89
$P89()
.annotate "line", 10
get_hll_global $P105, ["Bar"], "_block104"
capture_lex $P105
$P105()
.annotate "line", 13
get_hll_global $P120, "Foo"
descalarref $P121, $P120
$P122 = $P121."new"()
descalarref $P123, $P122
$P124 = $P123."x"(10)
"&say"($P124)
.annotate "line", 14
get_hll_global $P125, "Bar"
descalarref $P126, $P125
$P127 = $P126."new"()
descalarref $P128, $P127
new $P129, "Perl6Str"
assign $P129, "str"
$P130 = $P128."x"($P129)
"&say"($P130)
.annotate "line", 15
get_hll_global $P131, "Foo"
descalarref $P132, $P131
$P133 = $P132."new"()
descalarref $P134, $P133
new $P135, "Perl6Str"
assign $P135, "str"
$P136 = $P134."x"($P135)
$P137 = "&say"($P136)
.annotate "line", 1
.return ($P137)
.end
.HLL "perl6"
.namespace []
.sub "" :load :init :subid("post32") :outer("19_1264098611.86549")
.annotate "line", 1
.const 'Sub' $P15 = "19_1264098611.86549"
.local pmc block
set block, $P15
get_hll_global $P138, ["F[::T]"], "!class_init_15"
$P138()
get_hll_global $P139, ["Foo"], "!class_init_16"
$P139()
get_hll_global $P140, ["Bar"], "!class_init_17"
$P140()
.end
.HLL "perl6"
.namespace ["F[::T]"]
.sub "!class_init_15" :subid("20_1264098611.86549") :outer("19_1264098611.86549")
.annotate "line", 1
.const 'Sub' $P27 = "21_1264098611.86549"
capture_lex $P27
get_hll_global $P23, "F"
$P24 = "!create_master_role"("F", $P23)
.local pmc master_role
set master_role, $P24
get_hll_global $P25, "Sub"
.const 'Sub' $P27 = "21_1264098611.86549"
capture_lex $P27
$P87 = $P25."new"($P27, 1, "!sig_setup_1264098611.73495_13")
master_role."!add_variant"($P87)
set_hll_global "F", master_role
.return (master_role)
.end
.HLL "perl6"
.namespace ["F[::T]"]
.sub "_block26" :anon :anon :subid("21_1264098611.86549") :outer("20_1264098611.86549")
.param pmc param_34 :call_sig
.annotate "line", 1
.const 'Sub' $P44 = "23_1264098611.86549"
capture_lex $P44
.const 'Sub' $P37 = "22_1264098611.86549"
capture_lex $P37
.local pmc true
true = get_hll_global 'True'
find_lex_skip_current $P28, "$_"
$P29 = new ['Perl6Scalar'], $P28
setprop $P29, "rw", true
.lex "$_", $P29
find_lex_skip_current $P30, "$/"
$P31 = new ['Perl6Scalar'], $P30
setprop $P31, "rw", true
.lex "$/", $P31
find_lex_skip_current $P32, "$!"
$P33 = new ['Perl6Scalar'], $P32
setprop $P33, "rw", true
.lex "$!", $P33
.lex "call_sig", param_34
new $P35, "Perl6Scalar"
.lex "T", $P35
find_lex $P36, "call_sig"
bind_signature $P36
get_hll_global $P40, "RoleHOW"
$P41 = $P40."new"("F")
.local pmc meta
set meta, $P41
get_hll_global $P42, "RoleHOW"
get_hll_global $P43, "Method"
.annotate "line", 2
.const 'Sub' $P44 = "23_1264098611.86549"
capture_lex $P44
$P83 = $P43."new"($P44, 0, "!sig_setup_1264098611.72973_11")
.annotate "line", 1
$P84 = $P83."clone"()
$P42."add_method"(meta, "x", $P84)
get_hll_global $P85, "RoleHOW"
$P86 = $P85."compose"(meta)
.return ($P86)
.end
.HLL "perl6"
.namespace ["F[::T]"]
.sub "!sig_setup_1264098611.73495_13" :subid("22_1264098611.86549") :outer("21_1264098611.86549")
.annotate "line", 1
$P38 = allocate_signature 1
.local pmc signature_14
set signature_14, $P38
null $P0
null $S0
$P39 = root_new ['parrot'; 'ResizableStringArray']
push $P39, unicode:"T"
set_signature_elem signature_14, 0, $S0, 128, $P0, $P0, $P0, $P39, $P0, $P0
.local pmc signature
set signature, signature_14
.return (signature)
.end
.HLL "perl6"
.namespace ["F[::T]"]
.sub "x" :anon :subid("23_1264098611.86549") :outer("21_1264098611.86549")
.param pmc param_54 :call_sig
.annotate "line", 2
.const 'Sub' $P58 = "24_1264098611.86549"
capture_lex $P58
new $P46, 'ExceptionHandler'
set_addr $P46, control_45
$P46."handle_types"(58)
push_eh $P46
new $P47, "Perl6Scalar"
.lex "self", $P47
.local pmc true
true = get_hll_global 'True'
find_lex_skip_current $P48, "$_"
$P49 = new ['Perl6Scalar'], $P48
setprop $P49, "rw", true
.lex "$_", $P49
find_lex_skip_current $P50, "$/"
$P51 = new ['Perl6Scalar'], $P50
setprop $P51, "rw", true
.lex "$/", $P51
find_lex_skip_current $P52, "$!"
$P53 = new ['Perl6Scalar'], $P52
setprop $P53, "rw", true
.lex "$!", $P53
.lex "call_sig", param_54
new $P55, "Perl6Scalar"
.lex "$a", $P55
new $P56, "Hash"
.lex "%_", $P56
find_lex $P57, "call_sig"
bind_signature $P57
.annotate "line", 3
new $P72, "Exception"
set $P72['type'], 58
new $P73, "Perl6Str"
assign $P73, "T was "
find_lex $P74, "T"
concat $P75, $P73, $P74
new $P76, "Perl6Str"
assign $P76, " and "
concat $P77, $P75, $P76
find_lex $P78, "$a"
descalarref $P79, $P78
$S80 = $P79."WHAT"()
concat $P81, $P77, $S80
setattribute $P72, 'payload', $P81
throw $P72
.annotate "line", 2
.return ()
control_45:
.local pmc exception
.get_results (exception)
getattribute $P82, exception, "payload"
.return ($P82)
.end
.HLL "perl6"
.namespace ["F[::T]"]
.sub "!sig_setup_1264098611.72973_11" :subid("24_1264098611.86549") :outer("23_1264098611.86549")
.annotate "line", 2
.const 'Sub' $P63 = "25_1264098611.86549"
capture_lex $P63
$P59 = allocate_signature 3
.local pmc signature_12
set signature_12, $P59
null $P0
null $S0
get_global $P60, "Mu"
set_signature_elem signature_12, 0, $S0, 192, $P60, $P0, $P0, $P0, $P0, $P0
get_hll_global $P61, "Block"
.const 'Sub' $P63 = "25_1264098611.86549"
capture_lex $P63
$P70 = $P61."new"($P63, 0, "")
set_signature_elem signature_12, 1, "$a", 128, $P70, $P0, $P0, $P0, $P0, $P0
get_global $P71, "Mu"
set_signature_elem signature_12, 2, "%_", 8208, $P71, $P0, $P0, $P0, $P0, $P0
.local pmc signature
set signature, signature_12
.return (signature)
.end
.HLL "perl6"
.namespace ["F[::T]"]
.sub "_block62" :anon :subid("25_1264098611.86549") :outer("24_1264098611.86549")
.param pmc param_64
.annotate "line", 2
.lex "$_", param_64
find_lex $P65, "T"
find_lex $P66, "$_"
$P67 = $P65."ACCEPTS"($P66)
.return ($P67)
.end
.HLL "perl6"
.namespace ["F[::T]"]
.sub "" :load :init :subid("post33") :outer("25_1264098611.86549")
.annotate "line", 2
.const 'Sub' $P63 = "25_1264098611.86549"
.local pmc block
set block, $P63
$P68 = allocate_signature 1
.local pmc signature_10
set signature_10, $P68
null $P0
null $S0
get_global $P69, "Mu"
set_signature_elem signature_10, 0, "$_", 0, $P69, $P0, $P0, $P0, $P0, $P0
.local pmc signature
set signature, signature_10
setprop block, "$!signature", signature
.end
.HLL "perl6"
.namespace ["Foo"]
.sub "_block88" :subid("26_1264098611.86549") :outer("19_1264098611.86549")
.annotate "line", 7
.const 'Sub' $P96 = "27_1264098611.86549"
capture_lex $P96
.local pmc true
true = get_hll_global 'True'
find_lex_skip_current $P90, "$_"
$P91 = new ['Perl6Scalar'], $P90
setprop $P91, "rw", true
.lex "$_", $P91
find_lex_skip_current $P92, "$/"
$P93 = new ['Perl6Scalar'], $P92
setprop $P93, "rw", true
.lex "$/", $P93
find_lex_skip_current $P94, "$!"
$P95 = new ['Perl6Scalar'], $P94
setprop $P95, "rw", true
.lex "$!", $P95
.const 'Sub' $P96 = "27_1264098611.86549"
capture_lex $P96
.return ($P96)
.end
.HLL "perl6"
.namespace ["Foo"]
.sub "!class_init_16" :subid("27_1264098611.86549") :outer("26_1264098611.86549")
.annotate "line", 7
get_hll_global $P97, "ClassHOW"
$P98 = $P97."new"("Foo")
.local pmc meta
set meta, $P98
get_hll_global $P99, "F"
get_hll_global $P100, "Int"
$P101 = $P99."postcircumfix:<[ ]>"($P100)
"&trait_mod:<does>"(meta, $P101)
get_hll_global $P102, "ClassHOW"
$P103 = $P102."compose"(meta)
.return ($P103)
.end
.HLL "perl6"
.namespace ["Bar"]
.sub "_block104" :subid("28_1264098611.86549") :outer("19_1264098611.86549")
.annotate "line", 10
.const 'Sub' $P112 = "29_1264098611.86549"
capture_lex $P112
.local pmc true
true = get_hll_global 'True'
find_lex_skip_current $P106, "$_"
$P107 = new ['Perl6Scalar'], $P106
setprop $P107, "rw", true
.lex "$_", $P107
find_lex_skip_current $P108, "$/"
$P109 = new ['Perl6Scalar'], $P108
setprop $P109, "rw", true
.lex "$/", $P109
find_lex_skip_current $P110, "$!"
$P111 = new ['Perl6Scalar'], $P110
setprop $P111, "rw", true
.lex "$!", $P111
.const 'Sub' $P112 = "29_1264098611.86549"
capture_lex $P112
.return ($P112)
.end
.HLL "perl6"
.namespace ["Bar"]
.sub "!class_init_17" :subid("29_1264098611.86549") :outer("28_1264098611.86549")
.annotate "line", 10
get_hll_global $P113, "ClassHOW"
$P114 = $P113."new"("Bar")
.local pmc meta
set meta, $P114
get_hll_global $P115, "F"
get_hll_global $P116, "Str"
$P117 = $P115."postcircumfix:<[ ]>"($P116)
"&trait_mod:<does>"(meta, $P117)
get_hll_global $P118, "ClassHOW"
$P119 = $P118."compose"(meta)
.return ($P119)
.end
.HLL "perl6"
.namespace []
.sub "_block142" :load :init :anon :subid("30_1264098611.86549")
.annotate "line", 1
$P144 = "!fire_phasers"("CHECK")
.return ($P144)
.end
.HLL "perl6"
.namespace []
.sub "_block145" :load :anon :subid("31_1264098611.86549")
.annotate "line", 1
.const 'Sub' $P147 = "18_1264098611.86549"
$P148 = "!UNIT_START"($P147)
.return ($P148)
.end
role F[::T] {
method x(T $a) {
return 'T was ' ~ T ~ ' and ' ~ $a.WHAT;
}
}
class Foo does F[Int] {
}
class Bar does F[Str] {
}
say Foo.new.x(10);
say Bar.new.x('str');
say Foo.new.x('str');
# vim: ft=perl6
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment