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) ...@@ -1084,7 +1084,7 @@ pprCLbl (CmmLabel _ fs CmmRet)
= ftext fs <> ptext (sLit "_ret") = ftext fs <> ptext (sLit "_ret")
pprCLbl (CmmLabel _ fs CmmClosure) pprCLbl (CmmLabel _ fs CmmClosure)
= ftext fs <> ptext (sLit "_static_closure") = ftext fs <> ptext (sLit "_closure")
pprCLbl (RtsLabel (RtsPrimOp primop)) pprCLbl (RtsLabel (RtsPrimOp primop))
= ptext (sLit "stg_") <> ppr primop = ptext (sLit "stg_") <> ppr primop
...@@ -1114,7 +1114,7 @@ pprCLbl (DeadStripPreventer {}) = panic "pprCLbl DeadStripPreventer" ...@@ -1114,7 +1114,7 @@ pprCLbl (DeadStripPreventer {}) = panic "pprCLbl DeadStripPreventer"
ppIdFlavor :: IdLabelInfo -> SDoc ppIdFlavor :: IdLabelInfo -> SDoc
ppIdFlavor x = pp_cSEP <> ppIdFlavor x = pp_cSEP <>
(case x of (case x of
Closure -> ptext (sLit "static_closure") Closure -> ptext (sLit "closure")
SRT -> ptext (sLit "srt") SRT -> ptext (sLit "srt")
InfoTable -> ptext (sLit "info") InfoTable -> ptext (sLit "info")
LocalInfoTable -> 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 ...@@ -598,7 +598,7 @@ mkFExportCBits dflags c_nm maybe_target arg_htys res_hty is_IO_res_ty cc
the_cfun the_cfun
= case maybe_target of = case maybe_target of
Nothing -> text "(StgClosure*)deRefStablePtr(the_stableptr)" 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 cap = text "cap" <> comma
...@@ -623,7 +623,7 @@ mkFExportCBits dflags c_nm maybe_target arg_htys res_hty is_IO_res_ty cc ...@@ -623,7 +623,7 @@ mkFExportCBits dflags c_nm maybe_target arg_htys res_hty is_IO_res_ty cc
extern_decl extern_decl
= case maybe_target of = case maybe_target of
Nothing -> empty 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 -- finally, the whole darn thing
...@@ -679,7 +679,7 @@ foreignExportInitialiser hs_fn = ...@@ -679,7 +679,7 @@ foreignExportInitialiser hs_fn =
<> text "() __attribute__((constructor));" <> text "() __attribute__((constructor));"
, text "static void stginit_export_" <> ppr hs_fn <> text "()" , text "static void stginit_export_" <> ppr hs_fn <> text "()"
, braces (text "foreignExportStablePtr" , braces (text "foreignExportStablePtr"
<> parens (text "(StgPtr) &" <> ppr hs_fn <> text "_static_closure") <> parens (text "(StgPtr) &" <> ppr hs_fn <> text "_closure")
<> semi) <> semi)
] ]
......
...@@ -203,7 +203,7 @@ lookupStaticPtr addr_of_label_string ...@@ -203,7 +203,7 @@ lookupStaticPtr addr_of_label_string
lookupPrimOp :: PrimOp -> IO HValue lookupPrimOp :: PrimOp -> IO HValue
lookupPrimOp primop lookupPrimOp primop
= do let sym_to_find = primopToCLabel primop "static_closure" = do let sym_to_find = primopToCLabel primop "closure"
m <- lookupSymbol sym_to_find m <- lookupSymbol sym_to_find
case m of case m of
Just (Ptr addr) -> case addrToAny# addr of Just (Ptr addr) -> case addrToAny# addr of
...@@ -216,7 +216,7 @@ lookupName ce nm ...@@ -216,7 +216,7 @@ lookupName ce nm
Just (_,aa) -> return aa Just (_,aa) -> return aa
Nothing Nothing
-> ASSERT2(isExternalName nm, ppr nm) -> 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 m <- lookupSymbol sym_to_find
case m of case m of
Just (Ptr addr) -> case addrToAny# addr of Just (Ptr addr) -> case addrToAny# addr of
......
...@@ -1600,7 +1600,7 @@ mkExtraObjToLinkIntoBinary dflags = do ...@@ -1600,7 +1600,7 @@ mkExtraObjToLinkIntoBinary dflags = do
| gopt Opt_NoHsMain dflags = Outputable.empty | gopt Opt_NoHsMain dflags = Outputable.empty
| otherwise = vcat [ | otherwise = vcat [
text "#include \"Rts.h\"", text "#include \"Rts.h\"",
text "extern StgClosure ZCMain_main_static_closure;", text "extern StgClosure ZCMain_main_closure;",
text "int main(int argc, char *argv[])", text "int main(int argc, char *argv[])",
char '{', char '{',
text " RtsConfig __conf = defaultRtsConfig;", text " RtsConfig __conf = defaultRtsConfig;",
...@@ -1611,7 +1611,7 @@ mkExtraObjToLinkIntoBinary dflags = do ...@@ -1611,7 +1611,7 @@ mkExtraObjToLinkIntoBinary dflags = do
Just opts -> ptext (sLit " __conf.rts_opts= ") <> Just opts -> ptext (sLit " __conf.rts_opts= ") <>
text (show opts) <> semi, text (show opts) <> semi,
text " __conf.rts_hs_main = rtsTrue;", 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 '}',
char '\n' -- final newline, to keep gcc happy char '\n' -- final newline, to keep gcc happy
] ]
......
...@@ -188,7 +188,7 @@ int main(int argc, char *argv[]) { ...@@ -188,7 +188,7 @@ int main(int argc, char *argv[]) {
hRtsDll = GetNonNullModuleHandle(rtsDll); hRtsDll = GetNonNullModuleHandle(rtsDll);
hs_main_p = GetNonNullProcAddress(hRtsDll, "hs_main"); 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_enabled = rtsOpts;
rts_config.rts_opts = NULL; rts_config.rts_opts = NULL;
......
...@@ -374,9 +374,9 @@ initInterpBuffering = do -- make sure these are linked ...@@ -374,9 +374,9 @@ initInterpBuffering = do -- make sure these are linked
-- ToDo: we should really look up these names properly, but -- ToDo: we should really look up these names properly, but
-- it's a fiddle and not all the bits are exposed via the GHC -- it's a fiddle and not all the bits are exposed via the GHC
-- interface. -- interface.
mb_stdin_ptr <- ObjLink.lookupSymbol "base_GHCziIOziHandleziFD_stdin_static_closure" mb_stdin_ptr <- ObjLink.lookupSymbol "base_GHCziIOziHandleziFD_stdin_closure"
mb_stdout_ptr <- ObjLink.lookupSymbol "base_GHCziIOziHandleziFD_stdout_static_closure" mb_stdout_ptr <- ObjLink.lookupSymbol "base_GHCziIOziHandleziFD_stdout_closure"
mb_stderr_ptr <- ObjLink.lookupSymbol "base_GHCziIOziHandleziFD_stderr_static_closure" mb_stderr_ptr <- ObjLink.lookupSymbol "base_GHCziIOziHandleziFD_stderr_closure"
let f ref (Just ptr) = writeIORef ref ptr let f ref (Just ptr) = writeIORef ref ptr
f _ Nothing = panic "interactiveUI:setBuffering2" f _ Nothing = panic "interactiveUI:setBuffering2"
......
...@@ -323,7 +323,6 @@ ...@@ -323,7 +323,6 @@
-------------------------------------------------------------------------- */ -------------------------------------------------------------------------- */
#include "rts/Constants.h" #include "rts/Constants.h"
#include "rts/StaticClosures.h"
#include "DerivedConstants.h" #include "DerivedConstants.h"
#include "rts/storage/ClosureTypes.h" #include "rts/storage/ClosureTypes.h"
#include "rts/storage/FunTypes.h" #include "rts/storage/FunTypes.h"
......
...@@ -193,7 +193,6 @@ INLINE_HEADER Time fsecondsToTime (double t) ...@@ -193,7 +193,6 @@ INLINE_HEADER Time fsecondsToTime (double t)
/* Global constaints */ /* Global constaints */
#include "rts/Constants.h" #include "rts/Constants.h"
#include "rts/StaticClosures.h"
/* Profiling information */ /* Profiling information */
#include "rts/prof/CCS.h" #include "rts/prof/CCS.h"
......
...@@ -249,15 +249,15 @@ void rts_done (void); ...@@ -249,15 +249,15 @@ void rts_done (void);
// the base package itself. // the base package itself.
// //
#if defined(COMPILING_WINDOWS_DLL) && !defined(COMPILING_BASE_PACKAGE) #if defined(COMPILING_WINDOWS_DLL) && !defined(COMPILING_BASE_PACKAGE)
__declspec(dllimport) extern StgWord base_GHCziTopHandler_runIO_static_closure[]; __declspec(dllimport) extern StgWord base_GHCziTopHandler_runIO_closure[];
__declspec(dllimport) extern StgWord base_GHCziTopHandler_runNonIO_static_closure[]; __declspec(dllimport) extern StgWord base_GHCziTopHandler_runNonIO_closure[];
#else #else
extern StgWord base_GHCziTopHandler_runIO_static_closure[]; extern StgWord base_GHCziTopHandler_runIO_closure[];
extern StgWord base_GHCziTopHandler_runNonIO_static_closure[]; extern StgWord base_GHCziTopHandler_runNonIO_closure[];
#endif #endif
#define runIO_closure STATIC_CLOSURE(base_GHCziTopHandler_runIO) #define runIO_closure base_GHCziTopHandler_runIO_closure
#define runNonIO_closure STATIC_CLOSURE(base_GHCziTopHandler_runNonIO) #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, ...@@ -187,12 +187,11 @@ INLINE_HEADER StgClosure *STATIC_LINK2(const StgInfoTable *info,
INTLIKE and CHARLIKE closures. INTLIKE and CHARLIKE closures.
-------------------------------------------------------------------------- */ -------------------------------------------------------------------------- */
// XXX update me for indirection
INLINE_HEADER P_ CHARLIKE_CLOSURE(int n) { 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) { 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); ...@@ -252,6 +252,6 @@ void dirty_STACK (Capability *cap, StgStack *stack);
---------------------------------------------------------------------------- */ ---------------------------------------------------------------------------- */
/* this is the NIL ptr for a TSO queue (e.g. runnable queue) */ /* 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 */ #endif /* RTS_STORAGE_TSO_H */
...@@ -25,14 +25,14 @@ ...@@ -25,14 +25,14 @@
# define RTS_FUN_INFO(i) extern W_(i)[] # define RTS_FUN_INFO(i) extern W_(i)[]
# define RTS_THUNK_INFO(i) extern W_(i)[] # define RTS_THUNK_INFO(i) extern W_(i)[]
# define RTS_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) # define RTS_FUN_DECL(f) extern DLL_IMPORT_RTS StgFunPtr f(void)
#else #else
# define RTS_RET_INFO(i) extern DLL_IMPORT_RTS const StgRetInfoTable i # 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_FUN_INFO(i) extern DLL_IMPORT_RTS const StgFunInfoTable i
# define RTS_THUNK_INFO(i) extern DLL_IMPORT_RTS const StgThunkInfoTable 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_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) # define RTS_FUN_DECL(f) extern DLL_IMPORT_RTS StgFunPtr f(void)
#endif #endif
...@@ -148,25 +148,25 @@ RTS_ENTRY(stg_NO_TREC); ...@@ -148,25 +148,25 @@ RTS_ENTRY(stg_NO_TREC);
/* closures */ /* closures */
RTS_CLOSURE(stg_END_TSO_QUEUE); RTS_CLOSURE(stg_END_TSO_QUEUE_closure);
RTS_CLOSURE(stg_STM_AWOKEN); RTS_CLOSURE(stg_STM_AWOKEN_closure);
RTS_CLOSURE(stg_NO_FINALIZER); RTS_CLOSURE(stg_NO_FINALIZER_closure);
RTS_CLOSURE(stg_dummy_ret); RTS_CLOSURE(stg_dummy_ret_closure);
RTS_CLOSURE(stg_forceIO); RTS_CLOSURE(stg_forceIO_closure);
RTS_CLOSURE(stg_END_STM_WATCH_QUEUE); RTS_CLOSURE(stg_END_STM_WATCH_QUEUE_closure);
RTS_CLOSURE(stg_END_INVARIANT_CHECK_QUEUE); RTS_CLOSURE(stg_END_INVARIANT_CHECK_QUEUE_closure);
RTS_CLOSURE(stg_END_STM_CHUNK_LIST); RTS_CLOSURE(stg_END_STM_CHUNK_LIST_closure);
RTS_CLOSURE(stg_NO_TREC); RTS_CLOSURE(stg_NO_TREC_closure);
RTS_ENTRY(stg_NO_FINALIZER_entry); RTS_ENTRY(stg_NO_FINALIZER_entry);
#if IN_STG_CODE #if IN_STG_CODE
extern DLL_IMPORT_RTS StgWordArray stg_CHARLIKE_static_closure; extern DLL_IMPORT_RTS StgWordArray stg_CHARLIKE_closure;
extern DLL_IMPORT_RTS StgWordArray stg_INTLIKE_static_closure; extern DLL_IMPORT_RTS StgWordArray stg_INTLIKE_closure;
#else #else
extern DLL_IMPORT_RTS StgIntCharlikeClosure stg_CHARLIKE_static_closure[]; extern DLL_IMPORT_RTS StgIntCharlikeClosure stg_CHARLIKE_closure[];
extern DLL_IMPORT_RTS StgIntCharlikeClosure stg_INTLIKE_static_closure[]; extern DLL_IMPORT_RTS StgIntCharlikeClosure stg_INTLIKE_closure[];
#endif #endif
/* StgStartup */ /* StgStartup */
......
...@@ -74,7 +74,7 @@ import "integer-gmp" __gmpz_export; ...@@ -74,7 +74,7 @@ import "integer-gmp" __gmpz_export;
import "integer-gmp" integer_cbits_decodeDouble; import "integer-gmp" integer_cbits_decodeDouble;
import "rts" stg_INTLIKE_static_closure; import "rts" stg_INTLIKE_closure;
/* ----------------------------------------------------------------------------- /* -----------------------------------------------------------------------------
Arbitrary-precision Integer operations. Arbitrary-precision Integer operations.
...@@ -94,7 +94,7 @@ import "rts" stg_INTLIKE_static_closure; ...@@ -94,7 +94,7 @@ import "rts" stg_INTLIKE_static_closure;
dummy value is needed, the 'ByteArray#' is not supposed to be dummy value is needed, the 'ByteArray#' is not supposed to be
accessed anyway, this is should be a tolerable hack. 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# */ /* set mpz_t from Int#/ByteArray# */
#define MP_INT_SET_FROM_BA(mp_ptr,i,ba) \ #define MP_INT_SET_FROM_BA(mp_ptr,i,ba) \
......
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
#include "Cmm.h" #include "Cmm.h"
#include "RaiseAsync.h" #include "RaiseAsync.h"
import ghczmprim_GHCziTypes_True_static_closure; import ghczmprim_GHCziTypes_True_closure;
/* ----------------------------------------------------------------------------- /* -----------------------------------------------------------------------------
Exception Primitives Exception Primitives
...@@ -527,8 +527,8 @@ retry_pop_stack: ...@@ -527,8 +527,8 @@ retry_pop_stack:
Sp(5) = exception; Sp(5) = exception;
Sp(4) = stg_raise_ret_info; Sp(4) = stg_raise_ret_info;
Sp(3) = exception; // the AP_STACK Sp(3) = exception; // the AP_STACK
Sp(2) = STATIC_CLOSURE(ghczmprim_GHCziTypes_True); // dummy breakpoint info Sp(2) = ghczmprim_GHCziTypes_True_closure; // dummy breakpoint info
Sp(1) = STATIC_CLOSURE(ghczmprim_GHCziTypes_True); // True <=> a breakpoint Sp(1) = ghczmprim_GHCziTypes_True_closure; // True <=> a breakpoint
R1 = ioAction; R1 = ioAction;
jump RET_LBL(stg_ap_pppv) [R1]; jump RET_LBL(stg_ap_pppv) [R1];
} }
......
...@@ -879,7 +879,7 @@ run_BCO: ...@@ -879,7 +879,7 @@ run_BCO:
new_aps = (StgAP_STACK *) allocate(cap, AP_STACK_sizeW(size_words)); new_aps = (StgAP_STACK *) allocate(cap, AP_STACK_sizeW(size_words));
SET_HDR(new_aps,&stg_AP_STACK_info,CCS_SYSTEM); SET_HDR(new_aps,&stg_AP_STACK_info,CCS_SYSTEM);
new_aps->size = size_words; 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 // fill in the payload of the AP_STACK
new_aps->payload[0] = (StgClosure *)&stg_apply_interp_info; new_aps->payload[0] = (StgClosure *)&stg_apply_interp_info;
......
...@@ -1044,8 +1044,8 @@ typedef struct _RtsSymbolVal { ...@@ -1044,8 +1044,8 @@ typedef struct _RtsSymbolVal {
#define RTS_INTCHAR_SYMBOLS #define RTS_INTCHAR_SYMBOLS
#else #else
#define RTS_INTCHAR_SYMBOLS \ #define RTS_INTCHAR_SYMBOLS \
SymI_HasProto(stg_CHARLIKE_static_closure) \ SymI_HasProto(stg_CHARLIKE_closure) \
SymI_HasProto(stg_INTLIKE_static_closure) SymI_HasProto(stg_INTLIKE_closure)
#endif #endif
......
...@@ -14,42 +14,42 @@ ...@@ -14,42 +14,42 @@
*/ */
#if IN_STG_CODE #if IN_STG_CODE
#define PRELUDE_INFO(i) extern W_(i)[] #define PRELUDE_INFO(i) extern W_(i)[]
#define PRELUDE_CLOSURE(i) extern W_(i ## _static_closure)[] #define PRELUDE_CLOSURE(i) extern W_(i)[]
#else #else
#define PRELUDE_INFO(i) extern const StgInfoTable DLL_IMPORT_DATA_VARNAME(i) #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 #endif
/* Define canonical names so we can abstract away from the actual /* Define canonical names so we can abstract away from the actual
* modules these names are defined in. * modules these names are defined in.
*/ */
PRELUDE_CLOSURE(ghczmprim_GHCziTypes_True); PRELUDE_CLOSURE(ghczmprim_GHCziTypes_True_closure);
PRELUDE_CLOSURE(ghczmprim_GHCziTypes_False); PRELUDE_CLOSURE(ghczmprim_GHCziTypes_False_closure);
PRELUDE_CLOSURE(base_GHCziPack_unpackCString); PRELUDE_CLOSURE(base_GHCziPack_unpackCString_closure);
PRELUDE_CLOSURE(base_GHCziWeak_runFinalizzerBatch); PRELUDE_CLOSURE(base_GHCziWeak_runFinalizzerBatch_closure);
#ifdef IN_STG_CODE #ifdef IN_STG_CODE
extern W_ ZCMain_main_static_closure[]; extern W_ ZCMain_main_closure[];
#else #else
extern StgClosure ZCMain_main_static_closure; extern StgClosure ZCMain_main_closure;
#endif #endif
PRELUDE_CLOSURE(base_GHCziIOziException_stackOverflow); PRELUDE_CLOSURE(base_GHCziIOziException_stackOverflow_closure);
PRELUDE_CLOSURE(base_GHCziIOziException_heapOverflow); PRELUDE_CLOSURE(base_GHCziIOziException_heapOverflow_closure);
PRELUDE_CLOSURE(base_GHCziIOziException_blockedIndefinitelyOnThrowTo); PRELUDE_CLOSURE(base_GHCziIOziException_blockedIndefinitelyOnThrowTo_closure);
PRELUDE_CLOSURE(base_GHCziIOziException_blockedIndefinitelyOnMVar); PRELUDE_CLOSURE(base_GHCziIOziException_blockedIndefinitelyOnMVar_closure);
PRELUDE_CLOSURE(base_GHCziIOziException_blockedIndefinitelyOnSTM); PRELUDE_CLOSURE(base_GHCziIOziException_blockedIndefinitelyOnSTM_closure);
PRELUDE_CLOSURE(base_ControlziExceptionziBase_nonTermination); PRELUDE_CLOSURE(base_ControlziExceptionziBase_nonTermination_closure);
PRELUDE_CLOSURE(base_ControlziExceptionziBase_nestedAtomically); PRELUDE_CLOSURE(base_ControlziExceptionziBase_nestedAtomically_closure);
PRELUDE_CLOSURE(base_GHCziEventziThread_blockedOnBadFD); PRELUDE_CLOSURE(base_GHCziEventziThread_blockedOnBadFD_closure);
PRELUDE_CLOSURE(base_GHCziConcziSync_runSparks); PRELUDE_CLOSURE(base_GHCziConcziSync_runSparks_closure);
PRELUDE_CLOSURE(base_GHCziConcziIO_ensureIOManagerIsRunning); PRELUDE_CLOSURE(base_GHCziConcziIO_ensureIOManagerIsRunning_closure);
PRELUDE_CLOSURE(base_GHCziConcziIO_ioManagerCapabilitiesChanged); PRELUDE_CLOSURE(base_GHCziConcziIO_ioManagerCapabilitiesChanged_closure);
PRELUDE_CLOSURE(base_GHCziConcziSignal_runHandlers); 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_Czh_static_info);
PRELUDE_INFO(ghczmprim_GHCziTypes_Izh_static_info); PRELUDE_INFO(ghczmprim_GHCziTypes_Izh_static_info);
...@@ -86,30 +86,26 @@ PRELUDE_INFO(base_GHCziWord_W64zh_con_info); ...@@ -86,30 +86,26 @@ PRELUDE_INFO(base_GHCziWord_W64zh_con_info);
PRELUDE_INFO(base_GHCziStable_StablePtr_static_info); PRELUDE_INFO(base_GHCziStable_StablePtr_static_info);
PRELUDE_INFO(base_GHCziStable_StablePtr_con_info); PRELUDE_INFO(base_GHCziStable_StablePtr_con_info);
#define mainIO_closure (STATIC_CLOSURE(ZCMain_main)) #define True_closure DLL_IMPORT_DATA_REF(ghczmprim_GHCziTypes_True_closure)
#define False_closure DLL_IMPORT_DATA_REF(ghczmprim_GHCziTypes_False_closure)
// XXX update me #define unpackCString_closure DLL_IMPORT_DATA_REF(base_GHCziPack_unpackCString_closure)
#define IMPORT_CLOSURE(name) DLL_IMPORT_DATA_REF(name ## _static_closure) #define runFinalizerBatch_closure DLL_IMPORT_DATA_REF(base_GHCziWeak_runFinalizzerBatch_closure)
#define mainIO_closure (&ZCMain_main_closure)
#define True_closure IMPORT_CLOSURE(ghczmprim_GHCziTypes_True)
#define False_closure IMPORT_CLOSURE(ghczmprim_GHCziTypes_False) #define runSparks_closure DLL_IMPORT_DATA_REF(base_GHCziConcziSync_runSparks_closure)
#define unpackCString_closure IMPORT_CLOSURE(base_GHCziPack_unpackCString) #define ensureIOManagerIsRunning_closure DLL_IMPORT_DATA_REF(base_GHCziConcziIO_ensureIOManagerIsRunning_closure)
#define runFinalizerBatch_closure IMPORT_CLOSURE(base_GHCziWeak_runFinalizzerBatch) #define ioManagerCapabilitiesChanged_closure DLL_IMPORT_DATA_REF(base_GHCziConcziIO_ioManagerCapabilitiesChanged_closure)
#define runHandlers_closure DLL_IMPORT_DATA_REF(base_GHCziConcziSignal_runHandlers_closure)
#define runSparks_closure IMPORT_CLOSURE(base_GHCziConcziSync_runSparks)
#define ensureIOManagerIsRunning_closure IMPORT_CLOSURE(base_GHCziConcziIO_ensureIOManagerIsRunning) #define flushStdHandles_closure DLL_IMPORT_DATA_REF(base_GHCziTopHandler_flushStdHandles_closure)
#define ioManagerCapabilitiesChanged_closure IMPORT_CLOSURE(base_GHCziConcziIO_ioManagerCapabilitiesChanged)
#define runHandlers_closure IMPORT_CLOSURE(base_GHCziConcziSignal_runHandlers) #define stackOverflow_closure DLL_IMPORT_DATA_REF(base_GHCziIOziException_stackOverflow_closure)
#define heapOverflow_closure DLL_IMPORT_DATA_REF(base_GHCziIOziException_heapOverflow_closure)
#define flushStdHandles_closure IMPORT_CLOSURE(base_GHCziTopHandler_flushStdHandles) #define blockedIndefinitelyOnMVar_closure DLL_IMPORT_DATA_REF(base_GHCziIOziException_blockedIndefinitelyOnMVar_closure)
#define blockedIndefinitelyOnSTM_closure DLL_IMPORT_DATA_REF(base_GHCziIOziException_blockedIndefinitelyOnSTM_closure)
#define stackOverflow_closure IMPORT_CLOSURE(base_GHCziIOziException_stackOverflow) #define nonTermination_closure DLL_IMPORT_DATA_REF(base_ControlziExceptionziBase_nonTermination_closure)
#define heapOverflow_closure IMPORT_CLOSURE(base_GHCziIOziException_heapOverflow) #define nestedAtomically_closure DLL_IMPORT_DATA_REF(base_ControlziExceptionziBase_nestedAtomically_closure)
#define blockedIndefinitelyOnMVar_closure IMPORT_CLOSURE(base_GHCziIOziException_blockedIndefinitelyOnMVar) #define blockedOnBadFD_closure DLL_IMPORT_DATA_REF(base_GHCziEventziThread_blockedOnBadFD_closure)
#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 Czh_static_info DLL_IMPORT_DATA_REF(ghczmprim_GHCziTypes_Czh_static_info) #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) #define Fzh_static_info DLL_IMPORT_DATA_REF(ghczmprim_GHCziTypes_Fzh_static_info)
......
...@@ -31,7 +31,7 @@ import pthread_mutex_unlock; ...@@ -31,7 +31,7 @@ import pthread_mutex_unlock;
import base_ControlziExceptionziBase_nestedAtomically_static_closure; import base_ControlziExceptionziBase_nestedAtomically_static_closure;
import EnterCriticalSection; import EnterCriticalSection;
import LeaveCriticalSection; import LeaveCriticalSection;
import ghczmprim_GHCziTypes_False_static_closure; import ghczmprim_GHCziTypes_False_closure;
#if defined(USE_MINIINTERPRETER) || !defined(mingw32_HOST_OS) #if defined(USE_MINIINTERPRETER) || !defined(mingw32_HOST_OS)
import sm_mutex; import sm_mutex;
#endif #endif
...@@ -1171,7 +1171,7 @@ stg_atomicallyzh (P_ stm) ...@@ -1171,7 +1171,7 @@ stg_atomicallyzh (P_ stm)
/* Nested transactions are not allowed; raise an exception */ /* Nested transactions are not allowed; raise an exception */
if (old_trec != NO_TREC) { if (old_trec != NO_TREC) {
jump stg_raisezh(STATIC_CLOSURE(base_ControlziExceptionziBase_nestedAtomically)); jump stg_raisezh(base_ControlziExceptionziBase_nestedAtomically_closure);
} }
code = stm; code = stm;
...@@ -2342,13 +2342,13 @@ stg_getSparkzh () ...@@ -2342,13 +2342,13 @@ stg_getSparkzh ()
W_ spark; W_ spark;
#ifndef THREADED_RTS #ifndef THREADED_RTS
return (0,STATIC_CLOSURE(ghczmprim_GHCziTypes_False)); return (0,ghczmprim_GHCziTypes_False_closure);
#else #else
(spark) = ccall findSpark(MyCapability()); (spark) = ccall findSpark(MyCapability());
if (spark != 0) { if (spark != 0) {
return (1,spark); return (1,spark);
} else { } else {
return (0,STATIC_CLOSURE(ghczmprim_GHCziTypes_False)); return (0,ghczmprim_GHCziTypes_False_closure);
} }
#endif #endif
} }
......
...@@ -776,7 +776,7 @@ raiseAsync(Capability *cap, StgTSO *tso, StgClosure *exception, ...@@ -776,7 +776,7 @@ raiseAsync(Capability *cap, StgTSO *tso, StgClosure *exception,
sp++; sp++;
} else { } else {
sp--; sp--;
sp[0] = (W_)stg_dummy_ret_closure; sp[0] = (W_)&stg_dummy_ret_closure;
} }
frame = sp + 1; frame = sp + 1;
...@@ -957,7 +957,7 @@ raiseAsync(Capability *cap, StgTSO *tso, StgClosure *exception, ...@@ -957,7 +957,7 @@ raiseAsync(Capability *cap, StgTSO *tso, StgClosure *exception,
// ATOMICALLY_FRAME instance for condemned // ATOMICALLY_FRAME instance for condemned
// transactions, but I don't fully understand the // transactions, but I don't fully understand the
// interaction with STM invariants. // 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;