aboutsummaryrefslogtreecommitdiffstats
path: root/erts/emulator/beam/beam_debug.c
diff options
context:
space:
mode:
authorBjörn Gustavsson <[email protected]>2010-11-19 16:46:58 +0100
committerBjörn Gustavsson <[email protected]>2011-01-17 15:23:43 +0100
commit55eef00e9e0331bddd277194509c6094e8306211 (patch)
tree32ce2794284c3a15fa0a3b2a9dc8e6514a64fa86 /erts/emulator/beam/beam_debug.c
parenta24830ce9db4325b51af56262094bb1d32ef4e2b (diff)
downloadotp-55eef00e9e0331bddd277194509c6094e8306211.tar.gz
otp-55eef00e9e0331bddd277194509c6094e8306211.tar.bz2
otp-55eef00e9e0331bddd277194509c6094e8306211.zip
Eliminate use of GetArg1() in the select_val instruction
Instead of having one i_select_val_sfI instruction that uses the GetArg1() macro to fetch the controlling expression, use three separate instructions for each of the register types. That will save one word when selecting on the {x,0} register. It should also be slightly faster since a conditional branch is eliminated. Although it seems that the BEAM compiler will never generate a constant controlling expression (even with optimizations turned off), we still make sure that they will work by evaluating the select_val instruction at load time. Handle the select_tuple_arity instruction in the same way.
Diffstat (limited to 'erts/emulator/beam/beam_debug.c')
-rw-r--r--erts/emulator/beam/beam_debug.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/erts/emulator/beam/beam_debug.c b/erts/emulator/beam/beam_debug.c
index 6c16c24d0d..46b831fa88 100644
--- a/erts/emulator/beam/beam_debug.c
+++ b/erts/emulator/beam/beam_debug.c
@@ -555,7 +555,9 @@ print_op(int to, void *to_arg, int op, int size, BeamInstr* addr)
unpacked = ap;
ap = addr + size;
switch (op) {
- case op_i_select_val_sfI:
+ case op_i_select_val_rfI:
+ case op_i_select_val_xfI:
+ case op_i_select_val_yfI:
{
int n = ap[-1];
@@ -567,7 +569,9 @@ print_op(int to, void *to_arg, int op, int size, BeamInstr* addr)
}
}
break;
- case op_i_select_tuple_arity_sfI:
+ case op_i_select_tuple_arity_rfI:
+ case op_i_select_tuple_arity_xfI:
+ case op_i_select_tuple_arity_yfI:
{
int n = ap[-1];