summaryrefslogtreecommitdiff
path: root/rts/Interpreter.c
diff options
context:
space:
mode:
authorSimon Marlow <simonmar@microsoft.com>2007-10-10 09:32:41 +0000
committerSimon Marlow <simonmar@microsoft.com>2007-10-10 09:32:41 +0000
commit2777940384ce4740954062bedd0f6813698fc72a (patch)
treee73a8c5e4a1d35057527a68676bc7d13b3fff30d /rts/Interpreter.c
parent70f308087c2291a3114bfedaa7ae915b1a1ac70a (diff)
downloadhaskell-2777940384ce4740954062bedd0f6813698fc72a.tar.gz
GHCi: use non-updatable thunks for breakpoints
The extra safe points introduced for breakpoints were previously compiled as normal updatable thunks, but they are guaranteed single-entry, so we can use non-updatable thunks here. This restores the tail-call property where it was lost in some cases (although stack squeezing probably often recovered it), and should improve performance.
Diffstat (limited to 'rts/Interpreter.c')
-rw-r--r--rts/Interpreter.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/rts/Interpreter.c b/rts/Interpreter.c
index 527ebde0d0..00830f43f2 100644
--- a/rts/Interpreter.c
+++ b/rts/Interpreter.c
@@ -1049,6 +1049,17 @@ run_BCO:
goto nextInsn;
}
+ case bci_ALLOC_AP_NOUPD: {
+ StgAP* ap;
+ int n_payload = BCO_NEXT;
+ ap = (StgAP*)allocate(AP_sizeW(n_payload));
+ Sp[-1] = (W_)ap;
+ ap->n_args = n_payload;
+ SET_HDR(ap, &stg_AP_NOUPD_info, CCS_SYSTEM/*ToDo*/)
+ Sp --;
+ goto nextInsn;
+ }
+
case bci_ALLOC_PAP: {
StgPAP* pap;
int arity = BCO_NEXT;
@@ -1370,7 +1381,7 @@ run_BCO:
// Errors
default:
barf("interpretBCO: unknown or unimplemented opcode %d",
- (int)BCO_NEXT);
+ (int)(bci & 0xFF));
} /* switch on opcode */
}