aboutsummaryrefslogtreecommitdiffstats
path: root/erts/emulator/beam/beam_load.c
diff options
context:
space:
mode:
authorBjörn Gustavsson <[email protected]>2019-03-13 06:44:09 +0100
committerBjörn Gustavsson <[email protected]>2019-03-19 16:02:00 +0100
commit07bdbb3a1edc680429a43fedb0989766cb139a39 (patch)
tree2c73a28770559813c3b6f5f0cfaef9e6bd3e2369 /erts/emulator/beam/beam_load.c
parente93924e3e17bfb4cd5e59d6930aaed2496cabb22 (diff)
downloadotp-07bdbb3a1edc680429a43fedb0989766cb139a39.tar.gz
otp-07bdbb3a1edc680429a43fedb0989766cb139a39.tar.bz2
otp-07bdbb3a1edc680429a43fedb0989766cb139a39.zip
Replace swap_temp with swap more aggressively
Also support swap of Y registers.
Diffstat (limited to 'erts/emulator/beam/beam_load.c')
-rw-r--r--erts/emulator/beam/beam_load.c29
1 files changed, 29 insertions, 0 deletions
diff --git a/erts/emulator/beam/beam_load.c b/erts/emulator/beam/beam_load.c
index 42b03fc031..5961b7d743 100644
--- a/erts/emulator/beam/beam_load.c
+++ b/erts/emulator/beam/beam_load.c
@@ -3146,6 +3146,35 @@ is_killed(LoaderState* stp, GenOpArg Reg, GenOpArg Live)
}
/*
+ * Test whether register Reg is killed by make_fun instruction that
+ * creates the fun given by index idx.
+ */
+
+static int
+is_killed_by_make_fun(LoaderState* stp, GenOpArg Reg, GenOpArg idx)
+{
+ Uint num_free;
+
+ if (idx.val >= stp->num_lambdas) {
+ /* Invalid index. Ignore the error for now. */
+ return 0;
+ } else {
+ num_free = stp->lambdas[idx.val].num_free;
+ return Reg.type == TAG_x && num_free <= Reg.val;
+ }
+}
+
+/*
+ * Test whether register Reg is killed by the send instruction that follows.
+ */
+
+static int
+is_killed_by_send(LoaderState* stp, GenOpArg Reg)
+{
+ return Reg.type == TAG_x && 2 <= Reg.val;
+}
+
+/*
* Generate an instruction for element/2.
*/