Closed Bug 594455 Opened 14 years ago Closed 14 years ago

[meta] DefaultCompartment fixes

Categories

(Core :: JavaScript Engine, defect)

x86
macOS
defect
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: gwagner, Assigned: gwagner)

References

Details

Attachments

(2 files, 3 obsolete files)

      No description provided.
Attached patch patch (obsolete) — Splinter Review
Asserting at the API boundary that we don't enter with the defaultCompartment.
Gregor, I think the assertion in JS_IsAboutToBeCollected is bogus. Please rip that out and later today I'll remove any JSAutoCrossCompartmentCalls we've added in GC callbacks.
Hope everyone agrees this isn't a productive thing to be doing.
Attachment #474146 - Flags: review?(gal)
Attachment #474146 - Flags: review?(gal) → review+
Depends on: 599761
Depends on: 599762
Depends on: 600032
Depends on: 600022
Attached patch Asserts in API functions (obsolete) — Splinter Review
refresh of api asserts:
JS_ASSERT(cx->compartment != cx->runtime->defaultCompartment);
I pass now all the xpcshell tests on my machine (Mac) with all the various defaultCompartment fixes. 
Tryserver for windows and linux indicates another mixup in 
TEST-INFO | e:\builds\moz2_slave\tryserver-win32-debug-unittest-xpcshell\build\xpcshell\tests\chrome\test\unit_ipc\test_resolve_uris_ipc.js |

It looks like the last one :)
file it, I can fix
Depends on: 600580
I pushed the API assertion patch to tryserver and I don't see assertions any more.

Looks like we fixed all defaultCompartment mixups that are covered by the testcases!
Attached patch patchSplinter Review
Maybe we should land some assertions in jsapi for the future.
Attachment #473176 - Attachment is obsolete: true
Attachment #474146 - Attachment is obsolete: true
Attachment #478934 - Attachment is obsolete: true
Attachment #479972 - Flags: review?(jorendorff)
Assignee: general → anygregor
Comment on attachment 479972 [details] [diff] [review]
patch

The original idea was that non-JS_THREADSAFE embeddings could ignore compartments entirely and use the default compartment for everything. That way we only break JS_THREADSAFE embedders.

If you think that would work, please make the asserts JS_THREADSAFE-only.  (I think all JS_THREADSAFE embeddings will want to avoid the default compartment for the same reasons we do.)

r=me with that.
Attachment #479972 - Flags: review?(jorendorff) → review+
Attached patch patchSplinter Review
Something like this with JS_THREADSAFE_ASSERT?
http://hg.mozilla.org/mozilla-central/rev/1283831c28bf
Status: NEW → RESOLVED
Closed: 14 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: