aboutsummaryrefslogtreecommitdiffstats
path: root/lib/compiler/src/compile.erl
diff options
context:
space:
mode:
authorBjörn Gustavsson <[email protected]>2011-12-21 07:41:48 +0100
committerBjörn Gustavsson <[email protected]>2012-01-04 10:50:25 +0100
commit726f6e4c7afe8ce37b30eedbebe583e7b9bfc51b (patch)
tree2788e5963b2f34b29c3b21f4a0a8775f68563663 /lib/compiler/src/compile.erl
parent53bd4974a1012669fb7db09815fabac01b586c12 (diff)
downloadotp-726f6e4c7afe8ce37b30eedbebe583e7b9bfc51b.tar.gz
otp-726f6e4c7afe8ce37b30eedbebe583e7b9bfc51b.tar.bz2
otp-726f6e4c7afe8ce37b30eedbebe583e7b9bfc51b.zip
Add the beam_except pass to optimize exceptions
In order to save space, rewrite suitable calls to erlang:error/{1,2} to special BEAM instructions. This code is probably longer than the code taken out of v3_life and v3_codegen in the previous commit, but it is much easier to understand and maintain since the BEAM assembler format is better understood than the v3_life format.
Diffstat (limited to 'lib/compiler/src/compile.erl')
-rw-r--r--lib/compiler/src/compile.erl2
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/compiler/src/compile.erl b/lib/compiler/src/compile.erl
index a17a10046e..9b505ad15c 100644
--- a/lib/compiler/src/compile.erl
+++ b/lib/compiler/src/compile.erl
@@ -629,6 +629,8 @@ asm_passes() ->
[{unless,no_postopt,
[{pass,beam_block},
{iff,dblk,{listing,"block"}},
+ {unless,no_except,{pass,beam_except}},
+ {iff,dexcept,{listing,"except"}},
{unless,no_bopt,{pass,beam_bool}},
{iff,dbool,{listing,"bool"}},
{unless,no_topt,{pass,beam_type}},