[Git][ghc/ghc][wip/osa1/std_string_thunks] Implement stack check

Ömer Sinan Ağacan gitlab at gitlab.haskell.org
Thu May 28 10:08:41 UTC 2020



Ömer Sinan Ağacan pushed to branch wip/osa1/std_string_thunks at Glasgow Haskell Compiler / GHC


Commits:
f1154530 by Ömer Sinan Ağacan at 2020-05-28T13:08:31+03:00
Implement stack check

- - - - -


1 changed file:

- rts/StgStdThunks.cmm


Changes:

=====================================
rts/StgStdThunks.cmm
=====================================
@@ -296,12 +296,18 @@ INFO_TABLE(stg_MK_STRING, 0, 1, THUNK_STATIC, "stg_MK_STRING", "stg_MK_STRING")
 {
     W_ newCAF_ret;
 
+    // TODO (osa): Not sure why we do stack check before `newCAF`, but this is
+    // how `unpackCString# str` thunks are today.
+    if (Sp - WDS(2) < SpLim) {
+        jump stg_gc_enter_1(node);
+    }
+
     (newCAF_ret) = ccall newCAF(BaseReg "ptr", node "ptr");
 
     if (newCAF_ret == 0) {
         jump node();
     } else {
-        // TODO: Stack checks?
+        // Stack check done above
         Sp_adj(-2);
         Sp(1) = node;
         Sp(0) = stg_bh_upd_frame_info;



View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/f11545306dc083e14b104d2c0d7ef749dd6cb15a

-- 
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/f11545306dc083e14b104d2c0d7ef749dd6cb15a
You're receiving this email because of your account on gitlab.haskell.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/ghc-commits/attachments/20200528/9d998896/attachment-0001.html>


More information about the ghc-commits mailing list