diff options
author | Luite Stegeman <stegeman@gmail.com> | 2021-05-19 04:35:14 +0200 |
---|---|---|
committer | Marge Bot <ben+marge-bot@smart-cactus.org> | 2021-07-02 23:24:38 -0400 |
commit | 5e30451db2ef1720910abfe69870c3e8255a4b7d (patch) | |
tree | 0405e50f77de55e52806792e09d60a3d83322634 /compiler/GHC/ByteCode | |
parent | c1c9880097ee72985ce39e36f6a9ba114f4aa65d (diff) | |
download | haskell-5e30451db2ef1720910abfe69870c3e8255a4b7d.tar.gz |
Support unlifted datatypes in GHCi
fixes #19628
Diffstat (limited to 'compiler/GHC/ByteCode')
-rw-r--r-- | compiler/GHC/ByteCode/Asm.hs | 22 | ||||
-rw-r--r-- | compiler/GHC/ByteCode/Instr.hs | 10 |
2 files changed, 16 insertions, 16 deletions
diff --git a/compiler/GHC/ByteCode/Asm.hs b/compiler/GHC/ByteCode/Asm.hs index 6b9d4a9223..6ef6ef474c 100644 --- a/compiler/GHC/ByteCode/Asm.hs +++ b/compiler/GHC/ByteCode/Asm.hs @@ -454,7 +454,7 @@ assembleI platform i = case i of JMP l -> emit bci_JMP [LabelOp l] ENTER -> emit bci_ENTER [] RETURN -> emit bci_RETURN [] - RETURN_UBX rep -> emit (return_ubx rep) [] + RETURN_UNLIFTED rep -> emit (return_unlifted rep) [] RETURN_TUPLE -> emit bci_RETURN_T [] CCALL off m_addr i -> do np <- addr m_addr emit bci_CCALL [SmallOp off, Op np, SmallOp i] @@ -522,16 +522,16 @@ push_alts V16 = error "push_alts: vector" push_alts V32 = error "push_alts: vector" push_alts V64 = error "push_alts: vector" -return_ubx :: ArgRep -> Word16 -return_ubx V = bci_RETURN_V -return_ubx P = bci_RETURN_P -return_ubx N = bci_RETURN_N -return_ubx L = bci_RETURN_L -return_ubx F = bci_RETURN_F -return_ubx D = bci_RETURN_D -return_ubx V16 = error "return_ubx: vector" -return_ubx V32 = error "return_ubx: vector" -return_ubx V64 = error "return_ubx: vector" +return_unlifted :: ArgRep -> Word16 +return_unlifted V = bci_RETURN_V +return_unlifted P = bci_RETURN_P +return_unlifted N = bci_RETURN_N +return_unlifted L = bci_RETURN_L +return_unlifted F = bci_RETURN_F +return_unlifted D = bci_RETURN_D +return_unlifted V16 = error "return_unlifted: vector" +return_unlifted V32 = error "return_unlifted: vector" +return_unlifted V64 = error "return_unlifted: vector" {- we can only handle up to a fixed number of words on the stack, diff --git a/compiler/GHC/ByteCode/Instr.hs b/compiler/GHC/ByteCode/Instr.hs index cb1fb4d335..1950289f79 100644 --- a/compiler/GHC/ByteCode/Instr.hs +++ b/compiler/GHC/ByteCode/Instr.hs @@ -172,9 +172,9 @@ data BCInstr -- To Infinity And Beyond | ENTER - | RETURN -- return a lifted value - | RETURN_UBX ArgRep -- return an unlifted value, here's its rep - | RETURN_TUPLE -- return an unboxed tuple (info already on stack) + | RETURN -- return a lifted value + | RETURN_UNLIFTED ArgRep -- return an unlifted value, here's its rep + | RETURN_TUPLE -- return an unboxed tuple (info already on stack) -- Breakpoints | BRK_FUN Word16 Unique (RemotePtr CostCentre) @@ -310,7 +310,7 @@ instance Outputable BCInstr where <+> text "by" <+> ppr n ppr ENTER = text "ENTER" ppr RETURN = text "RETURN" - ppr (RETURN_UBX pk) = text "RETURN_UBX " <+> ppr pk + ppr (RETURN_UNLIFTED pk) = text "RETURN_UNLIFTED " <+> ppr pk ppr (RETURN_TUPLE) = text "RETURN_TUPLE" ppr (BRK_FUN index uniq _cc) = text "BRK_FUN" <+> ppr index <+> ppr uniq <+> text "<cc>" @@ -390,7 +390,7 @@ bciStackUse CASEFAIL{} = 0 bciStackUse JMP{} = 0 bciStackUse ENTER{} = 0 bciStackUse RETURN{} = 0 -bciStackUse RETURN_UBX{} = 1 -- pushes stg_ret_X for some X +bciStackUse RETURN_UNLIFTED{} = 1 -- pushes stg_ret_X for some X bciStackUse RETURN_TUPLE{} = 1 -- pushes stg_ret_t header bciStackUse CCALL{} = 0 bciStackUse SWIZZLE{} = 0 |