Closed Bug 841621 Opened 11 years ago Closed 11 years ago

Add inline script hint for self-hosted functions

Categories

(Core :: JavaScript Engine, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla25

People

(Reporter: shu, Assigned: shu)

References

Details

Attachments

(1 file, 1 obsolete file)

It is useful to have the ability to mark self-hosted functions as 'inline' so that when jitting them we ignore the normal heuristics.
Assignee: general → shu
I'm not sure this is a good thing to have.  We should beef up our normal heuristics to be more robust against patterns like our self-hosted scripts use, not add backdoors usable only by self-hosted things.
(In reply to Jeff Walden [:Waldo] (remove +bmo to email) from comment #1)
> I'm not sure this is a good thing to have.  We should beef up our normal
> heuristics to be more robust against patterns like our self-hosted scripts
> use, not add backdoors usable only by self-hosted things.

Adding more aggressive inlining heuristics for ParallelArray code is also an option (perhaps more preferred), though I'm not quite seeing the problem with adding backdoors for self-hosted code. To me that's a nice freedom self-hosted code allows -- we already have unsafe backdoors for ParallelArrays, and what I'm proposing here is just a hint.
I see "freedom" and read "backdoor that sites can't put to their own use".  :-)  If some function in self-hosted code is short enough or hot enough that it should be inlined, it shouldn't just be inlined because it existed in self-hosted code and someone recognized and annotated that particular instance.
My take on this is that Waldo is correct in principle, but in practice there isn't a "one-size-fits-all" heuristic that will always get the right answer, and there will always be a need for hints.
I asked dvander about this on IRC and he wrote:

[12:00:48] <dvander> nmatsakis, improving inline heuristics is also very twitchy and complicated
[12:01:20] <dvander> nmatsakis, we have hints in C++, it makes sense to have those hints for self-hosted code as well IMO. it doesn't have to be something we expose to the web
Attached patch Add inline hint. (obsolete) — Splinter Review
Attachment #756718 - Flags: review?(dvander)
Attachment #756718 - Flags: review?(dvander) → review+
Attached patch Add inline hint.Splinter Review
Carrying over r+ from dvander.
Attachment #756718 - Attachment is obsolete: true
Attachment #774145 - Flags: review+
https://hg.mozilla.org/mozilla-central/rev/8ef0e9fa1f16
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla25
Depends on: 916761
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: