summaryrefslogtreecommitdiff
path: root/compiler/codeGen
diff options
context:
space:
mode:
authorSimon Marlow <marlowsd@gmail.com>2012-01-25 14:49:48 +0000
committerSimon Marlow <marlowsd@gmail.com>2012-01-25 14:49:48 +0000
commit91eadd51108b6d03493bf57cea83dd9ceb02c353 (patch)
tree4b6fa862ea5bcddba527d4120fc01459dbcf56ab /compiler/codeGen
parent5d5a01483643ea7b06189878975e67801950a8cc (diff)
downloadhaskell-91eadd51108b6d03493bf57cea83dd9ceb02c353.tar.gz
small refactor
Diffstat (limited to 'compiler/codeGen')
-rw-r--r--compiler/codeGen/StgCmmExpr.hs11
1 files changed, 6 insertions, 5 deletions
diff --git a/compiler/codeGen/StgCmmExpr.hs b/compiler/codeGen/StgCmmExpr.hs
index 0c5dcb5f6a..3b12b2a4b7 100644
--- a/compiler/codeGen/StgCmmExpr.hs
+++ b/compiler/codeGen/StgCmmExpr.hs
@@ -532,12 +532,13 @@ cgTailCall fun_id fun_info args = do
ReturnIt -> emitReturn [fun] -- ToDo: does ReturnIt guarantee tagged?
EnterIt -> ASSERT( null args ) -- Discarding arguments
- do { let fun' = CmmLoad fun (cmmExprType fun)
+ do { let entry = entryCode (closureInfoPtr fun)
; [ret,call] <- forkAlts [
- getCode $ emitReturn [fun], -- Is tagged; no need to untag
- getCode $ do -- emitAssign nodeReg fun
- emitCall (NativeNodeCall, NativeReturn)
- (entryCode fun') [fun]] -- Not tagged
+ getCode $
+ emitReturn [fun], -- Is tagged; no need to untag
+ getCode $ do -- Not tagged
+ emitCall (NativeNodeCall, NativeReturn) entry [fun]
+ ]
; emit =<< mkCmmIfThenElse (cmmIsTagged fun) ret call }
SlowCall -> do -- A slow function call via the RTS apply routines