Closed Bug 1208067 Opened 9 years ago Closed 9 years ago

Ensure that self-hosted functions with innner functions aren't relazified

Categories

(Core :: JavaScript Engine, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla44
Tracking Status
firefox44 --- fixed

People

(Reporter: till, Assigned: till)

References

Details

Attachments

(1 file)

We don't relazifiy functions that contain other functions because we need the outer function's script when running the inner function. Without this patch, we don't know whether a self-hosted function has inner functions or not, so we erroneously relazify it even if if it does.
Comment on attachment 8665435 [details] [diff] [review] Ensure that self-hosted functions with innner functions aren't relazified Review of attachment 8665435 [details] [diff] [review]: ----------------------------------------------------------------- Drive by: This looks like what we discussed! Thanks! Surprised we can't remove some logic that used to do this based on lazyScript()->numInnerFunctions() in createScriptForLazilyInterpretedFunction(). Can we?
Attachment #8665435 - Flags: feedback+
Comment on attachment 8665435 [details] [diff] [review] Ensure that self-hosted functions with innner functions aren't relazified Review of attachment 8665435 [details] [diff] [review]: ----------------------------------------------------------------- As Eric said, we can probably remove the !lazy->numInnerFunctions() check from createScriptForLazilyInterpretedFunction. Keeping it might save some memory though because we can discard the LazyScript I think. ::: js/src/jsscript.h @@ +1490,5 @@ > + void setHasInnerFunctions(bool b) { > + hasInnerFunctions_ = b; > + } > + > + bool hasInnerFunctions() { Nit: can mark this method `const`.
Attachment #8665435 - Flags: review?(jdemooij) → review+
https://hg.mozilla.org/integration/mozilla-inbound/rev/d052f1bd09c55cac73a8df4ae14d68a7a034c6a0 Bug 1208067 - Ensure that self-hosted functions with innner functions aren't relazified. r=jandem
I didn't remove the numInnerFunctions() check because, as jandem says, keeping it saves memory, and we have to have the flag for directEval anyway.
Status: ASSIGNED → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla44
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: