Skip to content

Instantly share code, notes, and snippets.

@Tarrasch
Last active August 29, 2015 13:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Tarrasch/8972574 to your computer and use it in GitHub Desktop.
Save Tarrasch/8972574 to your computer and use it in GitHub Desktop.
# Just some good commands
compnd () { "inplace/bin/ghc-stage1" -optc-Wall -optc-Wextra -optc-Wstrict-prototypes -optc-Wmissing-prototypes -optc-Wmissing-declarations -optc-Winline -optc-Waggregate-return -optc-Wpointer-arith -optc-Wmissing-noreturn -optc-Wnested-externs -optc-Wredundant-decls -optc-Iincludes -optc-Iincludes/dist -optc-Iincludes/dist-derivedconstants/header -optc-Iincludes/dist-ghcconstants/header -optc-Irts -optc-Irts/dist/build -optc-DCOMPILING_RTS -optc-fno-strict-aliasing -optc-fno-common -optc-DUSE_DWARF -optc-O2 -optc-fomit-frame-pointer -optc-DRtsWay=\"rts_v\" -static -O -H64m -Iincludes -Iincludes/dist -Iincludes/dist-derivedconstants/header -Iincludes/dist-ghcconstants/header -Irts -Irts/dist/build -DCOMPILING_RTS -package-name rts -dcmm-lint -i -irts -irts/dist/build -irts/dist/build/autogen -Irts/dist/build -Irts/dist/build/autogen -O2 -g -c rts/sm/Scav.c -o $1 -optc-D$2 }
comp () { "inplace/bin/ghc-stage1" -optc-Wall -optc-Wextra -optc-Wstrict-prototypes -optc-Wmissing-prototypes -optc-Wmissing-declarations -optc-Winline -optc-Waggregate-return -optc-Wpointer-arith -optc-Wmissing-noreturn -optc-Wnested-externs -optc-Wredundant-decls -optc-Iincludes -optc-Iincludes/dist -optc-Iincludes/dist-derivedconstants/header -optc-Iincludes/dist-ghcconstants/header -optc-Irts -optc-Irts/dist/build -optc-DCOMPILING_RTS -optc-DDEBUG -optc-fno-strict-aliasing -optc-fno-common -optc-DUSE_DWARF -optc-O2 -optc-fomit-frame-pointer -optc-DRtsWay=\"rts_v\" -static -O -H64m -Iincludes -Iincludes/dist -Iincludes/dist-derivedconstants/header -Iincludes/dist-ghcconstants/header -Irts -Irts/dist/build -DCOMPILING_RTS -package-name rts -dcmm-lint -i -irts -irts/dist/build -irts/dist/build/autogen -Irts/dist/build -Irts/dist/build/autogen -O2 -g -c rts/sm/Scav.c -o $1 -optc-D$2 }
comp Scav_use.o use_function_yay && comp Scav_explicit.o explicit_yay && banner MUSTSEETHIS && banner $(( $(cat Scav_use.o | wc -l) - $(cat Scav_explicit.o | wc -l) )) && diff Scav_use.o Scav_explicit.o
objdump --source Scav_explicit.o | less
diff <(objdump --source Scav_explicit.o | sed 's:<.*>::') <(objdump --source Scav_use.o | sed 's:<.*>::') | less
STATIC_INLINE StgPtr
scavenge_small_bitmap (StgPtr p, nat size, StgWord bitmap)
{
while (size > 0) {
if ((bitmap & 1) == 0) {
evacuate((StgClosure **)p);
}
p++;
bitmap = bitmap >> 1;
size--;
}
return p;
}
// Why Does the object files differ? wtf? it shouldnt
StgPtr
scavenge_PAP_payload (StgClosure *fun, StgClosure **payload, StgWord size)
{
StgPtr p;
StgWord bitmap;
StgFunInfoTable *fun_info;
switch (fun_info->f.fun_type) {
default:
#if defined(use_function_yay)
p = scavenge_small_bitmap(p, size, bitmap);
#elif defined(explicit_yay)
while (size > 0) {
if ((bitmap & 1) == 0) {
evacuate((StgClosure **)p);
}
p++;
bitmap = bitmap >> 1;
size--;
}
#else
#error("you mama!!!")
#endif
break;
}
return p;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment