aboutsummaryrefslogtreecommitdiffstats
path: root/erts/emulator/beam/macros.tab
diff options
context:
space:
mode:
authorBjörn Gustavsson <[email protected]>2017-09-14 10:16:34 +0200
committerBjörn Gustavsson <[email protected]>2017-09-14 10:16:34 +0200
commitddaed7774eb0a3bbaf6ee40153d2b082181a1223 (patch)
treedd853038c6099cb70722ba43c28a5e2c0ef964ab /erts/emulator/beam/macros.tab
parent2e8d9a446ef77391ae7faf6ee321479f6af5a92b (diff)
parente8ee9f4cba07c7aa05685207c54ae1d773bf1814 (diff)
downloadotp-ddaed7774eb0a3bbaf6ee40153d2b082181a1223.tar.gz
otp-ddaed7774eb0a3bbaf6ee40153d2b082181a1223.tar.bz2
otp-ddaed7774eb0a3bbaf6ee40153d2b082181a1223.zip
Merge branch 'bjorn/erts/relative-jumps'
* bjorn/erts/relative-jumps: Pack failure labels in i_select_val2 and i_select_tuple_arity2 Optimize i_select_tuple_arity2 and is_select_lins Rewrite select_val_bins so that its labels can be packed Pack sequences of trailing 'f' operands Implement packing of 'f' and 'j' Make sure that mask literals are 64 bits Use relative failure labels Add information about offset to common group start position Remove JUMP_OFFSET Refactor instructions to support relative jumps Introduce a new trace_jump/1 instruction for tracing Avoid using $Src more than once
Diffstat (limited to 'erts/emulator/beam/macros.tab')
-rw-r--r--erts/emulator/beam/macros.tab19
1 files changed, 17 insertions, 2 deletions
diff --git a/erts/emulator/beam/macros.tab b/erts/emulator/beam/macros.tab
index 35bbc92fea..6f9b78af6f 100644
--- a/erts/emulator/beam/macros.tab
+++ b/erts/emulator/beam/macros.tab
@@ -28,15 +28,30 @@ REFRESH_GEN_DEST() {
dst_ptr = REG_TARGET_PTR(dst);
}
+SET_I_REL(Offset) {
+ ASSERT(VALID_INSTR(*(I + ($Offset))));
+ I += $Offset;
+}
+
+SET_CP_I_ABS(Target) {
+ c_p->i = $Target;
+ ASSERT(VALID_INSTR(*c_p->i));
+}
+
+SET_REL_I(Dst, Offset) {
+ $Dst = I + ($Offset);
+ ASSERT(VALID_INSTR(*$Dst));
+}
+
FAIL(Fail) {
//| -no_prefetch
- SET_I((BeamInstr *) $Fail);
+ $SET_I_REL($Fail);
Goto(*I);
}
JUMP(Fail) {
//| -no_next
- SET_I((BeamInstr *) $Fail);
+ $SET_I_REL($Fail);
Goto(*I);
}