Closed
Bug 402898
Opened 18 years ago
Closed 18 years ago
JS_YieldRequest doesn't do scope-sharing
Categories
(Core :: JavaScript Engine, defect)
Core
JavaScript Engine
Tracking
()
RESOLVED
FIXED
mozilla1.9beta4
People
(Reporter: jorendorff, Assigned: jorendorff)
References
Details
Attachments
(1 file)
1.07 KB,
patch
|
brendan
:
review+
brendan
:
approval1.9+
|
Details | Diff | Splinter Review |
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.
Comment 1•18 years ago
|
||
I am a simple caveman, your scope-sharing ways frighten and confuse me.
Assignee | ||
Comment 2•18 years ago
|
||
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
Assignee | ||
Comment 3•18 years ago
|
||
Maybe peterv can help.
Comment 4•18 years ago
|
||
(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.
Assignee | ||
Comment 5•18 years ago
|
||
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.
Assignee | ||
Updated•18 years ago
|
Attachment #301109 -
Flags: review?(brendan)
Assignee | ||
Comment 6•18 years ago
|
||
The suspend/resume issue is bug 416470; patch is attached there. After that patch, this one is (I think) ready to roll.
Assignee | ||
Updated•18 years ago
|
Attachment #301109 -
Attachment description: v1 - apply after the patch in bug 412985 → v1
Comment 7•18 years ago
|
||
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+
Assignee | ||
Updated•18 years ago
|
Keywords: checkin-needed
Comment 8•18 years ago
|
||
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
Updated•17 years ago
|
Flags: in-testsuite-
Flags: in-litmus-
Assignee | ||
Comment 9•17 years ago
|
||
(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.
Description
•