-{- OLD: WDP: 94/06
-
-evalPushRCCFrame :: Bool -> Code -> Code
-
-evalPushRCCFrame prim code
- = isSwitchSetC SccProfiling_Eval `thenFC` \ eval_profiling ->
-
- if (not eval_profiling) then
- code
- else
-
- -- Find out how many words of stack must will be
- -- deallocated at the end of the basic block
- -- As we push stuff onto the B stack we must make the
- -- RCC frame dealocate the B stack words
-
- -- We dont actually push things onto the A stack so we
- -- can treat the A stack as if these words were not there
- -- i.e. we subtract them from the A stack offset
- -- They will be popped by the current block of code
-
- -- Tell downstream code about the update frame on the B stack
- allocUpdateFrame
- sCC_RCC_UF_SIZE
- (panic "pushEvalRCCFrame: mkRestoreCostCentreLbl")
- (\ (old_args_spa, old_args_spb, upd_frame_offset) ->
-
- getSpARelOffset old_args_spa `thenFC` \ old_args_spa_rel ->
- getSpBRelOffset upd_frame_offset `thenFC` \ upd_frame_rel ->
-
- let b_wds_to_pop = upd_frame_offset - old_args_spb
- in
-
- -- Allocate enough space on the B stack for the frame
-
- evalCostCentreC
- (if prim then
- "PUSH_RCC_FRAME_RETURN"
- else
- "PUSH_RCC_FRAME_VECTOR")
- [
- mkIntCLit (spARelToInt old_args_spa_rel),
- {- Place on A stack to ``draw the line'' -}
- mkIntCLit (spBRelToInt upd_frame_rel),
- {- Ditto B stk. The update frame is pushed starting
- just above here -}
- mkIntCLit 0,
- {- Number of words of A below the line, which must be
- popped to get to the tail-call position -}
- mkIntCLit b_wds_to_pop
- {- Ditto B stk -}
- ] `thenC`
-
- code
-
-
- -- If we actually pushed things onto the A stack we have
- -- to arrange for the RCC frame to pop these as well
- -- Would need to tell downstream code about the update frame
- -- both the A and B stacks
- )
--}
+reserveSeqFrame :: EndOfBlockInfo -> EndOfBlockInfo
+reserveSeqFrame (EndOfBlockInfo args_sp (CaseAlts amode stuff))
+ = EndOfBlockInfo (args_sp + seqFrameSize) (SeqFrame amode stuff)
+
+pushSeqFrame :: VirtualSpOffset -> FCode VirtualSpOffset
+pushSeqFrame args_sp
+ = getSpRelOffset args_sp `thenFC` \ sp_rel ->
+ absC (CMacroStmt PUSH_SEQ_FRAME [CAddr sp_rel]) `thenC`
+ returnFC (args_sp - seqFrameSize)