aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSverker Eriksson <[email protected]>2016-10-04 12:26:54 +0200
committerSverker Eriksson <[email protected]>2016-10-10 11:31:54 +0200
commit9cb85a8cd1e02263f34c57aac68d16a2f1c03180 (patch)
treec93cab8f8529090e8d66d6317cea9bdf15a6b16a
parent3bffb5797c9498e2294b65ba24abec5842655a11 (diff)
downloadotp-9cb85a8cd1e02263f34c57aac68d16a2f1c03180.tar.gz
otp-9cb85a8cd1e02263f34c57aac68d16a2f1c03180.tar.bz2
otp-9cb85a8cd1e02263f34c57aac68d16a2f1c03180.zip
erts: Refactor hipe_sdesc.summary into bit fields
-rw-r--r--erts/emulator/hipe/hipe_risc_glue.h4
-rw-r--r--erts/emulator/hipe/hipe_stack.c4
-rw-r--r--erts/emulator/hipe/hipe_stack.h10
-rw-r--r--erts/emulator/hipe/hipe_x86_gc.h4
-rw-r--r--erts/emulator/hipe/hipe_x86_glue.h4
-rw-r--r--erts/emulator/hipe/hipe_x86_stack.c4
6 files changed, 21 insertions, 9 deletions
diff --git a/erts/emulator/hipe/hipe_risc_glue.h b/erts/emulator/hipe/hipe_risc_glue.h
index 3d84731cbe..09804e3016 100644
--- a/erts/emulator/hipe/hipe_risc_glue.h
+++ b/erts/emulator/hipe/hipe_risc_glue.h
@@ -70,7 +70,9 @@ static __inline__ void hipe_arch_glue_init(void)
.exnra = (unsigned long)&nbif_fail,
.sdesc = {
.bucket = { .hvalue = (unsigned long)&nbif_return },
- .summary = (1<<8),
+ .fsize = 0,
+ .has_exnra = 1,
+ .arity = 0
},
};
hipe_init_sdesc_table(&nbif_return_sdesc.sdesc);
diff --git a/erts/emulator/hipe/hipe_stack.c b/erts/emulator/hipe/hipe_stack.c
index a26132431b..17bef0718c 100644
--- a/erts/emulator/hipe/hipe_stack.c
+++ b/erts/emulator/hipe/hipe_stack.c
@@ -175,7 +175,9 @@ struct hipe_sdesc *hipe_decode_sdesc(Eterm arg)
/* Initialise head of sdesc. */
sdesc->bucket.next = 0;
sdesc->bucket.hvalue = ra;
- sdesc->summary = (fsize << 9) | (exnra ? (1<<8) : 0) | arity;
+ sdesc->fsize = fsize;
+ sdesc->has_exnra = (exnra ? 1 : 0);
+ sdesc->arity = arity;
/* Clear all live-bits */
for (i = 0; i < livebitswords; ++i)
sdesc->livebits[i] = 0;
diff --git a/erts/emulator/hipe/hipe_stack.h b/erts/emulator/hipe/hipe_stack.h
index e9d05bf99c..81f2e53dbc 100644
--- a/erts/emulator/hipe/hipe_stack.h
+++ b/erts/emulator/hipe/hipe_stack.h
@@ -35,7 +35,9 @@ struct hipe_sdesc {
unsigned long hvalue; /* return address */
struct hipe_sdesc *next; /* hash collision chain */
} bucket;
- unsigned int summary; /* frame size, exn handler presence flag, arity */
+ unsigned int fsize : 23; /* frame size */
+ unsigned int has_exnra : 1; /* exn handler presence flag */
+ unsigned int arity : 8;
#ifdef DEBUG
Eterm dbg_M, dbg_F;
unsigned dbg_A;
@@ -50,17 +52,17 @@ struct hipe_sdesc_with_exnra {
static __inline__ unsigned int sdesc_fsize(const struct hipe_sdesc *sdesc)
{
- return sdesc->summary >> 9;
+ return sdesc->fsize;
}
static __inline__ unsigned int sdesc_arity(const struct hipe_sdesc *sdesc)
{
- return sdesc->summary & 0xFF;
+ return sdesc->arity;
}
static __inline__ unsigned long sdesc_exnra(const struct hipe_sdesc *sdesc)
{
- if ((sdesc->summary & (1<<8))) {
+ if (sdesc->has_exnra) {
const char *tmp;
tmp = (const char*)sdesc - offsetof(struct hipe_sdesc_with_exnra, sdesc);
return ((const struct hipe_sdesc_with_exnra*)tmp)->exnra;
diff --git a/erts/emulator/hipe/hipe_x86_gc.h b/erts/emulator/hipe/hipe_x86_gc.h
index c025259871..7802076f70 100644
--- a/erts/emulator/hipe/hipe_x86_gc.h
+++ b/erts/emulator/hipe/hipe_x86_gc.h
@@ -68,7 +68,9 @@ nstack_walk_init_sdesc(const Process *p, struct nstack_walk_state *state)
unsigned int nstkarity = p->hipe.narity - NR_ARG_REGS;
if ((int)nstkarity < 0)
nstkarity = 0;
- state->sdesc0[0].summary = (0 << 9) | (0 << 8) | nstkarity;
+ state->sdesc0[0].fsize = 0;
+ state->sdesc0[0].has_exnra = 0;
+ state->sdesc0[0].arity = nstkarity;
state->sdesc0[0].livebits[0] = 0;
# ifdef DEBUG
state->sdesc0[0].dbg_M = 0;
diff --git a/erts/emulator/hipe/hipe_x86_glue.h b/erts/emulator/hipe/hipe_x86_glue.h
index d0c8eec2bc..0e9fcd61f1 100644
--- a/erts/emulator/hipe/hipe_x86_glue.h
+++ b/erts/emulator/hipe/hipe_x86_glue.h
@@ -62,7 +62,9 @@ static __inline__ void hipe_arch_glue_init(void)
.exnra = (unsigned long)nbif_fail,
.sdesc = {
.bucket = { .hvalue = (unsigned long)nbif_return },
- .summary = (1<<8),
+ .fsize = 0,
+ .has_exnra = 1,
+ .arity = 0,
#ifdef DEBUG
.dbg_F = am_return,
#endif
diff --git a/erts/emulator/hipe/hipe_x86_stack.c b/erts/emulator/hipe/hipe_x86_stack.c
index 6975cc4669..9426b166e2 100644
--- a/erts/emulator/hipe/hipe_x86_stack.c
+++ b/erts/emulator/hipe/hipe_x86_stack.c
@@ -71,7 +71,9 @@ void hipe_print_nstack(Process *p)
nstkarity = p->hipe.narity - NR_ARG_REGS;
if ((int)nstkarity < 0)
nstkarity = 0;
- sdesc0.summary = nstkarity;
+ sdesc0.fsize = 0;
+ sdesc0.has_exnra = 0;
+ sdesc0.arity = nstkarity;
sdesc0.livebits[0] = ~1;
sdesc = &sdesc0;