Closed Bug 820084 Opened 12 years ago Closed 12 years ago

IonMonkey: fix handling of "thisv" value when top-level script is entered into via enterJIT

Categories

(Core :: JavaScript Engine, defect)

17 Branch
x86
macOS
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla20

People

(Reporter: djvj, Unassigned)

References

Details

Attachments

(1 file)

Ion's enterJIT assumes that the |argv| value it's passed will be negative addressable (at offset -1) to access the |thisv| value for the call.

This is not true for top-level scripts, where |argv| seems to be an independent array of only the arguments, as opposed to a pointer to the third value of a |vp| array, as is usually the case.

enterJIT should be modified to handle this case by explicitly pushing the proper global this-object for when entering ionCode for top-level scripts.
Revision: problem statement above is slightly off.  Top-level scripts never have arguments, so |argv| isn't an issue.  We just need to pass in an appropriate this-included args array and argc=1 to enterJIT when we're calling into a top-level script from the interpreter.
Attached patch FixSplinter Review
Passes all jit-tests.
Attachment #690547 - Flags: review?(sstangl)
Attachment #690547 - Flags: review?(sstangl) → review+
https://hg.mozilla.org/mozilla-central/rev/86236b3e0b1f
Status: NEW → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla20
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: