Closed
Bug 549531
Opened 14 years ago
Closed 14 years ago
fix strict aliasing warnings about scopeChain (also clean trailing whitespace)
Categories
(Core :: JavaScript Engine, defect, P1)
Core
JavaScript Engine
Tracking
()
RESOLVED
FIXED
mozilla1.9.3a3
People
(Reporter: brendan, Assigned: brendan)
Details
(Whiteboard: fixed-in-tracemonkey)
Attachments
(1 file)
18.11 KB,
patch
|
dmandelin
:
review+
|
Details | Diff | Splinter Review |
I hope I'm not the only one who greps warnings from shell build logs :-P. /be
Attachment #429652 -
Flags: review?(dmandelin)
Assignee | ||
Comment 1•14 years ago
|
||
Hrm, I should have checked this first: $ grep 'scopeChain->' *.h *.cpp jsfun.cpp: JS_ASSERT(fp->scopeChain->getPrivate() != fp); jsfun.cpp: JS_ASSERT(scopeChain->hasClass(&js_CallClass)); jsfun.cpp: JS_ASSERT(!scopeChain->getPrivate()); jsinterp.cpp: fp->scopeChain->getPrivate() != fp); jstracer.cpp: if (!fp->scopeChain->getPrivate()) jstracer.cpp: fp->scopeChain->setPrivate(fp); Only six hits, while seven address-of uses of scopeChainVal in this bug's patch: $ grep scopeChainVal *.h *.cpp jsinterp.h: jsval scopeChainVal; jsrecursion.cpp: &fp->scopeChainVal, jstracer.cpp: if (!visitor.visitStackSlots(&fp->scopeChainVal, 1, fp)) jstracer.cpp: ? get(&cx->fp->scopeChainVal) jstracer.cpp: LIns* scopeChain_ins = get(&cx->fp->scopeChainVal); jstracer.cpp: set(&fp->scopeChainVal, INS_NULL(), true); jstracer.cpp: set(&fp->scopeChainVal, call_ins); jstracer.cpp: set(&fp->scopeChainVal, scopeChain_ins, true); says we should just make scopeChain be of type jsval and use JSVAL_TO_OBJECT in six places. dmandelin, what do you think? /be
Updated•14 years ago
|
Attachment #429652 -
Flags: review?(dmandelin) → review+
Assignee | ||
Comment 2•14 years ago
|
||
$ grep '>scopeChain)' *.cpp *.h jsemit.cpp: JS_ASSERT(caller->fun && caller->varobj(cx) == evalcg->scopeChain); jsfun.cpp: JSClass *classp = OBJ_GET_CLASS(cx, fp->scopeChain); jsfun.cpp: fp->scopeChain); jsfun.cpp: callobj = NewCallObject(cx, fp->fun, fp->scopeChain); jsgc.cpp: if (fp->scopeChain) jsinterp.cpp: JS_ASSERT(fp->scopeChain); jsinterp.cpp: JS_ASSERT(OBJ_GET_CLASS(cx, fp->scopeChain) != &js_BlockClass || jsinterp.cpp: STOBJ_SET_PARENT(newChild, fp->scopeChain); jsobj.cpp: if (fp->scopeChain) jsobj.cpp: fprintf(stderr, " scopeChain: (JSObject *) %p\n", (void *) fp->scopeChain); jsops.cpp: regs.sp[-1] = OBJECT_TO_JSVAL(fp->scopeChain); jsops.cpp: JS_ASSERT(regs.sp[-1] == OBJECT_TO_JSVAL(fp->scopeChain)); jsops.cpp: obj = CloneFunctionObject(cx, fun, fp->scopeChain); jsscript.cpp: JS_ASSERT(!caller || cx->fp->scopeChain == caller->scopeChain); jstracer.cpp: HashAccum(h, uintptr_t(OBJ_SHAPE(JS_GetGlobalForObject(cx, fp->scopeChain))), ORACLE_MASK); jstracer.cpp: VisitGlobalSlots(visitor, cx, JS_GetGlobalForObject(cx, cx->fp->scopeChain), jstracer.cpp: VisitSlots(visitor, cx, JS_GetGlobalForObject(cx, cx->fp->scopeChain), jstracer.cpp: VisitSlots(visitor, cx, JS_GetGlobalForObject(cx, cx->fp->scopeChain), jstracer.cpp: JS_ASSERT(globalObj == JS_GetGlobalForObject(cx, cx->fp->scopeChain)); jstracer.cpp: JS_ASSERT(cx->fp->scopeChain); jstracer.cpp: if (OBJ_SCOPE(JS_GetGlobalForObject(cx, cx->fp->scopeChain))->title.ownercx != cx) { jstracer.cpp: JSObject* globalObj = JS_GetGlobalForObject(cx, cx->fp->scopeChain); jstracer.cpp: JS_ASSERT(f->globalObj == JS_GetGlobalForObject(cx, cx->fp->scopeChain)); jstracer.cpp: JSObject* globalObj = JS_GetGlobalForObject(cx, cx->fp->scopeChain); jstracer.cpp: JS_ASSERT(chainHead == cx->fp->scopeChain); jstracer.cpp: JSObject* globalObj = JS_GetGlobalForObject(cx, cx->fp->scopeChain); This is big enough I'll take that r+ and run with it. The union assumes that (JSObject *)v and JSVAL_TO_OBJECT(v) are equivalent for the bits stored in v, but we have jsapi.cpp:JS_STATIC_ASSERT(JSVAL_OBJECT == 0); guarding this assumption. /be
Assignee | ||
Comment 3•14 years ago
|
||
http://hg.mozilla.org/tracemonkey/rev/64c278790bb8 /be
Whiteboard: fixed-in-tracemonkey
Assignee | ||
Comment 4•14 years ago
|
||
http://hg.mozilla.org/mozilla-central/rev/64c278790bb8 /be
Status: ASSIGNED → RESOLVED
Closed: 14 years ago
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•