Closed Bug 402898 Opened 18 years ago Closed 18 years ago

JS_YieldRequest doesn't do scope-sharing

Categories

(Core :: JavaScript Engine, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla1.9beta4

People

(Reporter: jorendorff, Assigned: jorendorff)

References

Details

Attachments

(1 file)

JS_YieldRequest doesn't check rt->scopeSharingTodo the way JS_EndRequest and JS_SuspendRequest do. This means that while JS_YieldRequest yields to GC, it doesn't yield up objects to other threads that need them. I think it should. Cc-ing shaver in case he remembers the rationale for how this behaves.
I am a simple caveman, your scope-sharing ways frighten and confuse me.
Attached patch v1Splinter Review
OK, the attached patch fixes this bug, but I'm uneasy about something. I don't think this comment in jscntxt.h is correct: /* Same as requestDepth but ignoring JS_SuspendRequest/JS_ResumeRequest */ jsrefcount outstandingRequests; To me it looks like JS_SuspendRequest and JS_ResumeRequest do modify outstandingRequests. This field was introduced in bug 401687. See comment 21 and 23. The use is in xpconnect. Igor, can you help me understand this?
Assignee: general → jorendorff
Status: NEW → ASSIGNED
Maybe peterv can help.
(In reply to comment #2) > To me it looks like JS_SuspendRequest and JS_ResumeRequest do modify > outstandingRequests. That does look wrong, I went with what Igor told me but should have looked closer.
OK. I would like to get this checked in, but allowing the bug in JS_{Suspend,Resume}Request to propagate to JS_YieldRequest is technically a regression. I'll file a separate bug for the suspend/resume issue.
Blocks: 404879
Depends on: 416470
Attachment #301109 - Flags: review?(brendan)
The suspend/resume issue is bug 416470; patch is attached there. After that patch, this one is (I think) ready to roll.
Attachment #301109 - Attachment description: v1 - apply after the patch in bug 412985 → v1
Comment on attachment 301109 [details] [diff] [review] v1 Neat, sweet, petite! /be
Attachment #301109 - Flags: review?(brendan)
Attachment #301109 - Flags: review+
Attachment #301109 - Flags: approval1.9+
Keywords: checkin-needed
Checking in js/src/jsapi.c; /cvsroot/mozilla/js/src/jsapi.c,v <-- jsapi.c new revision: 3.408; previous revision: 3.407 done
Status: ASSIGNED → RESOLVED
Closed: 18 years ago
Keywords: checkin-needed
Resolution: --- → FIXED
Target Milestone: --- → mozilla1.9beta4
Flags: in-testsuite-
Flags: in-litmus-
(bc marked this "not in testsuite".) This has some test coverage, although not a dedicated test. Without this fix, all the new threading tests (js1_8/extensions/dekker.js and friends) deadlock.
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: