Changeset 7853
- Timestamp:
- 11/05/05 20:23:35 (3 years ago)
- Location:
- src
- Files:
-
- 2 modified
-
Emit/PIR.hs (modified) (3 diffs)
-
Pugs/CodeGen/PIR.hs (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
src/Emit/PIR.hs
r7851 r7853 48 48 | InsComment !String !(Maybe Ins) -- ^ Comment 49 49 | InsExp !Expression -- ^ Generic expressions 50 | InsConst !LValue !ObjType !Expression -- ^ Constant 50 51 deriving (Show, Eq, Typeable) 51 52 … … 87 88 = PerlScalar | PerlArray | PerlHash 88 89 | PerlInt | PerlPair | PerlRef | PerlEnv 89 | Closure | Continuation90 | Sub | Closure | Continuation 90 91 | BareType String 91 92 deriving (Show, Eq, Typeable) … … 152 153 emit (InsTailFun fun args) = emitFun "tailcall" fun args [] 153 154 emit (InsExp _) = empty 155 emit (InsConst ident rtyp lit) = 156 emit ".const" <+> emit rtyp <+> emit ident <+> equals <+> emit lit 154 157 emit (InsLabel label) = nest (-2) (emit label <> colon) 155 158 emit (InsComment comment ins) = emit (StmtComment comment) $+$ emit ins -
src/Pugs/CodeGen/PIR.hs
r7851 r7853 110 110 [begL, endL] <- genLabel ["blockBegin", "blockEnd"] 111 111 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] 114 115 tellIns $ "goto" .- [bare endL] 115 116 tellLabel begL
