Duncan Coutts pushed to branch wip/dcoutts/io-manager-io-primop-exceptions at Glasgow Haskell Compiler / GHC Commits: b4786f8f by Duncan Coutts at 2026-08-29T23:24:27+01:00 FIXUP: try reordering INFO_TABLE_RET to fix wasm assembler issue - - - - - 54810171 by Duncan Coutts at 2026-08-29T23:24:52+01:00 FIXUP: to try and fix unreg backend issue - - - - - 2 changed files: - rts/HeapStackCheck.cmm - rts/PrimOps.cmm Changes: ===================================== rts/HeapStackCheck.cmm ===================================== @@ -892,22 +892,6 @@ to pass in R2 we have to use a dummy first argument which will be passed in R1 (and ignored). */ -/* Blocking for I/O primops with result IO (). - * See Note [Thread blocking for new I/O primops]. - */ -stg_block_io_unit -{ - /* Fill out the stack frame with dummy values. The IO manager will - * overwrite these with the actual results when the I/O operation - * completes, fails, or is cancelled. - */ - Sp_adj(-3); - Sp(0) = stg_block_io_unit_info; - Sp(1) = 0; // outcome: 0 indicates IOOpOutcomeInFlight - Sp(2) = 0; // result/errno - BLOCK_GENERIC; -} - /* stg_block_io_unit_info : the return info table for stg_block_io_unit */ INFO_TABLE_RET ( stg_block_io_unit, RET_SMALL, W_ info_ptr, W_ outcome, W_ result ) @@ -925,17 +909,17 @@ INFO_TABLE_RET ( stg_block_io_unit, RET_SMALL, W_ info_ptr, } } -/* Blocking for I/O primops with result IO Int or Word (or rather Int#/Word#). +/* Blocking for I/O primops with result IO (). * See Note [Thread blocking for new I/O primops]. */ -stg_block_io_int +stg_block_io_unit { /* Fill out the stack frame with dummy values. The IO manager will * overwrite these with the actual results when the I/O operation * completes, fails, or is cancelled. */ Sp_adj(-3); - Sp(0) = stg_block_io_int_info; + Sp(0) = stg_block_io_unit_info; Sp(1) = 0; // outcome: 0 indicates IOOpOutcomeInFlight Sp(2) = 0; // result/errno BLOCK_GENERIC; @@ -957,3 +941,19 @@ INFO_TABLE_RET ( stg_block_io_int, RET_SMALL, W_ info_ptr, return (result); } } + +/* Blocking for I/O primops with result IO Int or Word (or rather Int#/Word#). + * See Note [Thread blocking for new I/O primops]. + */ +stg_block_io_int +{ + /* Fill out the stack frame with dummy values. The IO manager will + * overwrite these with the actual results when the I/O operation + * completes, fails, or is cancelled. + */ + Sp_adj(-3); + Sp(0) = stg_block_io_int_info; + Sp(1) = 0; // outcome: 0 indicates IOOpOutcomeInFlight + Sp(2) = 0; // result/errno + BLOCK_GENERIC; +} ===================================== rts/PrimOps.cmm ===================================== @@ -2297,16 +2297,6 @@ stg_whereFromzh (P_ clos, W_ buf) Thread I/O blocking primitives -------------------------------------------------------------------------- */ -stg_waitReadzh ( W_ fd ) -{ - jump stg_waitReadyFd(fd, /* IORead */ 0::CInt); -} - -stg_waitWritezh ( W_ fd ) -{ - jump stg_waitReadyFd(fd, /* IOWrite */ 1::CInt); -} - stg_waitReadyFd ( W_ fd, CInt rw ) { CInt result; @@ -2346,6 +2336,16 @@ stg_waitReadyFd ( W_ fd, CInt rw ) ccall sbarf("syncIOWaitReady result encoding error") never returns; } +stg_waitReadzh ( W_ fd ) +{ + jump stg_waitReadyFd(fd, /* IORead */ 0::CInt); +} + +stg_waitWritezh ( W_ fd ) +{ + jump stg_waitReadyFd(fd, /* IOWrite */ 1::CInt); +} + stg_delayzh ( W_ us_delay ) { CBool ok; /* Ok, or heap alloc failure. */ View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/7bd39b65c3d99c6f5fd2e3c6a54f73a... -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/7bd39b65c3d99c6f5fd2e3c6a54f73a... You're receiving this email because of your account on gitlab.haskell.org. Manage all notifications: https://gitlab.haskell.org/-/profile/notifications | Help: https://gitlab.haskell.org/help
participants (1)
-
Duncan Coutts (@dcoutts)