Closed Bug 1135428 Opened 10 years ago Closed 9 years ago

OdinMonkey: remove compileAndGo restriction

Categories

(Core :: JavaScript Engine, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla39
Tracking Status
firefox39 --- fixed

People

(Reporter: luke, Assigned: luke)

References

Details

Attachments

(1 file)

IIUC, JS::CloneFunctionObject is only used for XBL, not any content-visible scripts; is that right bz (due to all the with-wrapped scope chain work)?

Currently JS::CloneFunctionObject on asm.js throws a dynamic error, so we disabled Odin on !compileAndGo (a precondition for calling CloneFunctionObject) back when content was cloneable, but now that it's not, I think we can simply remove this restriction.
So the situation in Gecko right now is that CloneFunctionObject is only used for XBL methods/getters/setter/eventhandlers.

These are not "content" in the sense of being available on the web, but they can appear in extensions obviously.

That said, the JSFunctions involved are just created via JS::CompileFunction, so would they ever be asm.js functions anyway?
(In reply to Boris Zbarsky [:bz] from comment #1)
> These are not "content" in the sense of being available on the web, but they
> can appear in extensions obviously.

Right, we wouldn't crash, just throw a safe exception.  If anyone really needed this feature, we could actually add cloning support w/o too much work since we already have the raw functionality to clone an AsmJSModule.

> That said, the JSFunctions involved are just created via
> JS::CompileFunction, so would they ever be asm.js functions anyway?

Yep, asm.js can appear at top-level in a CompileFunction call or nested anywhere inside.
OK.

I think it's not a problem if things that try to use asm.js in xbl get exceptions, especially if we have AMO check for that.  I can't think of any cases when it would be reasonable to use asm in XBL stuff.
Related to bug 679939 ?
Looks like we already have tests for the attempted-cross-compartment-clone case and the same-compartment-clone case.
Attachment #8578263 - Flags: review?(benj)
(In reply to David Bruant from comment #4)
> Related to bug 679939 ?

Yeah, this removes a remaining use.
Blocks: 679939
Comment on attachment 8578263 [details] [diff] [review]
rm-compile-and-go-limit

Review of attachment 8578263 [details] [diff] [review]:
-----------------------------------------------------------------

Cool.
Attachment #8578263 - Flags: review?(benj) → review+
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: