aboutsummaryrefslogtreecommitdiffstats
path: root/lib/compiler/src/beam_ssa.erl
diff options
context:
space:
mode:
authorJohn Högberg <[email protected]>2019-06-25 12:56:24 +0200
committerJohn Högberg <[email protected]>2019-07-05 11:33:38 +0200
commit02c74c89232ed72f16c2a326e0c15938c3493041 (patch)
tree31d7c9db862cccd7750cc5b91abe4bed3ddb5ecd /lib/compiler/src/beam_ssa.erl
parent1e4e506b5c3af02632da29b0802e913121403bf4 (diff)
downloadotp-02c74c89232ed72f16c2a326e0c15938c3493041.tar.gz
otp-02c74c89232ed72f16c2a326e0c15938c3493041.tar.bz2
otp-02c74c89232ed72f16c2a326e0c15938c3493041.zip
compiler: Introduce exception trampolines
When the compiler is smart enough to figure out that something will always succeed, it will get rid of the failure branch, but the inverse has not been possible because liveness optimization could end up removing the instruction altogether (since it's never used on the failure path), which is not okay when exceptions are in the picture. To prevent exception-generating instructions from being optimized away when their branches are, we introduce a dummy instruction that refers to the result on the failure path, ensuring that it won't be optimized away.
Diffstat (limited to 'lib/compiler/src/beam_ssa.erl')
-rw-r--r--lib/compiler/src/beam_ssa.erl2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/compiler/src/beam_ssa.erl b/lib/compiler/src/beam_ssa.erl
index 7a766623b0..f46cca1431 100644
--- a/lib/compiler/src/beam_ssa.erl
+++ b/lib/compiler/src/beam_ssa.erl
@@ -101,7 +101,7 @@
'bs_match' | 'bs_put' | 'bs_start_match' | 'bs_test_tail' |
'bs_utf16_size' | 'bs_utf8_size' | 'build_stacktrace' |
'call' | 'catch_end' |
- 'extract' |
+ 'extract' | 'exception_trampoline' |
'get_hd' | 'get_map_element' | 'get_tl' | 'get_tuple_element' |
'has_map_field' |
'is_nonempty_list' | 'is_tagged_tuple' |