diff options
author | Sverker Eriksson <[email protected]> | 2012-01-11 19:02:01 +0100 |
---|---|---|
committer | Sverker Eriksson <[email protected]> | 2012-01-11 19:02:01 +0100 |
commit | af99d9a501ede4af09517f27dde2897577aaba4a (patch) | |
tree | f6b1c5e6e2f7699eba246bd45695eafb32ebd127 | |
parent | abdafb962fb1387d1c3cac95be1c524026e6067a (diff) | |
parent | 9a939eb85807b41aaaeff795293a6de5a29870bd (diff) | |
download | otp-af99d9a501ede4af09517f27dde2897577aaba4a.tar.gz otp-af99d9a501ede4af09517f27dde2897577aaba4a.tar.bz2 otp-af99d9a501ede4af09517f27dde2897577aaba4a.zip |
Merge branch 'sverk/hipe-hibernate-sparc-bug' into maint
* sverk/hipe-hibernate-sparc-bug:
erts: Make GC tolerate hibernated process without hipe stack
-rw-r--r-- | erts/emulator/beam/erl_gc.c | 13 | ||||
-rw-r--r-- | erts/emulator/hipe/hipe_gc.c | 10 |
2 files changed, 22 insertions, 1 deletions
diff --git a/erts/emulator/beam/erl_gc.c b/erts/emulator/beam/erl_gc.c index eb2b945877..9590aa4a74 100644 --- a/erts/emulator/beam/erl_gc.c +++ b/erts/emulator/beam/erl_gc.c @@ -910,7 +910,18 @@ minor_collection(Process* p, int need, Eterm* objv, int nobj, Uint *recl) * XXX: WARNING: If HiPE starts storing other non-Erlang values on the * nstack, such as floats, then this will have to be changed. */ -#define offset_nstack(p,offs,area,area_size) offset_heap_ptr(hipe_nstack_start((p)),hipe_nstack_used((p)),(offs),(area),(area_size)) +static ERTS_INLINE void offset_nstack(Process* p, Sint offs, + char* area, Uint area_size) +{ + if (p->hipe.nstack) { + ASSERT(p->hipe.nsp && p->hipe.nstend); + offset_heap_ptr(hipe_nstack_start(p), hipe_nstack_used(p), + offs, area, area_size); + } + else { + ASSERT(!p->hipe.nsp && !p->hipe.nstend); + } +} #else /* !HIPE */ diff --git a/erts/emulator/hipe/hipe_gc.c b/erts/emulator/hipe/hipe_gc.c index 0199dea99e..e0575c35ff 100644 --- a/erts/emulator/hipe/hipe_gc.c +++ b/erts/emulator/hipe/hipe_gc.c @@ -46,9 +46,14 @@ Eterm *fullsweep_nstack(Process *p, Eterm *n_htop) char *src, *oh; Uint src_size, oh_size; + if (!p->hipe.nstack) { + ASSERT(!p->hipe.nsp && !p->hipe.nstend); + return n_htop; + } if (!nstack_walk_init_check(p)) return n_htop; + ASSERT(p->hipe.nsp && p->hipe.nstend); nsp = nstack_walk_nsp_begin(p); nsp_end = p->hipe.nstgraylim; if (nsp_end) @@ -136,9 +141,14 @@ void gensweep_nstack(Process *p, Eterm **ptr_old_htop, Eterm **ptr_n_htop) char *heap; Uint heap_size, mature_size; + if (!p->hipe.nstack) { + ASSERT(!p->hipe.nsp && !p->hipe.nstend); + return; + } if (!nstack_walk_init_check(p)) return; + ASSERT(p->hipe.nsp && p->hipe.nstend); nsp = nstack_walk_nsp_begin(p); nsp_end = p->hipe.nstgraylim; if (nsp_end) { |