Changeset 7853

Show
Ignore:
Timestamp:
11/05/05 20:23:35 (3 years ago)
Author:
autrijus
Message:

* Parrot 0.3.1 doesn't allow set_addr for Closure, so use

newclosure instead.

Location:
src
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • src/Emit/PIR.hs

    r7851 r7853  
    4848    | InsComment    !String !(Maybe Ins)            -- ^ Comment 
    4949    | InsExp        !Expression                     -- ^ Generic expressions 
     50    | InsConst      !LValue !ObjType !Expression    -- ^ Constant 
    5051    deriving (Show, Eq, Typeable) 
    5152 
     
    8788    = PerlScalar | PerlArray | PerlHash 
    8889    | PerlInt | PerlPair | PerlRef | PerlEnv 
    89     | Closure | Continuation 
     90    | Sub | Closure | Continuation 
    9091    | BareType String 
    9192    deriving (Show, Eq, Typeable) 
     
    152153    emit (InsTailFun fun args) = emitFun "tailcall" fun args [] 
    153154    emit (InsExp _) = empty 
     155    emit (InsConst ident rtyp lit) = 
     156        emit ".const" <+> emit rtyp <+> emit ident <+> equals <+> emit lit 
    154157    emit (InsLabel label) = nest (-2) (emit label <> colon) 
    155158    emit (InsComment comment ins) = emit (StmtComment comment) $+$ emit ins 
  • src/Pugs/CodeGen/PIR.hs

    r7851 r7853  
    110110        [begL, endL] <- genLabel ["blockBegin", "blockEnd"] 
    111111        this    <- genPMC "block" 
    112         tellIns $ InsNew (reg this) Closure 
    113         tellIns $ "set_addr" .- [reg this, bare begL] 
     112        let begP = begL ++ "_C" 
     113        tellIns $ InsConst (VAR begP) Sub (lit begL) 
     114        tellIns $ reg this <-- "newclosure" $ [bare begP] 
    114115        tellIns $ "goto" .- [bare endL] 
    115116        tellLabel begL