aboutsummaryrefslogtreecommitdiffstats
path: root/erts/emulator/beam/beam_emu.c
diff options
context:
space:
mode:
authorBjörn Gustavsson <[email protected]>2010-12-09 20:57:27 +0100
committerBjörn Gustavsson <[email protected]>2011-01-17 15:23:44 +0100
commit5cf1e739a5599943c1ac1d40d0577f83f5e0e62b (patch)
tree8d783ae37a1a4da872a6093d6f670b98d071cbdc /erts/emulator/beam/beam_emu.c
parent3694076f5a68cc78e9ccd6c67651bc0f761fc94f (diff)
downloadotp-5cf1e739a5599943c1ac1d40d0577f83f5e0e62b.tar.gz
otp-5cf1e739a5599943c1ac1d40d0577f83f5e0e62b.tar.bz2
otp-5cf1e739a5599943c1ac1d40d0577f83f5e0e62b.zip
Eliminate use of GetArg1() in the badmatch and case_end instructions
Create separate instructions for each register type. The "badmatch x(0)" and "case_end x(0)" (which are very common) will only require a single word each, compared to two words when GetArg1() is used.
Diffstat (limited to 'erts/emulator/beam/beam_emu.c')
-rw-r--r--erts/emulator/beam/beam_emu.c30
1 files changed, 26 insertions, 4 deletions
diff --git a/erts/emulator/beam/beam_emu.c b/erts/emulator/beam/beam_emu.c
index fdb7d86c78..ea813ef09f 100644
--- a/erts/emulator/beam/beam_emu.c
+++ b/erts/emulator/beam/beam_emu.c
@@ -3040,10 +3040,21 @@ void process_main(void)
goto find_func_info;
}
- OpCase(badmatch_s): {
+ {
Eterm badmatch_val;
- GetArg1(0, badmatch_val);
+ OpCase(badmatch_y):
+ badmatch_val = yb(Arg(0));
+ goto do_badmatch;
+
+ OpCase(badmatch_x):
+ badmatch_val = xb(Arg(0));
+ goto do_badmatch;
+
+ OpCase(badmatch_r):
+ badmatch_val = r(0);
+
+ do_badmatch:
c_p->fvalue = badmatch_val;
c_p->freason = BADMATCH;
}
@@ -3244,11 +3255,22 @@ void process_main(void)
StoreBifResult(1, result);
}
- OpCase(case_end_s):
{
Eterm case_end_val;
- GetArg1(0, case_end_val);
+ OpCase(case_end_x):
+ case_end_val = xb(Arg(0));
+ goto do_case_end;
+
+ OpCase(case_end_y):
+ case_end_val = yb(Arg(0));
+ goto do_case_end;
+
+ OpCase(case_end_r):
+ case_end_val = r(0);
+ I--;
+
+ do_case_end:
c_p->fvalue = case_end_val;
c_p->freason = EXC_CASE_CLAUSE;
goto find_func_info;