Changeset 6308

Show
Ignore:
Timestamp:
08/17/05 20:20:36 (3 years ago)
Author:
iblech
svk:copy_cache_prev:
8581
Message:

PIL2JS: Very minor optimization: PIL2JS.subpads, PIL2JS.callchain ->
PIL2JS_subpads, PIL2JS_callchain, yielding 4% speedup.

Files:
4 modified

Legend:

Unmodified
Added
Removed
  • lib/pugs/hack.pod

    r6299 r6308  
    294294 
    295295L<http://rt.openfoundry.org/Foundry/Project/Source/index.html/pugs/browse/> 
    296 Browsable pugs vcs.  You sometimes get a blank page the first time you 
    297 access a url (a timeout) - just click again. 
    298  
    299 =item * 
    300  
    301 L<http://svn.perl.org/perl6/pugs/trunk/> Mirror of pugs vcs head. 
     296Browsable Pugs vcs.  You sometimes get a blank page the first time you 
     297access a URL (a timeout) - just click again. 
     298 
     299=item * 
     300 
     301L<http://svn.perl.org/perl6/pugs/trunk/> Mirror of Pugs vcs head. 
    302302Usually faster and more reliable than the openfoundry browser. 
    303303 
  • perl5/PIL2JS/lib/PIL.pm

    r6302 r6308  
    107107var __returncc = args.pop(); 
    108108var %s = function (retval) { 
    109   PIL2JS.call_chain.pop(); PIL2JS.subpads.pop(); 
     109  PIL2JS_callchain.pop(); PIL2JS_subpads.pop(); 
    110110  %s; 
    111111  throw function () { __returncc(retval) }; 
     
    185185PIL2JS.catch_all_exceptions(function () { 
    186186  PIL2JS.runloop(function () { 
    187     var pad = {}; PIL2JS.subpads.push(pad); 
     187    var pad = {}; PIL2JS_subpads.push(pad); 
    188188    pad['\$?POSITION'] = _24main_3a_3a_3fPOSITION; 
    189189    pad['\$_']         = _24main_3a_3a_; 
     
    191191  }); 
    192192}); 
    193 PIL2JS.subpads.pop(); 
     193PIL2JS_subpads.pop(); 
    194194EOF 
    195195} 
  • perl5/PIL2JS/lib/PIL/Subs.pm

    r6302 r6308  
    6161    $magical_vars =~ s/%NAME/PIL::doublequote $PIL::CUR_SUBNAME/eg; 
    6262 
    63     my $callchain   = "PIL2JS.call_chain.push(" . PIL::name_mangle($self->{pSubName}) . ")"; 
    64     my $new_pad     = "var pad = {}; PIL2JS.subpads.push(pad)"; 
     63    my $callchain   = "PIL2JS_callchain.push(" . PIL::name_mangle($self->{pSubName}) . ")"; 
     64    my $new_pad     = "var pad = {}; PIL2JS_subpads.push(pad)"; 
    6565    my $params      = $self->{pSubParams}->as_js; 
    6666 
     
    155155    local $PIL::CUR_SUBNAME = "<anonymous@{[$PIL::CUR_SUBNAME ? ' in ' . $PIL::CUR_SUBNAME : '']}>"; 
    156156 
    157     my $new_pad      = "var pad = {}; PIL2JS.subpads.push(pad)"; 
     157    my $new_pad      = "var pad = {}; PIL2JS_subpads.push(pad)"; 
    158158    my $params       = $self->{pParams}->as_js; 
    159159    my $magical_vars = $PIL::IN_SUBLIKE >= PIL::SUBROUTINE 
  • perl5/PIL2JS/libjs/PIL2JS.js

    r6208 r6308  
    683683 
    684684// Array of boxed subs we're currently in. 
    685 PIL2JS.call_chain = []; 
     685var PIL2JS_callchain = []; 
    686686// Array of pads we're currently in, used for $CALLER::. 
    687687// Note that the pads change at runtime, i.e.: 
    688688//   # No my $a yet 
    689 //   # PIL2JS.subpads[-1]["$a"] undefined 
     689//   # PIL2JS_subpads[-1]["$a"] undefined 
    690690//   my $a; 
    691 //   # PIL2JS.subpads[-1]["$a"] is defined now. 
    692 PIL2JS.subpads    = []; 
     691//   # PIL2JS_subpads[-1]["$a"] is defined now. 
     692var PIL2JS_subpads   = []; 
    693693PIL2JS.resolve_callervar = function (delta, name) { 
    694694  // delta == 0: current pad 
     
    697697  // etc. 
    698698 
    699   if(PIL2JS.subpads.length >= delta + 1) { 
    700     var pad = PIL2JS.subpads[PIL2JS.subpads.length - delta - 1]; 
     699  if(PIL2JS_subpads.length >= delta + 1) { 
     700    var pad = PIL2JS_subpads[PIL2JS_subpads.length - delta - 1]; 
    701701    if(pad[name]) { 
    702702      return pad[name];