Closed
Bug 457356
Opened 16 years ago
Closed 16 years ago
TM: Don't rely on record-time NULL check done by JSVAL_IS_PRIMITIVE, also do runtime check
Categories
(Core :: JavaScript Engine, defect, P3)
Tracking
()
RESOLVED
INVALID
mozilla1.9.1
People
(Reporter: gal, Assigned: gal)
References
Details
We might be missing some null checks at the moment. Go through all uses of JSVAL_IS_PRIMITIVE and double check (and use JSVAL_IS_OBJECT) instead. No known instances so not making this a beta1 blocker. Low threat (result is NULL deref, not random pointer).
Flags: blocking1.9.1?
Updated•16 years ago
|
Flags: blocking1.9.1? → blocking1.9.1+
Priority: -- → P3
Assignee | ||
Comment 1•16 years ago
|
||
Fixed title to be more accurate.
Summary: TM: Don't use JSVAL_IS_PRIMITIVE, use JSVAL_IS_OBJECT and explicit null check → TM: Don't rely on record-time NULL check done by JSVAL_IS_PRIMITIVE, also do runtime check
Comment 2•16 years ago
|
||
Near the top of jstracer.cpp, we should #undef JSVAL_IS_PRIMITIVE and #define it to JS_STATIC_ASSERT(0) as Andreas did for JSVAL_IS_BOOLEAN. All record-time tests should JSVAL_IS_OBJECT instead, and we need runtime null checks (sigh).
Or (better): we fix bug 457363 at least to give null separate type. Having void (or hole) be a pseudo-boolean (booloid, jorendorff coinage ;-) is not as bad as having null inhabit object type, in terms of extra guards (runtime overhead).
We have a zero-perf-regression-for-correctly-compiled-code policy, so it seems to me we need to look at fixing the null-inhabits-object-type problem.
/be
Assignee | ||
Comment 3•16 years ago
|
||
I am warming up to the separate null type. Looking at code it seems the null case has a very different control flow and we almost never actually trigger a null check. Instead there is an if control-flow explicitly around it, so we will split the trace there anyway. If we do that, we can as well split on the type a bit earlier.
Comment 4•16 years ago
|
||
Fixed in checkin for bug 465460?
Updated•16 years ago
|
Comment 5•16 years ago
|
||
As summarized, invalid because of the better solution landed in the patch for bug 465460. #undef'ing JSVAL_IS_OBJECT and JSVAL_IS_PRIMITIVE (to redefine those as static asserts of 0) looked like too much trouble (just the latter requires the former). If anyone thinks otherwise, new bug on that.
/be
Resolution: FIXED → INVALID
You need to log in
before you can comment on or make changes to this bug.
Description
•