Skip to content

Commit

Permalink
Rip out the .fixup_cloned_sub macro - we don't need it any more. Shou…
Browse files Browse the repository at this point in the history
…ld make .clone a tiny, tiny bit cheaper by saving a (useless) check.
  • Loading branch information
jnthn committed Feb 24, 2010
1 parent 90b5153 commit a7874a7
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 20 deletions.
19 changes: 0 additions & 19 deletions src/builtins/Mu.pir
Expand Up @@ -42,24 +42,6 @@ like this.

=cut

.macro fixup_cloned_sub(orig, copy)
.local pmc tmp, tmp2
tmp = getprop '$!signature', .orig
if null tmp goto sub_fixup_done
setprop .copy, '$!signature', tmp
.local pmc oclass, sclass
oclass = typeof .orig
sclass = get_class ['Sub']
$I0 = issame oclass, sclass
if $I0 goto sub_fixup_done
tmp = getattribute .orig, ['Sub'], 'proxy'
tmp = getprop '$!real_self', tmp
if null tmp goto sub_fixup_done
tmp2 = getattribute .copy, ['Sub'], 'proxy'
setprop tmp2, '$!real_self', tmp
sub_fixup_done:
.endm

.namespace ['Mu']
.sub 'clone' :method
.param pmc new_attrs :slurpy :named
Expand Down Expand Up @@ -89,7 +71,6 @@ like this.
goto attrinit_loop
attrinit_done:
.fixup_cloned_sub(self, result)
.return (result)
.end
Expand Down
1 change: 0 additions & 1 deletion src/builtins/Routine.pir
Expand Up @@ -97,7 +97,6 @@ Returns a curried version of self.
.local pmc orig_wrapper, tmp, tmp2
orig_wrapper = wrapper
wrapper = clone orig_wrapper
.fixup_cloned_sub(orig_wrapper, wrapper)
.const 'Sub' $P1 = '!wrap_clholder_helper'
$P1 = clone $P1
setprop $P1, '$!wrapper_block', wrapper
Expand Down

0 comments on commit a7874a7

Please sign in to comment.