diff options
author | Björn Gustavsson <[email protected]> | 2018-01-24 12:33:32 +0100 |
---|---|---|
committer | GitHub <[email protected]> | 2018-01-24 12:33:32 +0100 |
commit | 4571e13801c53e1c2bbf744ab178a4a0f9f0a7cd (patch) | |
tree | b0f72307cfeb11a886820845e07f0c67d870b9dc /erts/emulator/beam | |
parent | 8e66754dac8963a6631c850b1eb63b27408259a2 (diff) | |
parent | 9b0122b65bdcafbae2a3cfd3299903da0948acab (diff) | |
download | otp-4571e13801c53e1c2bbf744ab178a4a0f9f0a7cd.tar.gz otp-4571e13801c53e1c2bbf744ab178a4a0f9f0a7cd.tar.bz2 otp-4571e13801c53e1c2bbf744ab178a4a0f9f0a7cd.zip |
Merge pull request #1682 from bjorng/bjorn/optimize-unbuilt-stacktrace
Don't build a stacktrace if it's only passed to erlang:raise/3
Diffstat (limited to 'erts/emulator/beam')
-rw-r--r-- | erts/emulator/beam/instrs.tab | 25 | ||||
-rw-r--r-- | erts/emulator/beam/ops.tab | 1 |
2 files changed, 26 insertions, 0 deletions
diff --git a/erts/emulator/beam/instrs.tab b/erts/emulator/beam/instrs.tab index b92152238e..f19027b1ec 100644 --- a/erts/emulator/beam/instrs.tab +++ b/erts/emulator/beam/instrs.tab @@ -936,3 +936,28 @@ build_stacktrace() { x(0) = build_stacktrace(c_p, x(0)); SWAPIN; } + +raw_raise() { + Eterm class = x(0); + Eterm value = x(1); + Eterm stacktrace = x(2); + + if (class == am_error) { + c_p->freason = EXC_ERROR & ~EXF_SAVETRACE; + c_p->fvalue = value; + c_p->ftrace = stacktrace; + goto find_func_info; + } else if (class == am_exit) { + c_p->freason = EXC_EXIT & ~EXF_SAVETRACE; + c_p->fvalue = value; + c_p->ftrace = stacktrace; + goto find_func_info; + } else if (class == am_throw) { + c_p->freason = EXC_THROWN & ~EXF_SAVETRACE; + c_p->fvalue = value; + c_p->ftrace = stacktrace; + goto find_func_info; + } else { + x(0) = am_badarg; + } +} diff --git a/erts/emulator/beam/ops.tab b/erts/emulator/beam/ops.tab index fd1b3b9c74..1f4a8eadb0 100644 --- a/erts/emulator/beam/ops.tab +++ b/erts/emulator/beam/ops.tab @@ -1584,3 +1584,4 @@ i_recv_set # build_stacktrace +raw_raise |