Closed Bug 1094154 Opened 10 years ago Closed 1 year ago

Make always-inlined self-hosted builtins not count towards the inlining depth limit

Categories

(Core :: JavaScript Engine: JIT, defect, P5)

defect

Tracking

()

RESOLVED WONTFIX

People

(Reporter: till, Unassigned, Mentored)

References

(Blocks 1 open bug)

Details

The self-hosting infrastructure allows tweaking engine-handling of functions[1]. One of the tweaks is to always inline functions. This tweak should only be used in very perf-critical cases and on small functions. In those cases, it'd be nice for the self-hosted function to not count against the inlining depth limit that IonMonkey has. Implementing this requires changing how IonMonkey handles the JSScript flag `shouldInline_`. [1] https://developer.mozilla.org/en-US/docs/Mozilla/Projects/SpiderMonkey/Internals/self-hosting#Tweaking_engine-handling_of_self-hosted_functions
Hi I would like to work on this could I get a head start ?
Excellent! Needinfo for h4writer as he probably knows most about the inlining heuristics.
Flags: needinfo?(hv1989)
Till and I had a small discussion about this topic. 1) Since posting this inlining has improved slightly. Inlining will now try to inline will make sure that most inner scripts have precedence on getting inlined vs. the most outer scripts that we have currently. This is a quite crude heuristic, but a bit the best approach we currently can manage in our system 2) We don't want to override heuristic, since that could be disastrous. Inlining too much is costly and will decrease the performance. As best we can add a flag that indicates we would like to inline this. 3) Since posting we also started inlining loops, which were the biggest source of not inlined scripts. As a result it feels like it feels like this potentially isn't a good approach for cases we maybe used to encounter, but possibly don't encounter anymore. I think we handled most important and urgent issues, but there is indeed still possibility to improve. The biggest question which examples would possible answer (and also how important it is): 1) Make our inlining heuristics global. 2) Make an optimization level with adjust heuristics (allowing deeper inlining). 3) Actually decide to make add this flag. Currently it seems that the 3rd option like described here might have the least impact or potentially totally none. I think we will need some examples where our heuristics can't get improved, while the 3rd option would be best. @Jinank: Now I suppose you don't really have anything on the above statement and you just want to see if there is something you can improve in our JS Engine. I can redirect you to bug 1144073. I added information on what should happen. Feel free to ask additional questions.
Flags: needinfo?(hv1989)
Blocks: sm-js-perf
Priority: -- → P5
Severity: normal → S3

The SetScriptHints() infrastructure for tweaking engine-handling of self-hosted functions no longer exists, so I think it's appropriate to close this.

Status: NEW → RESOLVED
Closed: 1 year ago
Resolution: --- → WONTFIX
You need to log in before you can comment on or make changes to this bug.