aboutsummaryrefslogtreecommitdiffstats
path: root/erts/emulator/beam/beam_load.c
diff options
context:
space:
mode:
authorBjörn Gustavsson <[email protected]>2010-12-07 11:09:51 +0100
committerBjörn Gustavsson <[email protected]>2011-01-17 15:23:44 +0100
commitec2fcc7aefec2f4ede4f789098f5093cd2fe00b2 (patch)
treecca9212cae6db096e2481105016e95d4c135d87e /erts/emulator/beam/beam_load.c
parent2233398336a35c7160e82efa8ee218a4277739cf (diff)
downloadotp-ec2fcc7aefec2f4ede4f789098f5093cd2fe00b2.tar.gz
otp-ec2fcc7aefec2f4ede4f789098f5093cd2fe00b2.tar.bz2
otp-ec2fcc7aefec2f4ede4f789098f5093cd2fe00b2.zip
Eliminate use of GetArg1() in the fast_element instruction
Use separate instructions for each register type.
Diffstat (limited to 'erts/emulator/beam/beam_load.c')
-rw-r--r--erts/emulator/beam/beam_load.c22
1 files changed, 11 insertions, 11 deletions
diff --git a/erts/emulator/beam/beam_load.c b/erts/emulator/beam/beam_load.c
index 54c8ad0eb1..4233e26f54 100644
--- a/erts/emulator/beam/beam_load.c
+++ b/erts/emulator/beam/beam_load.c
@@ -2308,23 +2308,23 @@ gen_element(LoaderState* stp, GenOpArg Fail, GenOpArg Index,
GenOp* op;
NEW_GENOP(stp, op);
- op->op = genop_i_element_4;
op->arity = 4;
- op->a[0] = Fail;
- op->a[1] = Index;
- op->a[2] = Tuple;
- op->a[3] = Dst;
op->next = NULL;
- /*
- * If safe, generate a faster instruction.
- */
-
if (Index.type == TAG_i && Index.val > 0 &&
(Tuple.type == TAG_r || Tuple.type == TAG_x || Tuple.type == TAG_y)) {
op->op = genop_i_fast_element_4;
- op->a[1].type = TAG_u;
- op->a[1].val = Index.val;
+ op->a[0] = Tuple;
+ op->a[1] = Fail;
+ op->a[2].type = TAG_u;
+ op->a[2].val = Index.val;
+ op->a[3] = Dst;
+ } else {
+ op->op = genop_i_element_4;
+ op->a[0] = Fail;
+ op->a[1] = Index;
+ op->a[2] = Tuple;
+ op->a[3] = Dst;
}
return op;