projects
/
ghc-hetmet.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
FIX #1779 and qq005: export hs_hpc_module
[ghc-hetmet.git]
/
rts
/
Interpreter.c
diff --git
a/rts/Interpreter.c
b/rts/Interpreter.c
index
d541dfc
..
1a6e927
100644
(file)
--- a/
rts/Interpreter.c
+++ b/
rts/Interpreter.c
@@
-196,6
+196,9
@@
interpretBCO (Capability* cap)
LOAD_STACK_POINTERS;
LOAD_STACK_POINTERS;
+ cap->r.rHpLim = (P_)1; // HpLim is the context-switch flag; when it
+ // goes to zero we must return to the scheduler.
+
// ------------------------------------------------------------------------
// Case 1:
//
// ------------------------------------------------------------------------
// Case 1:
//
@@
-1281,7
+1284,7
@@
run_BCO:
// context switching: sometimes the scheduler can invoke
// the interpreter with context_switch == 1, particularly
// if the -C0 flag has been given on the cmd line.
// context switching: sometimes the scheduler can invoke
// the interpreter with context_switch == 1, particularly
// if the -C0 flag has been given on the cmd line.
- if (context_switch) {
+ if (cap->r.rHpLim == NULL) {
Sp--; Sp[0] = (W_)&stg_enter_info;
RETURN_TO_SCHEDULER(ThreadInterpret, ThreadYielding);
}
Sp--; Sp[0] = (W_)&stg_enter_info;
RETURN_TO_SCHEDULER(ThreadInterpret, ThreadYielding);
}
@@
-1422,7
+1425,7
@@
run_BCO:
ffi_call(cif, fn, ret, argptrs);
// And restart the thread again, popping the RET_DYN frame.
ffi_call(cif, fn, ret, argptrs);
// And restart the thread again, popping the RET_DYN frame.
- cap = (Capability *)((void *)((unsigned char*)resumeThread(tok) - sizeof(StgFunTable)));
+ cap = (Capability *)((void *)((unsigned char*)resumeThread(tok) - FIELD_OFFSET(Capability,r)));
LOAD_STACK_POINTERS;
// Re-load the pointer to the BCO from the RET_DYN frame,
LOAD_STACK_POINTERS;
// Re-load the pointer to the BCO from the RET_DYN frame,