diff options
author | Björn-Egil Dahlberg <[email protected]> | 2015-03-12 10:48:41 +0100 |
---|---|---|
committer | Björn-Egil Dahlberg <[email protected]> | 2015-03-12 10:48:41 +0100 |
commit | 43db415c05c20c1d0793ec994da265f02dc73e21 (patch) | |
tree | da8dd976ea25af8b379460dfcbb290cb8cfdafe7 /erts/emulator/beam/beam_debug.c | |
parent | 900276a573ea67039670a71c379f64ac938a4516 (diff) | |
parent | b9a8cebcc30ee1bce8e6b57041bf07cf84630386 (diff) | |
download | otp-43db415c05c20c1d0793ec994da265f02dc73e21.tar.gz otp-43db415c05c20c1d0793ec994da265f02dc73e21.tar.bz2 otp-43db415c05c20c1d0793ec994da265f02dc73e21.zip |
Merge branch 'egil/beam/select_val/OTP-12555'
* egil/beam/select_val/OTP-12555:
erts: Use linear search for small select_val arrays
Diffstat (limited to 'erts/emulator/beam/beam_debug.c')
-rw-r--r-- | erts/emulator/beam/beam_debug.c | 42 |
1 files changed, 34 insertions, 8 deletions
diff --git a/erts/emulator/beam/beam_debug.c b/erts/emulator/beam/beam_debug.c index a3cd08834f..6bb987985d 100644 --- a/erts/emulator/beam/beam_debug.c +++ b/erts/emulator/beam/beam_debug.c @@ -579,9 +579,29 @@ 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_rfI: - case op_i_select_val_xfI: - case op_i_select_val_yfI: + case op_i_select_val_lins_rfI: + case op_i_select_val_lins_xfI: + case op_i_select_val_lins_yfI: + { + int n = ap[-1]; + int ix = n; + + while (ix--) { + erts_print(to, to_arg, "%T ", (Eterm) ap[0]); + ap++; + size++; + } + ix = n; + while (ix--) { + erts_print(to, to_arg, "f(" HEXF ") ", (Eterm) ap[0]); + ap++; + size++; + } + } + break; + case op_i_select_val_bins_rfI: + case op_i_select_val_bins_xfI: + case op_i_select_val_bins_yfI: { int n = ap[-1]; @@ -598,13 +618,19 @@ print_op(int to, void *to_arg, int op, int size, BeamInstr* addr) case op_i_select_tuple_arity_yfI: { int n = ap[-1]; + int ix = n; - while (n > 0) { + while (ix--) { Uint arity = arityval(ap[0]); - erts_print(to, to_arg, " {%d} f(" HEXF ")", arity, ap[1]); - ap += 2; - size += 2; - n--; + erts_print(to, to_arg, "{%d} ", arity, ap[1]); + ap++; + size++; + } + ix = n; + while (ix--) { + erts_print(to, to_arg, "f(" HEXF ") ", ap[0]); + ap++; + size++; } } break; |