summaryrefslogtreecommitdiff
path: root/rts/Interpreter.c
diff options
context:
space:
mode:
authorSimon Marlow <marlowsd@gmail.com>2012-07-04 10:34:48 +0100
committerSimon Marlow <marlowsd@gmail.com>2012-07-04 10:34:48 +0100
commit99fd2469fba1a38b2a65b4694f337d92e559df01 (patch)
tree20491590ccb07223afd9d1f6a6546213b0f43577 /rts/Interpreter.c
parentd260d919eef22654b1af61334feed0545f64cea5 (diff)
parent0d19922acd724991b7b97871b1404f3db5058b49 (diff)
downloadhaskell-99fd2469fba1a38b2a65b4694f337d92e559df01.tar.gz
Merge remote-tracking branch 'origin/master' into newcg
* origin/master: (756 commits) don't crash if argv[0] == NULL (#7037) -package P was loading all versions of P in GHCi (#7030) Add a Note, copying text from #2437 improve the --help docs a bit (#7008) Copy Data.HashTable's hashString into our Util module Build fix Build fixes Parse error: suggest brackets and indentation. Don't build the ghc DLL on Windows; works around trac #5987 On Windows, detect if DLLs have too many symbols; trac #5987 Add some more Integer rules; fixes #6111 Fix PA dfun construction with silent superclass args Add silent superclass parameters to the vectoriser Add silent superclass parameters (again) Mention Generic1 in the user's guide Make the GHC API a little more powerful. tweak llvm version warning message New version of the patch for #5461. Fix Word64ToInteger conversion rule. Implemented feature request on reconfigurable pretty-printing in GHCi (#5461) ... Conflicts: compiler/basicTypes/UniqSupply.lhs compiler/cmm/CmmBuildInfoTables.hs compiler/cmm/CmmLint.hs compiler/cmm/CmmOpt.hs compiler/cmm/CmmPipeline.hs compiler/cmm/CmmStackLayout.hs compiler/cmm/MkGraph.hs compiler/cmm/OldPprCmm.hs compiler/codeGen/CodeGen.lhs compiler/codeGen/StgCmm.hs compiler/codeGen/StgCmmBind.hs compiler/codeGen/StgCmmLayout.hs compiler/codeGen/StgCmmUtils.hs compiler/main/CodeOutput.lhs compiler/main/HscMain.hs compiler/nativeGen/AsmCodeGen.lhs compiler/simplStg/SimplStg.lhs
Diffstat (limited to 'rts/Interpreter.c')
-rw-r--r--rts/Interpreter.c48
1 files changed, 25 insertions, 23 deletions
diff --git a/rts/Interpreter.c b/rts/Interpreter.c
index 2eac1cd834..d879fd3e77 100644
--- a/rts/Interpreter.c
+++ b/rts/Interpreter.c
@@ -31,9 +31,11 @@
// When building the RTS in the non-dyn way on Windows, we don't
// want declspec(__dllimport__) on the front of function prototypes
// from libffi.
-#if defined(mingw32_HOST_OS) && !defined(__PIC__)
+#if defined(mingw32_HOST_OS)
+#if (defined(i386_HOST_ARCH) && !defined(__PIC__)) || defined(x86_64_HOST_ARCH)
# define LIBFFI_NOT_DLL
#endif
+#endif
#include "ffi.h"
@@ -846,9 +848,9 @@ run_BCO:
int i;
int size_words;
- arg1_brk_array = BCO_NEXT; // 1st arg of break instruction
- arg2_array_index = BCO_NEXT; // 2nd arg of break instruction
- arg3_freeVars = BCO_NEXT; // 3rd arg of break instruction
+ arg1_brk_array = BCO_GET_LARGE_ARG; // 1st arg of break instruction
+ arg2_array_index = BCO_NEXT; // 2nd arg of break instruction
+ arg3_freeVars = BCO_GET_LARGE_ARG; // 3rd arg of break instruction
// check if we are returning from a breakpoint - this info
// is stored in the flags field of the current TSO
@@ -967,14 +969,14 @@ run_BCO:
}
case bci_PUSH_G: {
- int o1 = BCO_NEXT;
+ int o1 = BCO_GET_LARGE_ARG;
Sp[-1] = BCO_PTR(o1);
Sp -= 1;
goto nextInsn;
}
case bci_PUSH_ALTS: {
- int o_bco = BCO_NEXT;
+ int o_bco = BCO_GET_LARGE_ARG;
Sp[-2] = (W_)&stg_ctoi_R1p_info;
Sp[-1] = BCO_PTR(o_bco);
Sp -= 2;
@@ -982,7 +984,7 @@ run_BCO:
}
case bci_PUSH_ALTS_P: {
- int o_bco = BCO_NEXT;
+ int o_bco = BCO_GET_LARGE_ARG;
Sp[-2] = (W_)&stg_ctoi_R1unpt_info;
Sp[-1] = BCO_PTR(o_bco);
Sp -= 2;
@@ -990,7 +992,7 @@ run_BCO:
}
case bci_PUSH_ALTS_N: {
- int o_bco = BCO_NEXT;
+ int o_bco = BCO_GET_LARGE_ARG;
Sp[-2] = (W_)&stg_ctoi_R1n_info;
Sp[-1] = BCO_PTR(o_bco);
Sp -= 2;
@@ -998,7 +1000,7 @@ run_BCO:
}
case bci_PUSH_ALTS_F: {
- int o_bco = BCO_NEXT;
+ int o_bco = BCO_GET_LARGE_ARG;
Sp[-2] = (W_)&stg_ctoi_F1_info;
Sp[-1] = BCO_PTR(o_bco);
Sp -= 2;
@@ -1006,7 +1008,7 @@ run_BCO:
}
case bci_PUSH_ALTS_D: {
- int o_bco = BCO_NEXT;
+ int o_bco = BCO_GET_LARGE_ARG;
Sp[-2] = (W_)&stg_ctoi_D1_info;
Sp[-1] = BCO_PTR(o_bco);
Sp -= 2;
@@ -1014,7 +1016,7 @@ run_BCO:
}
case bci_PUSH_ALTS_L: {
- int o_bco = BCO_NEXT;
+ int o_bco = BCO_GET_LARGE_ARG;
Sp[-2] = (W_)&stg_ctoi_L1_info;
Sp[-1] = BCO_PTR(o_bco);
Sp -= 2;
@@ -1022,7 +1024,7 @@ run_BCO:
}
case bci_PUSH_ALTS_V: {
- int o_bco = BCO_NEXT;
+ int o_bco = BCO_GET_LARGE_ARG;
Sp[-2] = (W_)&stg_ctoi_V_info;
Sp[-1] = BCO_PTR(o_bco);
Sp -= 2;
@@ -1065,7 +1067,7 @@ run_BCO:
case bci_PUSH_UBX: {
int i;
- int o_lits = BCO_NEXT;
+ int o_lits = BCO_GET_LARGE_ARG;
int n_words = BCO_NEXT;
Sp -= n_words;
for (i = 0; i < n_words; i++) {
@@ -1179,7 +1181,7 @@ run_BCO:
case bci_PACK: {
int i;
- int o_itbl = BCO_NEXT;
+ int o_itbl = BCO_GET_LARGE_ARG;
int n_words = BCO_NEXT;
StgInfoTable* itbl = INFO_PTR_TO_STRUCT(BCO_LIT(o_itbl));
int request = CONSTR_sizeW( itbl->layout.payload.ptrs,
@@ -1222,7 +1224,7 @@ run_BCO:
case bci_TESTLT_I: {
// There should be an Int at Sp[1], and an info table at Sp[0].
- int discr = BCO_NEXT;
+ int discr = BCO_GET_LARGE_ARG;
int failto = BCO_GET_LARGE_ARG;
I_ stackInt = (I_)Sp[1];
if (stackInt >= (I_)BCO_LIT(discr))
@@ -1232,7 +1234,7 @@ run_BCO:
case bci_TESTEQ_I: {
// There should be an Int at Sp[1], and an info table at Sp[0].
- int discr = BCO_NEXT;
+ int discr = BCO_GET_LARGE_ARG;
int failto = BCO_GET_LARGE_ARG;
I_ stackInt = (I_)Sp[1];
if (stackInt != (I_)BCO_LIT(discr)) {
@@ -1243,7 +1245,7 @@ run_BCO:
case bci_TESTLT_W: {
// There should be an Int at Sp[1], and an info table at Sp[0].
- int discr = BCO_NEXT;
+ int discr = BCO_GET_LARGE_ARG;
int failto = BCO_GET_LARGE_ARG;
W_ stackWord = (W_)Sp[1];
if (stackWord >= (W_)BCO_LIT(discr))
@@ -1253,7 +1255,7 @@ run_BCO:
case bci_TESTEQ_W: {
// There should be an Int at Sp[1], and an info table at Sp[0].
- int discr = BCO_NEXT;
+ int discr = BCO_GET_LARGE_ARG;
int failto = BCO_GET_LARGE_ARG;
W_ stackWord = (W_)Sp[1];
if (stackWord != (W_)BCO_LIT(discr)) {
@@ -1264,7 +1266,7 @@ run_BCO:
case bci_TESTLT_D: {
// There should be a Double at Sp[1], and an info table at Sp[0].
- int discr = BCO_NEXT;
+ int discr = BCO_GET_LARGE_ARG;
int failto = BCO_GET_LARGE_ARG;
StgDouble stackDbl, discrDbl;
stackDbl = PK_DBL( & Sp[1] );
@@ -1277,7 +1279,7 @@ run_BCO:
case bci_TESTEQ_D: {
// There should be a Double at Sp[1], and an info table at Sp[0].
- int discr = BCO_NEXT;
+ int discr = BCO_GET_LARGE_ARG;
int failto = BCO_GET_LARGE_ARG;
StgDouble stackDbl, discrDbl;
stackDbl = PK_DBL( & Sp[1] );
@@ -1290,7 +1292,7 @@ run_BCO:
case bci_TESTLT_F: {
// There should be a Float at Sp[1], and an info table at Sp[0].
- int discr = BCO_NEXT;
+ int discr = BCO_GET_LARGE_ARG;
int failto = BCO_GET_LARGE_ARG;
StgFloat stackFlt, discrFlt;
stackFlt = PK_FLT( & Sp[1] );
@@ -1303,7 +1305,7 @@ run_BCO:
case bci_TESTEQ_F: {
// There should be a Float at Sp[1], and an info table at Sp[0].
- int discr = BCO_NEXT;
+ int discr = BCO_GET_LARGE_ARG;
int failto = BCO_GET_LARGE_ARG;
StgFloat stackFlt, discrFlt;
stackFlt = PK_FLT( & Sp[1] );
@@ -1367,7 +1369,7 @@ run_BCO:
case bci_CCALL: {
void *tok;
int stk_offset = BCO_NEXT;
- int o_itbl = BCO_NEXT;
+ int o_itbl = BCO_GET_LARGE_ARG;
int interruptible = BCO_NEXT;
void(*marshall_fn)(void*) = (void (*)(void*))BCO_LIT(o_itbl);
int ret_dyn_size =