Don't drop into the interpreter for functions containing finally blocks

RESOLVED DUPLICATE of bug 627857

Status

()

RESOLVED DUPLICATE of bug 627857
6 years ago
6 years ago

People

(Reporter: kael, Unassigned)

Tracking

16 Branch
x86_64
Windows 7
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

(URL)

(Reporter)

Description

6 years ago
Currently, if a JS function contains a finally block the entire function runs in the interpreter in SM. This is pretty bad for code that uses finally because the only way to observe and understand the performance penalty is by digging around in SPS profiles.

Ideally, finally blocks wouldn't cause functions to be interpreted, even if the resulting jitted code is not as efficient due to the consequences try/finally has for the optimizer.

If that's not possible, it would be great to at least come up with some sort of hybrid approach where only the body of the try {} finally {} has to be interpreted, instead of the entire function containing it.

If it's not possible to fix this at all, please surface the deopt to users somehow.

This is increasingly important as Google is pushing use of the disposable pattern and basically the only way to implement that pattern correctly is with try/finally. V8 devs have claimed that they plan to implement optimization for try/finally in the future so they clearly expect it to get more use in the future.
Thank you for reporting all these bugs. One small problem though, you have a very high noise ratio, and it's sometimes not clear what is important and what is not.
Status: NEW → RESOLVED
Last Resolved: 6 years ago
Resolution: --- → DUPLICATE
Duplicate of bug: 627857
(Reporter)

Comment 2

6 years ago
What do you mean? All of the bugs I filed today were filed on luke's suggestion. Do you need clearer reproduction steps or test cases or something?

Sorry for the dupe on this one, when I searched for 'finally' 627857 wasn't on the first page of results.

Comment 3

6 years ago
(In reply to Tom Schuster [:evilpie] from comment #1)
> you have a very high noise ratio, and it's sometimes not clear what is important and
> what is not.

I'm not sure what is noise here; all these bugs come up in the context of real usage (jsil.org).  I'm seeing the same perf issues arise in other game projects as well so we should be thankful they are being diagnosed and reported.
Sorry, didn't want to come across like an jackass, just because I have problems understanding your point. I understand that this hurting you.

Won't happen again, I think  oh and don't worry about the duping, this stuff is usually nearly impossible to find unless you know it exists.
(Reporter)

Comment 5

6 years ago
Oh, I see. When I read 'noise' I thought you meant too many reports! If you're having trouble understanding the test cases/reports please feel free to reach out and I can elaborate or provide more detailed examples.
You need to log in before you can comment on or make changes to this bug.