Skip to content

Commit

Permalink
disable auto-finalize for now
Browse files Browse the repository at this point in the history
To finalize, we need to get the exception with get_results.
Unfortunately, get_results clears the caller object, so other
code also doing a get_results to get the exception will no
longer work. I don't know how to fix that except to add a
new op that just "peeks" at the exception.
  • Loading branch information
mlschroe committed Nov 16, 2011
1 parent e80192d commit 307b816
Showing 1 changed file with 14 additions and 14 deletions.
28 changes: 14 additions & 14 deletions compilers/pct/src/PAST/Compiler.pir
Original file line number Diff line number Diff line change
Expand Up @@ -966,7 +966,7 @@ Return the POST representation of a C<PAST::Control>.
node = shift it
.local pmc ehpir, label
.local string exceptreg
#.local string exceptreg
$P0 = get_hll_global ['POST'], 'Label'
$S0 = self.'unique'('control_')
label = $P0.'new'('result'=>$S0)
Expand All @@ -975,23 +975,23 @@ Return the POST representation of a C<PAST::Control>.
# Push the handler itself
tail.'push'(label)
exceptreg = self.'uniquereg'('P')
$S0 = concat '(', exceptreg
$S0 = concat $S0, ')'
tail.'push_pirop'('.get_results', $S0)
#exceptreg = self.'uniquereg'('P')
#$S0 = concat '(', exceptreg
#$S0 = concat $S0, ')'
#tail.'push_pirop'('.get_results', $S0)
ehpir = self.'as_post'(node, 'rtype'=>rtype)
unless result goto handler_loop_no_result
ehpir = self.'coerce'(ehpir, result)
handler_loop_no_result:
tail.'push'(ehpir)
tail.'push_pirop'('finalize', exceptreg)
#tail.'push_pirop'('finalize', exceptreg)
unless addreturn goto handler_loop_no_return
.local pmc retval
retval = ehpir.'result'()
tail.'push_pirop'('return', retval)
goto handler_loop
handler_loop_no_return:
tail.'push_pirop'('pop_upto_eh', exceptreg)
#tail.'push_pirop'('pop_upto_eh', exceptreg)
$I0 = depth
pops_loop_handler:
tail.'push_pirop'('pop_eh')
Expand Down Expand Up @@ -1977,11 +1977,11 @@ handler.
else_done:
ops.'push_pirop'('goto', endlabel)
ops.'push'(catchlabel)
.local string exceptreg
exceptreg = self.'uniquereg'('P')
$S0 = concat '(', exceptreg
$S0 = concat $S0, ')'
ops.'push_pirop'('.get_results', $S0)
#.local string exceptreg
#exceptreg = self.'uniquereg'('P')
#$S0 = concat '(', exceptreg
#$S0 = concat $S0, ')'
#ops.'push_pirop'('.get_results', $S0)
.local pmc catchpast, catchpost
catchpast = node[1]
if null catchpast goto catchpost_done
Expand All @@ -1991,8 +1991,8 @@ handler.
catchpost_no_result:
ops.'push'(catchpost)
catchpost_done:
ops.'push_pirop'('finalize', exceptreg)
ops.'push_pirop'('pop_upto_eh', exceptreg)
#ops.'push_pirop'('finalize', exceptreg)
#ops.'push_pirop'('pop_upto_eh', exceptreg)
ops.'push_pirop'('pop_eh')
catch_done:
ops.'push'(endlabel)
Expand Down

0 comments on commit 307b816

Please sign in to comment.