Show
Ignore:
Timestamp:
08/20/05 15:47:35 (3 years ago)
Author:
iblech
svk:copy_cache_prev:
8581
Message:

* Usual svn props.
* PIL2JS: &?CALLER_CONTINUATION.

  • t/unspecced/cont.t: Added some type annotations and a new test. PIL2JS passes 14/14 with 6 unexpected succeedings. :)
  • PIL, PIL2JS.js: PIL2JS.cps2normal now works correctly with functions which reach the end of the program (this can happen, for example, with continuations :)). Previously, the program flow was restarted after the call to PIL2JS.cps2normal, resulting in certain regions running twice.
  • PIL, PIL::PVar, PIL::Subs: sub foo { {return}() } didn't compile, because PIL2JS only kept track of the current subtype, not of all subs it's currently in. Fixed.

* PIL2JS: PIL, PIL2JS.js, README: Context objects are now unboxed -- boxing was

never needed. Should give a small speedup.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • perl5/PIL2JS/lib/PIL.pm

    r6315 r6376  
    1818# Are we in a sublike thing? If yes, what sublevel does that thing have? 
    1919our $IN_SUBLIKE = undef; 
     20our @IN_SUBLIKES; 
    2021 
    2122# What's the name of the sub we're currently in? 
     
    2324 
    2425# Our current pos? 
    25 our $CUR_POS  = bless [ "<unknown>", (0) x 4 ] => "PIL::MkPos"; 
     26our $CUR_POS  = bless { 
     27  posName => "<unknown>", 
     28  posBeginLine   => 0, 
     29  posBeginColumn => 0, 
     30  posEndLine     => 0, 
     31  posEndColumn   => 0, 
     32} => "PIL::MkPos"; 
    2633 
    2734# Are we in pilGlob? 
     
    181188    "\n// End of initialization of global vars and exportation of subs.\n"; 
    182189 
    183   return sprintf <<EOF, $decl_js, add_indent(2, join "\n", @glob_js, $init_js, $main_js); 
     190  return sprintf <<EOF, $decl_js, add_indent(3, join "\n", @glob_js, $init_js, $main_js); 
    184191%s 
    185192PIL2JS.catch_all_exceptions(function () { 
    186   PIL2JS.runloop(function () { 
    187     var PIL2JS = AlsoPIL2JS_SpeedupHack; 
    188     var pad = {}; PIL2JS_subpads.push(pad); 
    189     pad['\$?POSITION'] = _24main_3a_3a_3fPOSITION; 
    190     pad['\$_']         = _24main_3a_3a_; 
     193  PIL2JS.catch_end_exception(function() { 
     194    PIL2JS.runloop(function () { 
     195      var PIL2JS = AlsoPIL2JS_SpeedupHack; 
     196      var pad = {}; PIL2JS_subpads.push(pad); 
     197      pad['\$?POSITION'] = _24main_3a_3a_3fPOSITION; 
     198      pad['\$_']         = _24main_3a_3a_; 
    191199 
    192200%s 
     201    }); 
    193202  }); 
    194203}); 
     
    207216 
    208217  sub as_js { 
    209     return sprintf "new PIL2JS.Box.Constant(new PIL2JS.Context({ main: %s, type: %s }))", 
     218    return sprintf "new PIL2JS.Context({ main: %s, type: %s })", 
    210219      PIL::doublequote($_[0]->main), 
    211220      defined $_[0]->type