Skip to content

Commit

Permalink
Epic hack to work around an apparent Parrot register allocation bug. …
Browse files Browse the repository at this point in the history
…Gets us passing more of wrap.t.
  • Loading branch information
jnthn committed Oct 19, 2009
1 parent a834894 commit b1ffd35
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/classes/Routine.pir
Expand Up @@ -42,7 +42,7 @@ wrappable executable objects.
# If not, need to create a new candidate list with the current sub,
# and install the wrap helper that will start dispatching at the
# start of the candidate list.
.local pmc p6i
.local pmc p6i, p6i_copy
cand_list = root_new ['parrot';'ResizablePMCArray']
unshift cand_list, cur_sub
p6i = root_new ['parrot';'P6Invocation'], cand_list
Expand All @@ -51,6 +51,7 @@ wrappable executable objects.
$P0 = newclosure $P0
setattribute self, ['Sub'], 'proxy', $P0
setprop $P0, '@!candidates', cand_list
p6i_copy = p6i

# We need to clone the wrapper, then tweak it to have an outer of
# !wrap_clholder_helper, which we use to hold the candidate list,
Expand Down Expand Up @@ -82,6 +83,10 @@ wrappable executable objects.
handle = box $I0
setprop $P1, '$!handle', handle
unshift cand_list, $P1

if null p6i_copy goto done
p6i = p6i_copy
done:
.return (handle)
.end
.sub '!wrap_start_helper' :anon :outer('wrap')
Expand All @@ -94,7 +99,7 @@ wrappable executable objects.
.sub '!wrap_clholder_helper' :anon
.param pmc pos_args :slurpy
.param pmc named_args :slurpy :named
say "!wrap_clholder_helper"

# Slot for candidate list.
.lex '__CANDIDATE_LIST__', $P0

Expand Down

0 comments on commit b1ffd35

Please sign in to comment.