aboutsummaryrefslogtreecommitdiffstats
path: root/erts/emulator/beam/ops.tab
diff options
context:
space:
mode:
authorBjörn Gustavsson <[email protected]>2016-04-11 13:45:08 +0200
committerBjörn Gustavsson <[email protected]>2016-04-11 13:45:08 +0200
commit9d2dde09689246cd61a5e7bfdc8ca37884043a9c (patch)
tree28103683a37e38c5ba4c5e1313ef8c952f3d8fb9 /erts/emulator/beam/ops.tab
parent01ac0d2cb316b97834eb1dbbe4a86d2a6be84f04 (diff)
parentab03678e87732407625150c202e177a85a025beb (diff)
downloadotp-9d2dde09689246cd61a5e7bfdc8ca37884043a9c.tar.gz
otp-9d2dde09689246cd61a5e7bfdc8ca37884043a9c.tar.bz2
otp-9d2dde09689246cd61a5e7bfdc8ca37884043a9c.zip
Merge branch 'bjorn/raise'
* bjorn/raise: Remove unreachable code after 'raise' instructions Simplify the raise instruction to reduce code size
Diffstat (limited to 'erts/emulator/beam/ops.tab')
-rw-r--r--erts/emulator/beam/ops.tab9
1 files changed, 8 insertions, 1 deletions
diff --git a/erts/emulator/beam/ops.tab b/erts/emulator/beam/ops.tab
index 15f27835a8..96a3a72bb5 100644
--- a/erts/emulator/beam/ops.tab
+++ b/erts/emulator/beam/ops.tab
@@ -251,7 +251,14 @@ case_end x
badmatch x
if_end
-raise s s
+
+# Operands for raise/2 are almost always in x(2) and x(1).
+# Optimize for that case.
+raise x==2 x==1 => i_raise
+raise Trace=y Value=y => move Trace x=2 | move Value x=1 | i_raise
+raise Trace Value => move Trace x=3 | move Value x=1 | move x=3 x=2 | i_raise
+
+i_raise
# Internal now, but could be useful to make known to the compiler.
badarg j