public
Created

  • Download Gist
gistfile1.txt
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
.include "except_types.pasm"
 
.sub 'foo'
$P0 = box 1
.return ($P0)
.end
 
.sub 'bar'
new $P424, ['ExceptionHandler'], .CONTROL_RETURN
 
set_addr $P424, control_423
 
push_eh $P424
$P0 = box 1
.return ($P0)
control_423:
 
.local pmc exception
.get_results (exception)
 
getattribute $P428, exception, "payload"
 
.return ($P428)
.end
 
.sub 'test' :main
$N1 = time
say $N1
$I0 = 0
loop_1:
if $I0 > 10000000 goto loop_1_end
'foo'()
inc $I0
goto loop_1
loop_1_end:
 
$N1 = time
say $N1
 
$I0 = 0
loop_2:
if $I0 > 10000000 goto loop_2_end
'bar'()
inc $I0
goto loop_2
loop_2_end:
 
$N1 = time
say $N1
.end

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.