summaryrefslogtreecommitdiff
path: root/compiler/codeGen
diff options
context:
space:
mode:
authordias@cs.tufts.edu <unknown>2009-09-18 18:34:15 +0000
committerdias@cs.tufts.edu <unknown>2009-09-18 18:34:15 +0000
commite4caa74b6c809cd17c5d1f7d472b9a47b2ea6f1c (patch)
tree8917db21c74605655582adeaa1404e9bc81344f4 /compiler/codeGen
parente4622dac19c0ea5ba60078667c57e03801cdc943 (diff)
downloadhaskell-e4caa74b6c809cd17c5d1f7d472b9a47b2ea6f1c.tar.gz
Fixed calling convention for unboxed tuples
Apparently, the arguments should be sorted by pointerhood. While we're at it, I rewrote the code that assigns registers and stack space to function call and return parameters.
Diffstat (limited to 'compiler/codeGen')
-rw-r--r--compiler/codeGen/StgCmm.hs3
-rw-r--r--compiler/codeGen/StgCmmLayout.hs11
-rw-r--r--compiler/codeGen/StgCmmUtils.hs2
3 files changed, 9 insertions, 7 deletions
diff --git a/compiler/codeGen/StgCmm.hs b/compiler/codeGen/StgCmm.hs
index 84edcce21c..52809da502 100644
--- a/compiler/codeGen/StgCmm.hs
+++ b/compiler/codeGen/StgCmm.hs
@@ -329,7 +329,8 @@ cgDataCon data_con
(dyn_cl_info, arg_things) = layOutDynConstr data_con arg_reps
emit_info cl_info ticky_code
- = emitClosureAndInfoTable cl_info [] $ mk_code ticky_code
+ = emitClosureAndInfoTable cl_info NativeDirectCall []
+ $ mk_code ticky_code
mk_code ticky_code
= -- NB: We don't set CC when entering data (WDP 94/06)
diff --git a/compiler/codeGen/StgCmmLayout.hs b/compiler/codeGen/StgCmmLayout.hs
index 0e98e148ae..3b69061426 100644
--- a/compiler/codeGen/StgCmmLayout.hs
+++ b/compiler/codeGen/StgCmmLayout.hs
@@ -474,17 +474,18 @@ emitClosureProcAndInfoTable top_lvl bndr cl_info args body
; let node_points = nodeMustPointToIt lf_info
; arg_regs <- bindArgsToRegs args
; let args' = if node_points then (node : arg_regs) else arg_regs
- ; emitClosureAndInfoTable cl_info args' $ body (node, arg_regs)
+ conv = if nodeMustPointToIt lf_info
+ then NativeNodeCall else NativeDirectCall
+ ; emitClosureAndInfoTable cl_info conv args' $ body (node, arg_regs)
}
-- Data constructors need closures, but not with all the argument handling
-- needed for functions. The shared part goes here.
-emitClosureAndInfoTable :: ClosureInfo -> [LocalReg] -> FCode () -> FCode ()
-emitClosureAndInfoTable cl_info args body
+emitClosureAndInfoTable ::
+ ClosureInfo -> Convention -> [LocalReg] -> FCode () -> FCode ()
+emitClosureAndInfoTable cl_info conv args body
= do { info <- mkCmmInfo cl_info
; blks <- getCode body
- ; let conv = if nodeMustPointToIt (closureLFInfo cl_info) then NativeNodeCall
- else NativeDirectCall
; emitProcWithConvention conv info (infoLblToEntryLbl info_lbl) args blks
}
where
diff --git a/compiler/codeGen/StgCmmUtils.hs b/compiler/codeGen/StgCmmUtils.hs
index a9532e5eff..73b3052349 100644
--- a/compiler/codeGen/StgCmmUtils.hs
+++ b/compiler/codeGen/StgCmmUtils.hs
@@ -500,7 +500,7 @@ newTemp rep = do { uniq <- newUnique
newUnboxedTupleRegs :: Type -> FCode ([LocalReg], [ForeignHint])
-- Choose suitable local regs to use for the components
-- of an unboxed tuple that we are about to return to
--- the Sequel. If the Sequel is a joint point, using the
+-- the Sequel. If the Sequel is a join point, using the
-- regs it wants will save later assignments.
newUnboxedTupleRegs res_ty
= ASSERT( isUnboxedTupleType res_ty )