Closed Bug 109183 Opened 24 years ago Closed 24 years ago

JS_GetClass when called indirectly via the GC should not ClaimScope

Categories

(Core :: JavaScript Engine, defect, P2)

defect

Tracking

()

VERIFIED FIXED
mozilla0.9.7

People

(Reporter: brendan, Assigned: brendan)

Details

(Keywords: js1.5)

Attachments

(1 file, 1 obsolete file)

dbaron found this while jprof'ing new compose window: 69 JS_GetClass 5 js_FinalizeObject 3 js_Interpret 2 JS_CloneFunctionObject 2 JS_TypeOfValue 1 LookupArgOrVar 1 JS_GetPrivate 2241 2 83 js_GetSlotThreadSafe 79 ClaimScope 2 js_LiveContext He profiled by opening a bunch of compose windows (~40), so js_LiveContext was hotter than usual. Still, the GC_AWARE_GET_SLOT stuff in jsapi.c that I did based on jband's report of similar unwarranted ClaimScope activity should be used by JS_GetClass (and js_FinalizeObject should use it, too). /be
Patch coming right up. /be
Status: NEW → ASSIGNED
Keywords: js1.5, mozilla0.9.7
Priority: -- → P2
Target Milestone: --- → mozilla0.9.7
Attached patch proposed fix (obsolete) — Splinter Review
js_FinalizeObject can simply use LOCKED_OBJ_GET_CLASS, as the GC stops all other JS activity that might race badly to update obj->slots while js_FinalizeObject is trying to load obj->slots[JSSLOT_CLASS]. /be
Comment on attachment 57139 [details] [diff] [review] proposed fix sr=jband >+#define GC_AWARE_GET_SLOT(cx,obj,slot) LOCKED_OBJ_GET_SLOT(obj, slot) could just be?... #define GC_AWARE_GET_SLOT LOCKED_OBJ_GET_SLOT You might update the big comment a bit since this is not only probably a 'mark' anymore.
Attachment #57139 - Flags: superreview+
You can't #define BAR FOO and call BAR(x,y,z) when FOO was #defined to take only two params, e.g. Comment beefed up a bit. /be
Attachment #57139 - Attachment is obsolete: true
Attachment #57180 - Flags: superreview+
> You can't #define BAR FOO and call BAR(x,y,z) when FOO was #defined to take > only two params, e.g. d'oh. I misread. You *can* get rid of a space before "slot" to make it look like the lines above. (like it matters :)
jband: done, thanks (I must have been reading an old-style diff in my haste, I always try to line things up, given context). /be
Comment on attachment 57180 [details] [diff] [review] revised comment per jband's review r=shaver.
Attachment #57180 - Flags: review+
Fixed. /be
Status: ASSIGNED → RESOLVED
Closed: 24 years ago
Resolution: --- → FIXED
Marking Verified -
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: