Commit 89a8d817 authored by Edward Z. Yang's avatar Edward Z. Yang

Revert "Rename _closure to _static_closure, apply naming consistently."

This reverts commit 35672072.

Conflicts:
	compiler/main/DriverPipeline.hs
parent 0202b7ce
......@@ -1084,7 +1084,7 @@ pprCLbl (CmmLabel _ fs CmmRet)
= ftext fs <> ptext (sLit "_ret")
pprCLbl (CmmLabel _ fs CmmClosure)
= ftext fs <> ptext (sLit "_static_closure")
= ftext fs <> ptext (sLit "_closure")
pprCLbl (RtsLabel (RtsPrimOp primop))
= ptext (sLit "stg_") <> ppr primop
......@@ -1114,7 +1114,7 @@ pprCLbl (DeadStripPreventer {}) = panic "pprCLbl DeadStripPreventer"
ppIdFlavor :: IdLabelInfo -> SDoc
ppIdFlavor x = pp_cSEP <>
(case x of
Closure -> ptext (sLit "static_closure")
Closure -> ptext (sLit "closure")
SRT -> ptext (sLit "srt")
InfoTable -> ptext (sLit "info")
LocalInfoTable -> ptext (sLit "info")
......
......@@ -598,7 +598,7 @@ mkFExportCBits dflags c_nm maybe_target arg_htys res_hty is_IO_res_ty cc
the_cfun
= case maybe_target of
Nothing -> text "(StgClosure*)deRefStablePtr(the_stableptr)"
Just hs_fn -> text "STATIC_CLOSURE(" <> ppr hs_fn <> text ")"
Just hs_fn -> char '&' <> ppr hs_fn <> text "_closure"
cap = text "cap" <> comma
......@@ -623,7 +623,7 @@ mkFExportCBits dflags c_nm maybe_target arg_htys res_hty is_IO_res_ty cc
extern_decl
= case maybe_target of
Nothing -> empty
Just hs_fn -> text "extern StgClosure " <> ppr hs_fn <> text "_static_closure" <> semi
Just hs_fn -> text "extern StgClosure " <> ppr hs_fn <> text "_closure" <> semi
-- finally, the whole darn thing
......@@ -679,7 +679,7 @@ foreignExportInitialiser hs_fn =
<> text "() __attribute__((constructor));"
, text "static void stginit_export_" <> ppr hs_fn <> text "()"
, braces (text "foreignExportStablePtr"
<> parens (text "(StgPtr) &" <> ppr hs_fn <> text "_static_closure")
<> parens (text "(StgPtr) &" <> ppr hs_fn <> text "_closure")
<> semi)
]
......
......@@ -203,7 +203,7 @@ lookupStaticPtr addr_of_label_string
lookupPrimOp :: PrimOp -> IO HValue
lookupPrimOp primop
= do let sym_to_find = primopToCLabel primop "static_closure"
= do let sym_to_find = primopToCLabel primop "closure"
m <- lookupSymbol sym_to_find
case m of
Just (Ptr addr) -> case addrToAny# addr of
......@@ -216,7 +216,7 @@ lookupName ce nm
Just (_,aa) -> return aa
Nothing
-> ASSERT2(isExternalName nm, ppr nm)
do let sym_to_find = nameToCLabel nm "static_closure"
do let sym_to_find = nameToCLabel nm "closure"
m <- lookupSymbol sym_to_find
case m of
Just (Ptr addr) -> case addrToAny# addr of
......
......@@ -1600,7 +1600,7 @@ mkExtraObjToLinkIntoBinary dflags = do
| gopt Opt_NoHsMain dflags = Outputable.empty
| otherwise = vcat [
text "#include \"Rts.h\"",
text "extern StgClosure ZCMain_main_static_closure;",
text "extern StgClosure ZCMain_main_closure;",
text "int main(int argc, char *argv[])",
char '{',
text " RtsConfig __conf = defaultRtsConfig;",
......@@ -1611,7 +1611,7 @@ mkExtraObjToLinkIntoBinary dflags = do
Just opts -> ptext (sLit " __conf.rts_opts= ") <>
text (show opts) <> semi,
text " __conf.rts_hs_main = rtsTrue;",
text " return hs_main(argc,argv,&ZCMain_main_static_closure,__conf);",
text " return hs_main(argc,argv,&ZCMain_main_closure,__conf);",
char '}',
char '\n' -- final newline, to keep gcc happy
]
......
......@@ -188,7 +188,7 @@ int main(int argc, char *argv[]) {
hRtsDll = GetNonNullModuleHandle(rtsDll);
hs_main_p = GetNonNullProcAddress(hRtsDll, "hs_main");
main_p = GetNonNullProcAddress(hProgDll, "ZCMain_main_static_closure");
main_p = GetNonNullProcAddress(hProgDll, "ZCMain_main_closure");
rts_config.rts_opts_enabled = rtsOpts;
rts_config.rts_opts = NULL;
......
......@@ -374,9 +374,9 @@ initInterpBuffering = do -- make sure these are linked
-- ToDo: we should really look up these names properly, but
-- it's a fiddle and not all the bits are exposed via the GHC
-- interface.
mb_stdin_ptr <- ObjLink.lookupSymbol "base_GHCziIOziHandleziFD_stdin_static_closure"
mb_stdout_ptr <- ObjLink.lookupSymbol "base_GHCziIOziHandleziFD_stdout_static_closure"
mb_stderr_ptr <- ObjLink.lookupSymbol "base_GHCziIOziHandleziFD_stderr_static_closure"
mb_stdin_ptr <- ObjLink.lookupSymbol "base_GHCziIOziHandleziFD_stdin_closure"
mb_stdout_ptr <- ObjLink.lookupSymbol "base_GHCziIOziHandleziFD_stdout_closure"
mb_stderr_ptr <- ObjLink.lookupSymbol "base_GHCziIOziHandleziFD_stderr_closure"
let f ref (Just ptr) = writeIORef ref ptr
f _ Nothing = panic "interactiveUI:setBuffering2"
......
......@@ -323,7 +323,6 @@
-------------------------------------------------------------------------- */
#include "rts/Constants.h"
#include "rts/StaticClosures.h"
#include "DerivedConstants.h"
#include "rts/storage/ClosureTypes.h"
#include "rts/storage/FunTypes.h"
......
......@@ -193,7 +193,6 @@ INLINE_HEADER Time fsecondsToTime (double t)
/* Global constaints */
#include "rts/Constants.h"
#include "rts/StaticClosures.h"
/* Profiling information */
#include "rts/prof/CCS.h"
......
......@@ -249,15 +249,15 @@ void rts_done (void);
// the base package itself.
//
#if defined(COMPILING_WINDOWS_DLL) && !defined(COMPILING_BASE_PACKAGE)
__declspec(dllimport) extern StgWord base_GHCziTopHandler_runIO_static_closure[];
__declspec(dllimport) extern StgWord base_GHCziTopHandler_runNonIO_static_closure[];
__declspec(dllimport) extern StgWord base_GHCziTopHandler_runIO_closure[];
__declspec(dllimport) extern StgWord base_GHCziTopHandler_runNonIO_closure[];
#else
extern StgWord base_GHCziTopHandler_runIO_static_closure[];
extern StgWord base_GHCziTopHandler_runNonIO_static_closure[];
extern StgWord base_GHCziTopHandler_runIO_closure[];
extern StgWord base_GHCziTopHandler_runNonIO_closure[];
#endif
#define runIO_closure STATIC_CLOSURE(base_GHCziTopHandler_runIO)
#define runNonIO_closure STATIC_CLOSURE(base_GHCziTopHandler_runNonIO)
#define runIO_closure base_GHCziTopHandler_runIO_closure
#define runNonIO_closure base_GHCziTopHandler_runNonIO_closure
/* ------------------------------------------------------------------------ */
......
/* -----------------------------------------------------------------------------
*
* (c) The GHC Team, 1998-2009
*
* _closure macros for static closures, which will properly handle
* indirection.
*
* NB: THIS FILE IS INCLUDED IN NON-C CODE AND DATA! #defines only please.
*
* To understand the structure of the RTS headers, see the wiki:
* http://hackage.haskell.org/trac/ghc/wiki/Commentary/SourceTree/Includes
*
* ---------------------------------------------------------------------------*/
#ifndef RTS_STATIC_CLOSURES_H
#define RTS_STATIC_CLOSURES_H
#if CMINUSMINUS
#define STATIC_CLOSURE(clos) clos ## _static_closure
#else
#define STATIC_CLOSURE(clos) (StgClosure*)(&(clos ## _static_closure))
#endif
#define stg_END_TSO_QUEUE_closure STATIC_CLOSURE(stg_END_TSO_QUEUE)
#define stg_STM_AWOKEN_closure STATIC_CLOSURE(stg_STM_AWOKEN)
#define stg_NO_FINALIZER_closure STATIC_CLOSURE(stg_NO_FINALIZER)
#define stg_dummy_ret_closure STATIC_CLOSURE(stg_dummy_ret)
#define stg_forceIO_closure STATIC_CLOSURE(stg_forceIO)
#define stg_END_STM_WATCH_QUEUE_closure STATIC_CLOSURE(stg_END_STM_WATCH_QUEUE)
#define stg_END_INVARIANT_CHECK_QUEUE_closure STATIC_CLOSURE(stg_END_INVARIANT_CHECK_QUEUE)
#define stg_END_STM_CHUNK_LIST_closure STATIC_CLOSURE(stg_END_STM_CHUNK_LIST)
#define stg_NO_TREC_closure STATIC_CLOSURE(stg_NO_TREC)
#endif /* RTS_STATIC_CLOSURES_H */
......@@ -187,12 +187,11 @@ INLINE_HEADER StgClosure *STATIC_LINK2(const StgInfoTable *info,
INTLIKE and CHARLIKE closures.
-------------------------------------------------------------------------- */
// XXX update me for indirection
INLINE_HEADER P_ CHARLIKE_CLOSURE(int n) {
return (P_)&stg_CHARLIKE_static_closure[(n)-MIN_CHARLIKE];
return (P_)&stg_CHARLIKE_closure[(n)-MIN_CHARLIKE];
}
INLINE_HEADER P_ INTLIKE_CLOSURE(int n) {
return (P_)&stg_INTLIKE_static_closure[(n)-MIN_INTLIKE];
return (P_)&stg_INTLIKE_closure[(n)-MIN_INTLIKE];
}
/* ----------------------------------------------------------------------------
......
......@@ -252,6 +252,6 @@ void dirty_STACK (Capability *cap, StgStack *stack);
---------------------------------------------------------------------------- */
/* this is the NIL ptr for a TSO queue (e.g. runnable queue) */
#define END_TSO_QUEUE ((StgTSO *)stg_END_TSO_QUEUE_closure)
#define END_TSO_QUEUE ((StgTSO *)(void*)&stg_END_TSO_QUEUE_closure)
#endif /* RTS_STORAGE_TSO_H */
......@@ -25,14 +25,14 @@
# define RTS_FUN_INFO(i) extern W_(i)[]
# define RTS_THUNK_INFO(i) extern W_(i)[]
# define RTS_INFO(i) extern W_(i)[]
# define RTS_CLOSURE(i) extern W_(i ## _static_closure)[]
# define RTS_CLOSURE(i) extern W_(i)[]
# define RTS_FUN_DECL(f) extern DLL_IMPORT_RTS StgFunPtr f(void)
#else
# define RTS_RET_INFO(i) extern DLL_IMPORT_RTS const StgRetInfoTable i
# define RTS_FUN_INFO(i) extern DLL_IMPORT_RTS const StgFunInfoTable i
# define RTS_THUNK_INFO(i) extern DLL_IMPORT_RTS const StgThunkInfoTable i
# define RTS_INFO(i) extern DLL_IMPORT_RTS const StgInfoTable i
# define RTS_CLOSURE(i) extern DLL_IMPORT_RTS StgClosure i ## _static_closure
# define RTS_CLOSURE(i) extern DLL_IMPORT_RTS StgClosure i
# define RTS_FUN_DECL(f) extern DLL_IMPORT_RTS StgFunPtr f(void)
#endif
......@@ -148,25 +148,25 @@ RTS_ENTRY(stg_NO_TREC);
/* closures */
RTS_CLOSURE(stg_END_TSO_QUEUE);
RTS_CLOSURE(stg_STM_AWOKEN);
RTS_CLOSURE(stg_NO_FINALIZER);
RTS_CLOSURE(stg_dummy_ret);
RTS_CLOSURE(stg_forceIO);
RTS_CLOSURE(stg_END_TSO_QUEUE_closure);
RTS_CLOSURE(stg_STM_AWOKEN_closure);
RTS_CLOSURE(stg_NO_FINALIZER_closure);
RTS_CLOSURE(stg_dummy_ret_closure);
RTS_CLOSURE(stg_forceIO_closure);
RTS_CLOSURE(stg_END_STM_WATCH_QUEUE);
RTS_CLOSURE(stg_END_INVARIANT_CHECK_QUEUE);
RTS_CLOSURE(stg_END_STM_CHUNK_LIST);
RTS_CLOSURE(stg_NO_TREC);
RTS_CLOSURE(stg_END_STM_WATCH_QUEUE_closure);
RTS_CLOSURE(stg_END_INVARIANT_CHECK_QUEUE_closure);
RTS_CLOSURE(stg_END_STM_CHUNK_LIST_closure);
RTS_CLOSURE(stg_NO_TREC_closure);
RTS_ENTRY(stg_NO_FINALIZER_entry);
#if IN_STG_CODE
extern DLL_IMPORT_RTS StgWordArray stg_CHARLIKE_static_closure;
extern DLL_IMPORT_RTS StgWordArray stg_INTLIKE_static_closure;
extern DLL_IMPORT_RTS StgWordArray stg_CHARLIKE_closure;
extern DLL_IMPORT_RTS StgWordArray stg_INTLIKE_closure;
#else
extern DLL_IMPORT_RTS StgIntCharlikeClosure stg_CHARLIKE_static_closure[];
extern DLL_IMPORT_RTS StgIntCharlikeClosure stg_INTLIKE_static_closure[];
extern DLL_IMPORT_RTS StgIntCharlikeClosure stg_CHARLIKE_closure[];
extern DLL_IMPORT_RTS StgIntCharlikeClosure stg_INTLIKE_closure[];
#endif
/* StgStartup */
......
......@@ -74,7 +74,7 @@ import "integer-gmp" __gmpz_export;
import "integer-gmp" integer_cbits_decodeDouble;
import "rts" stg_INTLIKE_static_closure;
import "rts" stg_INTLIKE_closure;
/* -----------------------------------------------------------------------------
Arbitrary-precision Integer operations.
......@@ -94,7 +94,7 @@ import "rts" stg_INTLIKE_static_closure;
dummy value is needed, the 'ByteArray#' is not supposed to be
accessed anyway, this is should be a tolerable hack.
*/
#define DUMMY_BYTE_ARR (stg_INTLIKE_static_closure+1)
#define DUMMY_BYTE_ARR (stg_INTLIKE_closure+1)
/* set mpz_t from Int#/ByteArray# */
#define MP_INT_SET_FROM_BA(mp_ptr,i,ba) \
......
......@@ -13,7 +13,7 @@
#include "Cmm.h"
#include "RaiseAsync.h"
import ghczmprim_GHCziTypes_True_static_closure;
import ghczmprim_GHCziTypes_True_closure;
/* -----------------------------------------------------------------------------
Exception Primitives
......@@ -527,8 +527,8 @@ retry_pop_stack:
Sp(5) = exception;
Sp(4) = stg_raise_ret_info;
Sp(3) = exception; // the AP_STACK
Sp(2) = STATIC_CLOSURE(ghczmprim_GHCziTypes_True); // dummy breakpoint info
Sp(1) = STATIC_CLOSURE(ghczmprim_GHCziTypes_True); // True <=> a breakpoint
Sp(2) = ghczmprim_GHCziTypes_True_closure; // dummy breakpoint info
Sp(1) = ghczmprim_GHCziTypes_True_closure; // True <=> a breakpoint
R1 = ioAction;
jump RET_LBL(stg_ap_pppv) [R1];
}
......
......@@ -879,7 +879,7 @@ run_BCO:
new_aps = (StgAP_STACK *) allocate(cap, AP_STACK_sizeW(size_words));
SET_HDR(new_aps,&stg_AP_STACK_info,CCS_SYSTEM);
new_aps->size = size_words;
new_aps->fun = stg_dummy_ret_closure;
new_aps->fun = &stg_dummy_ret_closure;
// fill in the payload of the AP_STACK
new_aps->payload[0] = (StgClosure *)&stg_apply_interp_info;
......
......@@ -1044,8 +1044,8 @@ typedef struct _RtsSymbolVal {
#define RTS_INTCHAR_SYMBOLS
#else
#define RTS_INTCHAR_SYMBOLS \
SymI_HasProto(stg_CHARLIKE_static_closure) \
SymI_HasProto(stg_INTLIKE_static_closure)
SymI_HasProto(stg_CHARLIKE_closure) \
SymI_HasProto(stg_INTLIKE_closure)
#endif
......
......@@ -14,42 +14,42 @@
*/
#if IN_STG_CODE
#define PRELUDE_INFO(i) extern W_(i)[]
#define PRELUDE_CLOSURE(i) extern W_(i ## _static_closure)[]
#define PRELUDE_CLOSURE(i) extern W_(i)[]
#else
#define PRELUDE_INFO(i) extern const StgInfoTable DLL_IMPORT_DATA_VARNAME(i)
#define PRELUDE_CLOSURE(i) extern StgClosure DLL_IMPORT_DATA_VARNAME(i ## _static_closure)
#define PRELUDE_CLOSURE(i) extern StgClosure DLL_IMPORT_DATA_VARNAME(i)
#endif
/* Define canonical names so we can abstract away from the actual
* modules these names are defined in.
*/
PRELUDE_CLOSURE(ghczmprim_GHCziTypes_True);
PRELUDE_CLOSURE(ghczmprim_GHCziTypes_False);
PRELUDE_CLOSURE(base_GHCziPack_unpackCString);
PRELUDE_CLOSURE(base_GHCziWeak_runFinalizzerBatch);
PRELUDE_CLOSURE(ghczmprim_GHCziTypes_True_closure);
PRELUDE_CLOSURE(ghczmprim_GHCziTypes_False_closure);
PRELUDE_CLOSURE(base_GHCziPack_unpackCString_closure);
PRELUDE_CLOSURE(base_GHCziWeak_runFinalizzerBatch_closure);
#ifdef IN_STG_CODE
extern W_ ZCMain_main_static_closure[];
extern W_ ZCMain_main_closure[];
#else
extern StgClosure ZCMain_main_static_closure;
extern StgClosure ZCMain_main_closure;
#endif
PRELUDE_CLOSURE(base_GHCziIOziException_stackOverflow);
PRELUDE_CLOSURE(base_GHCziIOziException_heapOverflow);
PRELUDE_CLOSURE(base_GHCziIOziException_blockedIndefinitelyOnThrowTo);
PRELUDE_CLOSURE(base_GHCziIOziException_blockedIndefinitelyOnMVar);
PRELUDE_CLOSURE(base_GHCziIOziException_blockedIndefinitelyOnSTM);
PRELUDE_CLOSURE(base_ControlziExceptionziBase_nonTermination);
PRELUDE_CLOSURE(base_ControlziExceptionziBase_nestedAtomically);
PRELUDE_CLOSURE(base_GHCziEventziThread_blockedOnBadFD);
PRELUDE_CLOSURE(base_GHCziIOziException_stackOverflow_closure);
PRELUDE_CLOSURE(base_GHCziIOziException_heapOverflow_closure);
PRELUDE_CLOSURE(base_GHCziIOziException_blockedIndefinitelyOnThrowTo_closure);
PRELUDE_CLOSURE(base_GHCziIOziException_blockedIndefinitelyOnMVar_closure);
PRELUDE_CLOSURE(base_GHCziIOziException_blockedIndefinitelyOnSTM_closure);
PRELUDE_CLOSURE(base_ControlziExceptionziBase_nonTermination_closure);
PRELUDE_CLOSURE(base_ControlziExceptionziBase_nestedAtomically_closure);
PRELUDE_CLOSURE(base_GHCziEventziThread_blockedOnBadFD_closure);
PRELUDE_CLOSURE(base_GHCziConcziSync_runSparks);
PRELUDE_CLOSURE(base_GHCziConcziIO_ensureIOManagerIsRunning);
PRELUDE_CLOSURE(base_GHCziConcziIO_ioManagerCapabilitiesChanged);
PRELUDE_CLOSURE(base_GHCziConcziSignal_runHandlers);
PRELUDE_CLOSURE(base_GHCziConcziSync_runSparks_closure);
PRELUDE_CLOSURE(base_GHCziConcziIO_ensureIOManagerIsRunning_closure);
PRELUDE_CLOSURE(base_GHCziConcziIO_ioManagerCapabilitiesChanged_closure);
PRELUDE_CLOSURE(base_GHCziConcziSignal_runHandlers_closure);
PRELUDE_CLOSURE(base_GHCziTopHandler_flushStdHandles);
PRELUDE_CLOSURE(base_GHCziTopHandler_flushStdHandles_closure);
PRELUDE_INFO(ghczmprim_GHCziTypes_Czh_static_info);
PRELUDE_INFO(ghczmprim_GHCziTypes_Izh_static_info);
......@@ -86,30 +86,26 @@ PRELUDE_INFO(base_GHCziWord_W64zh_con_info);
PRELUDE_INFO(base_GHCziStable_StablePtr_static_info);
PRELUDE_INFO(base_GHCziStable_StablePtr_con_info);
#define mainIO_closure (STATIC_CLOSURE(ZCMain_main))
// XXX update me
#define IMPORT_CLOSURE(name) DLL_IMPORT_DATA_REF(name ## _static_closure)
#define True_closure IMPORT_CLOSURE(ghczmprim_GHCziTypes_True)
#define False_closure IMPORT_CLOSURE(ghczmprim_GHCziTypes_False)
#define unpackCString_closure IMPORT_CLOSURE(base_GHCziPack_unpackCString)
#define runFinalizerBatch_closure IMPORT_CLOSURE(base_GHCziWeak_runFinalizzerBatch)
#define runSparks_closure IMPORT_CLOSURE(base_GHCziConcziSync_runSparks)
#define ensureIOManagerIsRunning_closure IMPORT_CLOSURE(base_GHCziConcziIO_ensureIOManagerIsRunning)
#define ioManagerCapabilitiesChanged_closure IMPORT_CLOSURE(base_GHCziConcziIO_ioManagerCapabilitiesChanged)
#define runHandlers_closure IMPORT_CLOSURE(base_GHCziConcziSignal_runHandlers)
#define flushStdHandles_closure IMPORT_CLOSURE(base_GHCziTopHandler_flushStdHandles)
#define stackOverflow_closure IMPORT_CLOSURE(base_GHCziIOziException_stackOverflow)
#define heapOverflow_closure IMPORT_CLOSURE(base_GHCziIOziException_heapOverflow)
#define blockedIndefinitelyOnMVar_closure IMPORT_CLOSURE(base_GHCziIOziException_blockedIndefinitelyOnMVar)
#define blockedIndefinitelyOnSTM_closure IMPORT_CLOSURE(base_GHCziIOziException_blockedIndefinitelyOnSTM)
#define nonTermination_closure IMPORT_CLOSURE(base_ControlziExceptionziBase_nonTermination)
#define nestedAtomically_closure IMPORT_CLOSURE(base_ControlziExceptionziBase_nestedAtomically)
#define blockedOnBadFD_closure IMPORT_CLOSURE(base_GHCziEventziThread_blockedOnBadFD)
#define True_closure DLL_IMPORT_DATA_REF(ghczmprim_GHCziTypes_True_closure)
#define False_closure DLL_IMPORT_DATA_REF(ghczmprim_GHCziTypes_False_closure)
#define unpackCString_closure DLL_IMPORT_DATA_REF(base_GHCziPack_unpackCString_closure)
#define runFinalizerBatch_closure DLL_IMPORT_DATA_REF(base_GHCziWeak_runFinalizzerBatch_closure)
#define mainIO_closure (&ZCMain_main_closure)
#define runSparks_closure DLL_IMPORT_DATA_REF(base_GHCziConcziSync_runSparks_closure)
#define ensureIOManagerIsRunning_closure DLL_IMPORT_DATA_REF(base_GHCziConcziIO_ensureIOManagerIsRunning_closure)
#define ioManagerCapabilitiesChanged_closure DLL_IMPORT_DATA_REF(base_GHCziConcziIO_ioManagerCapabilitiesChanged_closure)
#define runHandlers_closure DLL_IMPORT_DATA_REF(base_GHCziConcziSignal_runHandlers_closure)
#define flushStdHandles_closure DLL_IMPORT_DATA_REF(base_GHCziTopHandler_flushStdHandles_closure)
#define stackOverflow_closure DLL_IMPORT_DATA_REF(base_GHCziIOziException_stackOverflow_closure)
#define heapOverflow_closure DLL_IMPORT_DATA_REF(base_GHCziIOziException_heapOverflow_closure)
#define blockedIndefinitelyOnMVar_closure DLL_IMPORT_DATA_REF(base_GHCziIOziException_blockedIndefinitelyOnMVar_closure)
#define blockedIndefinitelyOnSTM_closure DLL_IMPORT_DATA_REF(base_GHCziIOziException_blockedIndefinitelyOnSTM_closure)
#define nonTermination_closure DLL_IMPORT_DATA_REF(base_ControlziExceptionziBase_nonTermination_closure)
#define nestedAtomically_closure DLL_IMPORT_DATA_REF(base_ControlziExceptionziBase_nestedAtomically_closure)
#define blockedOnBadFD_closure DLL_IMPORT_DATA_REF(base_GHCziEventziThread_blockedOnBadFD_closure)
#define Czh_static_info DLL_IMPORT_DATA_REF(ghczmprim_GHCziTypes_Czh_static_info)
#define Fzh_static_info DLL_IMPORT_DATA_REF(ghczmprim_GHCziTypes_Fzh_static_info)
......
......@@ -31,7 +31,7 @@ import pthread_mutex_unlock;
import base_ControlziExceptionziBase_nestedAtomically_static_closure;
import EnterCriticalSection;
import LeaveCriticalSection;
import ghczmprim_GHCziTypes_False_static_closure;
import ghczmprim_GHCziTypes_False_closure;
#if defined(USE_MINIINTERPRETER) || !defined(mingw32_HOST_OS)
import sm_mutex;
#endif
......@@ -1171,7 +1171,7 @@ stg_atomicallyzh (P_ stm)
/* Nested transactions are not allowed; raise an exception */
if (old_trec != NO_TREC) {
jump stg_raisezh(STATIC_CLOSURE(base_ControlziExceptionziBase_nestedAtomically));
jump stg_raisezh(base_ControlziExceptionziBase_nestedAtomically_closure);
}
code = stm;
......@@ -2342,13 +2342,13 @@ stg_getSparkzh ()
W_ spark;
#ifndef THREADED_RTS
return (0,STATIC_CLOSURE(ghczmprim_GHCziTypes_False));
return (0,ghczmprim_GHCziTypes_False_closure);
#else
(spark) = ccall findSpark(MyCapability());
if (spark != 0) {
return (1,spark);
} else {
return (0,STATIC_CLOSURE(ghczmprim_GHCziTypes_False));
return (0,ghczmprim_GHCziTypes_False_closure);
}
#endif
}
......
......@@ -776,7 +776,7 @@ raiseAsync(Capability *cap, StgTSO *tso, StgClosure *exception,
sp++;
} else {
sp--;
sp[0] = (W_)stg_dummy_ret_closure;
sp[0] = (W_)&stg_dummy_ret_closure;
}
frame = sp + 1;
......@@ -957,7 +957,7 @@ raiseAsync(Capability *cap, StgTSO *tso, StgClosure *exception,
// ATOMICALLY_FRAME instance for condemned
// transactions, but I don't fully understand the
// interaction with STM invariants.
stack->sp[1] = (W_)stg_NO_TREC_closure;
stack->sp[1] = (W_)&stg_NO_TREC_closure;
stack->sp[0] = (W_)&stg_ret_p_info;
tso->what_next = ThreadRunGHC;
goto done;
......
......@@ -1748,7 +1748,7 @@ retainRoot(void *user STG_UNUSED, StgClosure **tl)
c = UNTAG_CLOSURE(*tl);
maybeInitRetainerSet(c);
if (c != stg_END_TSO_QUEUE_closure && isRetainer(c)) {
if (c != &stg_END_TSO_QUEUE_closure && isRetainer(c)) {
retainClosure(c, c, getRetainerFrom(c));
} else {
retainClosure(c, c, CCS_SYSTEM);
......
......@@ -386,11 +386,11 @@ static void unpark_tso(Capability *cap, StgTSO *tso) {
// future.
lockTSO(tso);
if (tso->why_blocked == BlockedOnSTM &&
tso->block_info.closure == stg_STM_AWOKEN_closure) {
tso->block_info.closure == &stg_STM_AWOKEN_closure) {
TRACE("unpark_tso already woken up tso=%p", tso);
} else if (tso -> why_blocked == BlockedOnSTM) {
TRACE("unpark_tso on tso=%p", tso);
tso->block_info.closure = stg_STM_AWOKEN_closure;
tso->block_info.closure = &stg_STM_AWOKEN_closure;
tryWakeupThread(cap,tso);
} else {
TRACE("spurious unpark_tso on tso=%p", tso);
......
......@@ -209,11 +209,11 @@ void stmWriteTVar(Capability *cap,
/* NULLs */
#define END_STM_WATCH_QUEUE ((StgTVarWatchQueue *)stg_END_STM_WATCH_QUEUE_closure)
#define END_INVARIANT_CHECK_QUEUE ((StgInvariantCheckQueue *)stg_END_INVARIANT_CHECK_QUEUE_closure)
#define END_STM_CHUNK_LIST ((StgTRecChunk *)stg_END_STM_CHUNK_LIST_closure)
#define END_STM_WATCH_QUEUE ((StgTVarWatchQueue *)(void *)&stg_END_STM_WATCH_QUEUE_closure)
#define END_INVARIANT_CHECK_QUEUE ((StgInvariantCheckQueue *)(void *)&stg_END_INVARIANT_CHECK_QUEUE_closure)
#define END_STM_CHUNK_LIST ((StgTRecChunk *)(void *)&stg_END_STM_CHUNK_LIST_closure)
#define NO_TREC ((StgTRecHeader *)stg_NO_TREC_closure)
#define NO_TREC ((StgTRecHeader *)(void *)&stg_NO_TREC_closure)
/*----------------------------------------------------------------------*/
......
......@@ -682,7 +682,7 @@ INFO_TABLE_CONSTR(stg_MVAR_TSO_QUEUE,2,0,0,PRIM,"MVAR_TSO_QUEUE","MVAR_TSO_QUEUE
#if !(defined(COMPILING_WINDOWS_DLL))
section "data" {
stg_CHARLIKE_static_closure:
stg_CHARLIKE_closure:
CHARLIKE_HDR(0)
CHARLIKE_HDR(1)
CHARLIKE_HDR(2)
......@@ -942,7 +942,7 @@ section "data" {
}
section "data" {
stg_INTLIKE_static_closure:
stg_INTLIKE_closure:
INTLIKE_HDR(-16) /* MIN_INTLIKE == -16 */
INTLIKE_HDR(-15)
INTLIKE_HDR(-14)
......
......@@ -21,7 +21,7 @@ runCFinalizers(StgCFinalizerList *list)
{
StgCFinalizerList *head;
for (head = list;
(StgClosure *)head != stg_NO_FINALIZER_closure;
(StgClosure *)head != &stg_NO_FINALIZER_closure;
head = (StgCFinalizerList *)head->link)
{
if (head->flag)
......@@ -88,7 +88,7 @@ scheduleFinalizers(Capability *cap, StgWeak *list)
// collector removes DEAD_WEAKs from the weak pointer list.
ASSERT(w->header.info != &stg_DEAD_WEAK_info);
if (w->finalizer != stg_NO_FINALIZER_closure) {
if (w->finalizer != &stg_NO_FINALIZER_closure) {
n++;
}
......@@ -124,7 +124,7 @@ scheduleFinalizers(Capability *cap, StgWeak *list)
n = 0;
for (w = list; w; w = w->link) {
if (w->finalizer != stg_NO_FINALIZER_closure) {
if (w->finalizer != &stg_NO_FINALIZER_closure) {
arr->payload[n] = w->finalizer;
n++;
}
......
......@@ -91,24 +91,24 @@ ld-options:
, "-Wl,-u,_base_GHCziPtr_Ptr_con_info"
, "-Wl,-u,_base_GHCziPtr_FunPtr_con_info"
, "-Wl,-u,_base_GHCziStable_StablePtr_con_info"
, "-Wl,-u,_ghczmprim_GHCziTypes_False_static_closure"
, "-Wl,-u,_ghczmprim_GHCziTypes_True_static_closure"
, "-Wl,-u,_base_GHCziPack_unpackCString_static_closure"
, "-Wl,-u,_base_GHCziIOziException_stackOverflow_static_closure"
, "-Wl,-u,_base_GHCziIOziException_heapOverflow_static_closure"
, "-Wl,-u,_base_ControlziExceptionziBase_nonTermination_static_closure"
, "-Wl,-u,_base_GHCziIOziException_blockedIndefinitelyOnMVar_static_closure"
, "-Wl,-u,_base_GHCziIOziException_blockedIndefinitelyOnSTM_static_closure"
, "-Wl,-u,_base_ControlziExceptionziBase_nestedAtomically_static_closure"
, "-Wl,-u,_base_GHCziEventziThread_blockedOnBadFD_static_closure"
, "-Wl,-u,_base_GHCziWeak_runFinalizzerBatch_static_closure"
, "-Wl,-u,_base_GHCziTopHandler_flushStdHandles_static_closure"
, "-Wl,-u,_base_GHCziTopHandler_runIO_static_closure"
, "-Wl,-u,_base_GHCziTopHandler_runNonIO_static_closure"
, "-Wl,-u,_base_GHCziConcziIO_ensureIOManagerIsRunning_static_closure"
, "-Wl,-u,_base_GHCziConcziIO_ioManagerCapabilitiesChanged_static_closure"
, "-Wl,-u,_base_GHCziConcziSync_runSparks_static_closure"
, "-Wl,-u,_base_GHCziConcziSignal_runHandlers_static_closure"
, "-Wl,-u,_ghczmprim_GHCziTypes_False_closure"
, "-Wl,-u,_ghczmprim_GHCziTypes_True_closure"
, "-Wl,-u,_base_GHCziPack_unpackCString_closure"
, "-Wl,-u,_base_GHCziIOziException_stackOverflow_closure"
, "-Wl,-u,_base_GHCziIOziException_heapOverflow_closure"
, "-Wl,-u,_base_ControlziExceptionziBase_nonTermination_closure"
, "-Wl,-u,_base_GHCziIOziException_blockedIndefinitelyOnMVar_closure"
, "-Wl,-u,_base_GHCziIOziException_blockedIndefinitelyOnSTM_closure"
, "-Wl,-u,_base_ControlziExceptionziBase_nestedAtomically_closure"
, "-Wl,-u,_base_GHCziEventziThread_blockedOnBadFD_closure"
, "-Wl,-u,_base_GHCziWeak_runFinalizzerBatch_closure"
, "-Wl,-u,_base_GHCziTopHandler_flushStdHandles_closure"
, "-Wl,-u,_base_GHCziTopHandler_runIO_closure"
, "-Wl,-u,_base_GHCziTopHandler_runNonIO_closure"
, "-Wl,-u,_base_GHCziConcziIO_ensureIOManagerIsRunning_closure"
, "-Wl,-u,_base_GHCziConcziIO_ioManagerCapabilitiesChanged_closure"
, "-Wl,-u,_base_GHCziConcziSync_runSparks_closure"
, "-Wl,-u,_base_GHCziConcziSignal_runHandlers_closure"
#else
"-Wl,-u,ghczmprim_GHCziTypes_Izh_static_info"
, "-Wl,-u,ghczmprim_GHCziTypes_Czh_static_info"
......@@ -132,24 +132,24 @@ ld-options:
, "-Wl,-u,base_GHCziPtr_Ptr_con_info"
, "-Wl,-u,base_GHCziPtr_FunPtr_con_info"
, "-Wl,-u,base_GHCziStable_StablePtr_con_info"
, "-Wl,-u,ghczmprim_GHCziTypes_False_static_closure"
, "-Wl,-u,ghczmprim_GHCziTypes_True_static_closure"
, "-Wl,-u,base_GHCziPack_unpackCString_static_closure"
, "-Wl,-u,base_GHCziIOziException_stackOverflow_static_closure"
, "-Wl,-u,base_GHCziIOziException_heapOverflow_static_closure"
, "-Wl,-u,base_ControlziExceptionziBase_nonTermination_static_closure"
, "-Wl,-u,base_GHCziIOziException_blockedIndefinitelyOnMVar_static_closure"
, "-Wl,-u,base_GHCziIOziException_blockedIndefinitelyOnSTM_static_closure"
, "-Wl,-u,base_ControlziExceptionziBase_nestedAtomically_static_closure"
, "-Wl,-u,base_GHCziEventziThread_blockedOnBadFD_static_closure"
, "-Wl,-u,base_GHCziWeak_runFinalizzerBatch_static_closure"
, "-Wl,-u,base_GHCziTopHandler_flushStdHandles_static_closure"
, "-Wl,-u,base_GHCziTopHandler_runIO_static_closure"
, "-Wl,-u,base_GHCziTopHandler_runNonIO_static_closure"
, "-Wl,-u,base_GHCziConcziIO_ensureIOManagerIsRunning_static_closure"
, "-Wl,-u,base_GHCziConcziIO_ioManagerCapabilitiesChanged_static_closure"
, "-Wl,-u,base_GHCziConcziSync_runSparks_static_closure"
, "-Wl,-u,base_GHCziConcziSignal_runHandlers_static_closure"
, "-Wl,-u,ghczmprim_GHCziTypes_False_closure"
, "-Wl,-u,ghczmprim_GHCziTypes_True_closure"
, "-Wl,-u,base_GHCziPack_unpackCString_closure"
, "-Wl,-u,base_GHCziIOziException_stackOverflow_closure"
, "-Wl,-u,base_GHCziIOziException_heapOverflow_closure"
, "-Wl,-u,base_ControlziExceptionziBase_nonTermination_closure"
, "-Wl,-u,base_GHCziIOziException_blockedIndefinitelyOnMVar_closure"
, "-Wl,-u,base_GHCziIOziException_blockedIndefinitelyOnSTM_closure"
, "-Wl,-u,base_ControlziExceptionziBase_nestedAtomically_closure"
, "-Wl,-u,base_GHCziEventziThread_blockedOnBadFD_closure"
, "-Wl,-u,base_GHCziWeak_runFinalizzerBatch_closure"
, "-Wl,-u,base_GHCziTopHandler_flushStdHandles_closure"
, "-Wl,-u,base_GHCziTopHandler_runIO_closure"
, "-Wl,-u,base_GHCziTopHandler_runNonIO_closure"
, "-Wl,-u,base_GHCziConcziIO_ensureIOManagerIsRunning_closure"
, "-Wl,-u,base_GHCziConcziIO_ioManagerCapabilitiesChanged_closure"
, "-Wl,-u,base_GHCziConcziSync_runSparks_closure"
, "-Wl,-u,base_GHCziConcziSignal_runHandlers_closure"
#endif
/* Pick up static libraries in preference over dynamic if in earlier search
......
......@@ -193,7 +193,7 @@ ioManagerDie (void)
void
ioManagerStartCap (Capability **cap)
{
rts_evalIO(cap,ensureIOManagerIsRunning_closure,NULL);
rts_evalIO(cap,&base_GHCziConcziIO_ensureIOManagerIsRunning_closure,NULL);
}
void
......@@ -473,7 +473,7 @@ startSignalHandlers(Capability *cap)
RtsFlags.GcFlags.initialStkSize,
rts_apply(cap,
rts_apply(cap,
runHandlers_closure,
&base_GHCziConcziSignal_runHandlers_closure,
rts_mkPtr(cap, info)),
rts_mkInt(cap, info->si_signo))));
}
......
......@@ -115,8 +115,8 @@ initStorage (void)
*/
/* We use the NOT_NULL variant or gcc warns that the test is always true */
ASSERT(LOOKS_LIKE_INFO_PTR_NOT_NULL((StgWord)&stg_BLOCKING_QUEUE_CLEAN_info));
ASSERT(LOOKS_LIKE_CLOSURE_PTR(stg_dummy_ret_closure));
ASSERT(!HEAP_ALLOCED(stg_dummy_ret_closure));
ASSERT(LOOKS_LIKE_CLOSURE_PTR(&stg_dummy_ret_closure));
ASSERT(!HEAP_ALLOCED(&stg_dummy_ret_closure));
if (RtsFlags.GcFlags.maxHeapSize != 0 &&
RtsFlags.GcFlags.heapSizeSuggestion >
......
......@@ -15,29 +15,29 @@ EXPORTS
base_GHCziStable_StablePtr_con_info
base_GHCziPack_unpackCString_static_closure
base_GHCziPack_unpackCString_closure
base_GHCziTopHandler_runIO_static_closure
base_GHCziTopHandler_runNonIO_static_closure
base_GHCziTopHandler_runIO_closure
base_GHCziTopHandler_runNonIO_closure
base_GHCziIOziException_stackOverflow_static_closure
base_GHCziIOziException_heapOverflow_static_closure
base_GHCziIOziException_stackOverflow_closure
base_GHCziIOziException_heapOverflow_closure
base_GHCziPtr_Ptr_con_info
base_GHCziPtr_FunPtr_con_info
base_GHCziConcziIO_ensureIOManagerIsRunning_static_closure
base_GHCziConcziIO_ioManagerCapabilitiesChanged_static_closure
base_GHCziConcziSync_runSparks_static_closure
base_GHCziConcziIO_ensureIOManagerIsRunning_closure
base_GHCziConcziIO_ioManagerCapabilitiesChanged_closure
base_GHCziConcziSync_runSparks_closure
base_GHCziTopHandler_flushStdHandles_static_closure
base_GHCziTopHandler_flushStdHandles_closure
base_GHCziWeak_runFinalizzerBatch_static_closure
base_GHCziPack_unpackCString_static_closure
base_GHCziIOziException_blockedIndefinitelyOnMVar_static_closure
base_GHCziIOziException_blockedIndefinitelyOnSTM_static_closure
base_GHCziIOziException_stackOverflow_static_closure
base_GHCziWeak_runFinalizzerBatch_closure
base_GHCziPack_unpackCString_closure
base_GHCziIOziException_blockedIndefinitelyOnMVar_closure
base_GHCziIOziException_blockedIndefinitelyOnSTM_closure
base_GHCziIOziException_stackOverflow_closure
base_ControlziExceptionziBase_nonTermination_static_closure
base_ControlziExceptionziBase_nestedAtomically_static_closure
base_GHCziEventziThread_blockedOnBadFD_static_closure
base_ControlziExceptionziBase_nonTermination_closure
base_ControlziExceptionziBase_nestedAtomically_closure
base_GHCziEventziThread_blockedOnBadFD_closure
......@@ -29,7 +29,7 @@ loadFunction mpkg m valsym = do
let symbol = prefixUnderscore
++ maybe "" (\p -> zEncodeString p ++ "_") mpkg
++ zEncodeString m ++ "_" ++ zEncodeString valsym
++ "_static_closure"
++ "_closure"
ptr@(Ptr addr) <- withCString symbol c_lookupSymbol
if (ptr == nullPtr)
then return Nothing
......