Closed
Bug 465137
Opened 16 years ago
Closed 16 years ago
TM: JIT thinks !NaN is false
Categories
(Core :: JavaScript Engine, defect, P1)
Core
JavaScript Engine
Tracking
()
VERIFIED
FIXED
mozilla1.9.1b2
People
(Reporter: jruderman, Assigned: Waldo)
References
Details
(Keywords: testcase, verified1.9.1)
Attachments
(1 file)
1.24 KB,
patch
|
gal
:
review+
|
Details | Diff | Splinter Review |
js> for (var i=0;i<5;++i) print("NaN is " + (!(NaN) ? "falsy" : "truthy")); NaN is falsy NaN is falsy NaN is truthy NaN is truthy NaN is truthy
Assignee | ||
Updated•16 years ago
|
Assignee: general → jwalden+bmo
Assignee | ||
Comment 1•16 years ago
|
||
I'm still stepping lightly through this code -- which later stage of processing converts these instructions to non-FP instructions? Will this != check interfere with what appears to be described as "demotion" in jstracer.cpp? Alternately, is it potentially faster to short-circuit the computation (but introduce branches) and avoid not evaluating the entire thing every time? This was more trouble than it should have been because I forgot that not is not not. (LIR_not is not !, that is. :-) )
Attachment #348468 -
Flags: review?(gal)
Comment 2•16 years ago
|
||
Comment on attachment 348468 [details] [diff] [review] Patch Yeah, always use LIR_f* for numbers in the frontend code generators. Filters do the rest.
Attachment #348468 -
Flags: review?(gal) → review+
Comment 3•16 years ago
|
||
Additional comment: always try to avoid forking of new traces since that can be very costly (if you really take the other path and have to build a whole new trace). The basic guidance is: - if the type changes, you need a new trace - if the value is extremely unlikely to be hit, make it a mismatch exit (like out of memory conditions) - if the type is the same, use or or conditional moves or whatever other magic you need. We should teach the backend to pickup these patterns and optimize them. x = !(a == x) for example is very inefficient atm and does first sete and setne instead of just setne.
Comment 4•16 years ago
|
||
This could get ugly for the beta. Look out for dups. Need to fix before final no matter what. /be
Flags: blocking1.9.1?
OS: Mac OS X → All
Hardware: PC → All
Comment 5•16 years ago
|
||
(In reply to comment #3) > - if the type is the same, use or or conditional moves or whatever other magic > you need. We should teach the backend to pickup these patterns and optimize > them. x = !(a == x) for example is very inefficient atm and does first sete and > setne instead of just setne. Bug on file? /be
Assignee | ||
Comment 6•16 years ago
|
||
Fixed in TM.
Summary: TM: JIT thinks NaN is truthy → TM: JIT thinks !NaN is false
Updated•16 years ago
|
Severity: normal → critical
Status: NEW → RESOLVED
Closed: 16 years ago
Priority: -- → P1
Resolution: --- → FIXED
Target Milestone: --- → mozilla1.9.1b2
Comment 7•16 years ago
|
||
reopening, marking blocking beta2, will close once landed on m-c.
Status: RESOLVED → REOPENED
Flags: blocking1.9.1? → blocking1.9.1+
Resolution: FIXED → ---
Comment 8•16 years ago
|
||
Fixed in the merge pushed by vlad on Nov 18 14:11:14 2008 -0800: http://hg.mozilla.org/mozilla-central/rev/e8ed5d4bf531
Status: REOPENED → RESOLVED
Closed: 16 years ago → 16 years ago
Resolution: --- → FIXED
Comment 9•16 years ago
|
||
testLogicalNotNaN already in js1_8_1/trace/trace-test.js
Flags: in-testsuite+
Flags: in-litmus-
Comment 10•16 years ago
|
||
test landed http://hg.mozilla.org/mozilla-central/rev/887f1597048e and cvs
Updated•16 years ago
|
Keywords: fixed1.9.1
Comment 11•16 years ago
|
||
v 1.9.1, 1.9.2
Status: RESOLVED → VERIFIED
Keywords: fixed1.9.1 → verified1.9.1
You need to log in
before you can comment on or make changes to this bug.
Description
•