Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Small optimizations to signature binding; costs us a PMC creation and…
… a method call less every invocation of something that has a signature, which gives a 7% speed-up in a calling benchmark.
  • Loading branch information
jnthn committed May 15, 2009
1 parent b49cce1 commit 5bd02be
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions src/classes/Signature.pir
Expand Up @@ -367,14 +367,17 @@ lexicals as needed and performing type checks.
callerlex = $P0['lexpad';1]
getprop callersig, '$!signature', callersub
if null callersig goto end
.local pmc it
$P0 = callersig.'params'()
if null $P0 goto end
it = iter $P0
.local pmc params
params = getattribute callersig, "@!params"
if null params goto end
.local int cur_param, count
count = elements params
cur_param = -1
param_loop:
unless it goto param_done
inc cur_param
unless cur_param < count goto param_done
.local pmc param
param = shift it
param = params[cur_param]
.local string name, sigil
name = param['name']
if name == 'self' goto param_loop
Expand Down

0 comments on commit 5bd02be

Please sign in to comment.