Changeset 187 for trunk/thune/tests

Show
Ignore:
Timestamp:
06/20/06 05:09:27 (3 years ago)
Author:
krobillard
Message:

Thune - Major improvement to the handling of local function values.
Locals can now be passed to inner functions and caught when returned.
Functions are no longer tied to the thread which created them.

The localArgBlk has been eliminated and locals are now stored on the stack.
To accomodate this, the data stack is now separate from the control stack
and grows upwards. This also means that functions can no longer access the
stack below the function call. A limit of one returned value is in place.

To regain full stack usage, locals could be stored on the control stack.
The only downside would be an extra copy of arguments from the data to
the control stack.

ur_wordCell() is now a function rather than a macro.

uc_do() has been merged into ur_eval() and 'do is now implemented as an opcode.

. & .s now use uc_console_out() rather than dprint.

Location:
trunk/thune/tests/working
Files:
4 modified

Legend:

Unmodified
Added
Removed
  • trunk/thune/tests/working/local.good

    r183 r187  
     1--- Args only --- 
    12"hi" 
    23'ag 
     
    789 
    8911 
    9  
    10 Local Vars 1 
     10--- Local Vars --- 
    1111none 
    121244 
    13 "orig" 
    14  
    15 Local Vars 2 
     13'orig 
     14--- Arg & Vars --- 
    16157 
    17 "orig" 
    18 "orig" 
    19 "orig" 
     16--- Recursion --- 
     172 
     183 
     194 
     205 
     21--- Original values --- 
     22orig orig orig 
  • trunk/thune/tests/working/local.t

    r183 r187  
     1'orig dup dup :a :b :c 
     2 
     3 
     4"--- Args only ---" print 
    15[word n -- ][ 
    26  word . 
    37] 
    48func :sf 
    5  
    6  
    7 "orig" dup dup :a :b :c 
    89 
    910[a b -- ][ 
     
    1516] 
    1617func :lf 
    17  
    18  
    19181 2 lf . 
    20198 2 lf . 
    2120 
    2221 
    23 "^/Local Vars 1" print 
     22"--- Local Vars ---" print 
    2423[| a][ 
    2524    a . 
     
    3231 
    3332 
    34 "^/Local Vars 2" print 
     33"--- Arg & Vars ---" print 
    3534[a | b c][ 
    3635    2 :b 
     
    4039func :lf 
    41405 lf 
    42 a . 
    43 b . 
    44 c . 
     41 
     42 
     43"--- Recursion ---" print 
     44[a b | c][ 
     45    b zero? iff (a b dec rf) 
     46    a b add :c 
     47    c . 
     48] 
     49func :rf 
     502 3 rf 
     51 
     52 
     53"--- Original values ---" print 
     54[a b c] print 
  • trunk/thune/tests/working/tail.good

    r17 r187  
    223628800 
    333628800 
    4 unset 
  • trunk/thune/tests/working/throw.t

    r40 r187  
    11 
    2 nop 
    32[1 2 add "whee" throw] ["Caught: " prin print] try 
    43