scala-dev icon indicating copy to clipboard operation
scala-dev copied to clipboard

Re-implement exception handler inlining in the new optimizer

Open lrytz opened this issue 9 years ago • 2 comments

The old optimizer inlined exception handlers if a throw throws an exception that is caught in the same method. According to @VladUreche, this is mainly to support two use-cases:

  • breakable { ...; break; ... }
  • return statements

https://github.com/scala/scala/blob/2.11.x/src/compiler/scala/tools/nsc/backend/opt/InlineExceptionHandlers.scala

lrytz avatar Nov 06 '15 11:11 lrytz

:+1: to ASM-level inline exception handlers

VladUreche avatar Nov 06 '15 12:11 VladUreche

Existing test currently in pending: https://github.com/scala/scala/blob/93fa559f62637fc3a49d7b961a1d07cf843b0e6b/test/pending/run/inline-ex-handlers.scala

lrytz avatar Nov 09 '15 08:11 lrytz