[Git][ghc/ghc][wip/decode_cloned_stack] 3 commits: Remove obsolete TODO
Sven Tennie (@supersven)
gitlab at gitlab.haskell.org
Sun Feb 19 17:18:56 UTC 2023
Sven Tennie pushed to branch wip/decode_cloned_stack at Glasgow Haskell Compiler / GHC
Commits:
7b6caf21 by Sven Tennie at 2023-02-19T16:44:25+00:00
Remove obsolete TODO
- - - - -
f069ef1f by Sven Tennie at 2023-02-19T16:57:47+00:00
Cleanup
- - - - -
f8aa7ed1 by Sven Tennie at 2023-02-19T17:18:30+00:00
Cleanup Sanity.c and test compiler flags
- - - - -
5 changed files:
- libraries/ghc-heap/GHC/Exts/Stack/Decode.hs
- libraries/ghc-heap/cbits/Stack.c
- libraries/ghc-heap/cbits/Stack.cmm
- libraries/ghc-heap/tests/all.T
- rts/sm/Sanity.c
Changes:
=====================================
libraries/ghc-heap/GHC/Exts/Stack/Decode.hs
=====================================
@@ -148,7 +148,6 @@ getWord sfi _ = error $ "Unexpected StackFrameIter type: " ++ show sfi
foreign import prim "getRetFunTypezh" getRetFunType# :: WordGetter
--- TODO: Could use getWord
getRetFunType :: StackFrameIter -> IO RetFunType
getRetFunType (SfiClosure {..}) =
toEnum . fromInteger . toInteger
=====================================
libraries/ghc-heap/cbits/Stack.c
=====================================
@@ -184,7 +184,8 @@ StgWord getBCOLargeBitmapSize(StgClosure *c) {
#define SIZEOF_W SIZEOF_VOID_P
#define WDS(n) ((n)*SIZEOF_W)
-static StgArrBytes *largeBitmapToStgArrBytes(Capability *cap, StgLargeBitmap *bitmap) {
+static StgArrBytes *largeBitmapToStgArrBytes(Capability *cap,
+ StgLargeBitmap *bitmap) {
StgWord neededWords = ROUNDUP_BITS_TO_WDS(bitmap->size);
StgArrBytes *array =
(StgArrBytes *)allocate(cap, sizeofW(StgArrBytes) + neededWords);
@@ -243,11 +244,4 @@ StgWord getRetFunType(StgRetFun *ret_fun) {
return fun_info->f.fun_type;
}
-RTS_INFO(box_info);
-StgClosure* getBoxedClosure(Capability *cap, StgClosure **c){
-// StgClosure *box = (StgClosure*) allocate(cap, sizeofW(StgClosure) + 1);
-// SET_HDR(box, &box_info, CCS_SYSTEM);
-// box->payload[0] = *c;
-// return box;
- return *c;
-}
+StgClosure *getBoxedClosure(StgClosure **c) { return *c; }
=====================================
libraries/ghc-heap/cbits/Stack.cmm
=====================================
@@ -3,7 +3,11 @@
#include "Cmm.h"
+// StgStack_marking was not available in the Stage0 compiler at the time of
+// writing. Because, it has been added to derivedConstants when Stack.cmm was
+// developed.
#if defined(StgStack_marking)
+
advanceStackFrameIterzh (P_ stack, W_ offsetWords) {
W_ frameSize;
(frameSize) = ccall stackFrameSize(stack, offsetWords);
@@ -135,7 +139,6 @@ getAddrzh(P_ stack, W_ offsetWords){
addr = (StgStack_sp(stack) + WDS(offsetWords));
P_ ptr;
ptr = P_[addr];
-// ccall printObj(ptr);
return (ptr);
}
@@ -176,21 +179,14 @@ getStackInfoTableAddrzh(P_ stack){
}
getBoxedClosurezh(P_ stack, W_ offsetWords){
- ccall debugBelch("getBoxedClosurezh - stack %p , offsetWords %lu", stack, offsetWords);
-
P_ ptr;
ptr = StgStack_sp(stack) + WDS(offsetWords);
P_ box;
- (box) = ccall getBoxedClosure(MyCapability(), ptr);
- ccall debugBelch("getBoxedClosurezh - box %p", box);
+ (box) = ccall getBoxedClosure(ptr);
return (box);
}
-// TODO: Unused?
-INFO_TABLE_CONSTR(box, 1, 0, 0, CONSTR_1_0, "BOX", "BOX")
-{ foreign "C" barf("BOX object (%p) entered!", R1) never returns; }
-
getStackFieldszh(P_ stack){
bits32 size;
bits8 dirty, marking;
=====================================
libraries/ghc-heap/tests/all.T
=====================================
@@ -57,7 +57,6 @@ test('T21622',
only_ways(['normal']),
compile_and_run, [''])
-# TODO: Remove debug flags
test('stack_big_ret',
[
extra_files(['TestUtils.hs']),
@@ -65,11 +64,11 @@ test('stack_big_ret',
ignore_stderr
],
compile_and_run,
- ['-debug -optc-g -g'])
+ [''])
-# TODO: Remove debug flags
# Options:
-# - `-kc512B -kb64B`: Make stack chunk size small to provoke underflow stack frames.
+# - `-kc512B -kb64B`: Make stack chunk size small to provoke underflow
+# stack frames.
test('stack_underflow',
[
extra_files(['TestUtils.hs']),
@@ -78,9 +77,8 @@ test('stack_underflow',
ignore_stderr
],
compile_and_run,
- ['-debug -optc-g -g'])
+ [''])
-# TODO: Remove debug flags
test('stack_stm_frames',
[
extra_files(['TestUtils.hs']),
@@ -88,9 +86,8 @@ test('stack_stm_frames',
ignore_stderr
],
compile_and_run,
- ['-debug -optc-g -g'])
+ [''])
-# TODO: Remove debug flags
test('stack_misc_closures',
[
extra_files(['stack_misc_closures_c.c', 'stack_misc_closures_prim.cmm', 'TestUtils.hs']),
@@ -102,5 +99,5 @@ test('stack_misc_closures',
[ ('stack_misc_closures_c.c', '')
,('stack_misc_closures_prim.cmm', '')
]
- , '-debug -optc-g -optc-O0 -g -ddump-to-file -dlint -ddump-cmm' # -with-rtsopts="-Dg -Ds -Db"'
+ , '-debug' # Debug RTS to use checkSTACK() (Sanity.c)
])
=====================================
rts/sm/Sanity.c
=====================================
@@ -1324,9 +1324,4 @@ memInventory (bool show)
}
-//TODO: Remove after debugging
-#else
-void
-checkSTACK (StgStack *stack){}
-void checkSanity (bool after_gc, bool major_gc){}
#endif /* DEBUG */
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/8fb2e54ab16b3dfe5f26a3f4a027b3395ac3f6dd...f8aa7ed1b081bb4acee620e43795907a97212a6d
--
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/8fb2e54ab16b3dfe5f26a3f4a027b3395ac3f6dd...f8aa7ed1b081bb4acee620e43795907a97212a6d
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/20230219/3027f6be/attachment-0001.html>
More information about the ghc-commits
mailing list