diff options
author | Björn Gustavsson <[email protected]> | 2010-12-07 11:09:51 +0100 |
---|---|---|
committer | Björn Gustavsson <[email protected]> | 2011-01-17 15:23:44 +0100 |
commit | ec2fcc7aefec2f4ede4f789098f5093cd2fe00b2 (patch) | |
tree | cca9212cae6db096e2481105016e95d4c135d87e /erts/emulator/beam/beam_emu.c | |
parent | 2233398336a35c7160e82efa8ee218a4277739cf (diff) | |
download | otp-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_emu.c')
-rw-r--r-- | erts/emulator/beam/beam_emu.c | 42 |
1 files changed, 25 insertions, 17 deletions
diff --git a/erts/emulator/beam/beam_emu.c b/erts/emulator/beam/beam_emu.c index 1b9fc86871..bdc730e6c1 100644 --- a/erts/emulator/beam/beam_emu.c +++ b/erts/emulator/beam/beam_emu.c @@ -1492,24 +1492,32 @@ void process_main(void) c_p->freason = BADARG; goto lb_Cl_error; - OpCase(i_fast_element_jIsd): { - Eterm tuple; - - /* - * Inlined version of element/2 for even more speed. - * The first argument is an untagged integer >= 1. - * The second argument is guaranteed to be a register operand. - */ - GetArg1(2, tuple); - if (is_tuple(tuple)) { - Eterm* tp = tuple_val(tuple); - Eterm pos = Arg(1); - if (pos <= arityval(*tp)) { - Eterm result = tp[pos]; - StoreBifResult(3, result); - } - } + { + Eterm fast_element_tuple; + + OpCase(i_fast_element_rjId): + fast_element_tuple = r(0); + + do_fast_element: + if (is_tuple(fast_element_tuple)) { + Eterm* tp = tuple_val(fast_element_tuple); + Eterm pos = Arg(1); /* Untagged integer >= 1 */ + if (pos <= arityval(*tp)) { + Eterm result = tp[pos]; + StoreBifResult(2, result); + } + } goto badarg; + + OpCase(i_fast_element_xjId): + fast_element_tuple = xb(Arg(0)); + I++; + goto do_fast_element; + + OpCase(i_fast_element_yjId): + fast_element_tuple = yb(Arg(0)); + I++; + goto do_fast_element; } OpCase(catch_yf): |