Changeset 14337 for src/Pugs/Eval.hs

Show
Ignore:
Timestamp:
10/17/06 08:25:35 (2 years ago)
Author:
audreyt
svk:copy_cache_prev:
21206
Message:

* Remove Judy from the Pugs build process.

This is a pervasive change to avoid GC issues completely
before the release, as the nature of addForeignPtrFinalizer's
weird interaction with GHC is not fully diagnosed.

Also, TVar/IORef based storage, which was exceedingly slow
in GHC 6.4, now actually compares competitively with Judy maps.
Judy is still more memory efficient and may be faster on some
architectures, but its re-incoporation will have to wait until
after release and a fuller understanding of its use of FFI/GC.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • src/Pugs/Eval.hs

    r14317 r14337  
    456456    evalExp $ App (_Var "&Pugs::Internals::but_block") Nothing [obj, block] 
    457457 
    458 reduceSyn "if" [cond, bodyIf, bodyElse] = do 
    459     vbool     <- enterRValue $ enterEvalContext (cxtItem "Bool") cond 
    460     vb        <- fromVal vbool 
    461     reduce $ if vb then bodyIf else bodyElse 
    462  
    463 reduceSyn "cond" [cond, bodyIf, bodyElse] = do 
    464     topic <- enterRValue $ enterEvalContext (cxtItem "Bool") cond 
    465     vb    <- fromVal topic 
    466     sub   <- fromCodeExp $ if vb then bodyIf else bodyElse 
    467     apply sub Nothing [App (_Var "&VAR") (Just (Val topic)) []] 
     458reduceSyn name [cond, bodyIf, bodyElse] 
     459    | "if"     <- name = doCond id 
     460    | "unless" <- name = doCond not 
     461    where 
     462    doCond :: (Bool -> Bool) -> Eval Val 
     463    doCond f = do 
     464        vbool     <- enterRValue $ enterEvalContext (cxtItem "Bool") cond 
     465        vb        <- fromVal vbool 
     466        if (f vb) 
     467            then reduce bodyIf 
     468            else reduce bodyElse 
    468469 
    469470reduceSyn "for" [list, body] = enterLoop $ do 
     
    14821483        return $ mkCode 
    14831484            { subEnv        = Just env 
    1484             , subType       = SubPrim   -- This is a pseudoblock with no scope 
     1485            , subType       = SubBlock 
    14851486            , subParams     = [defaultScalarParam] 
    14861487            , subBody       = x 
    14871488            } 
    1488     Noop                        -> fromCodeExp (Syn "block" [Noop]) 
    14891489    _                           -> fromClosure x 
    14901490    where