Open Bug 827108 Opened 12 years ago Updated 2 years ago

Make distinction between double's where NaN are observed and not

Categories

(Core :: JavaScript Engine, defect)

defect

Tracking

()

People

(Reporter: h4writer, Unassigned)

References

Details

Just for reference atm. Currently I think the impact isn't big enough for the added complexity. If we would be able to determine a double can't be a NaN it could simplify some codegeneration a bit and improve speed. The case I'm looking at is: raytrace.js:223 initialize : function(x, y, z) { this.x = (x ? x : 0); this.y = (y ? y : 0); this.z = (z ? z : 0); }, We can determine that x, y and z are never undefined in the benchmark. Actually the type is always double in this benchmark, but we can specialize the code to: initialize : function(x, y, z) { this.x = x; this.y = y; this.z = z; }, because NaN also returns false and need a 0. In this testcase NaN never occurs and removing the "if" would give a 1% increase on v8-raytrace. Another way to solve this, is to decide that when NaN occurs in TestDAndBranch we bailout. Because NaN shouldn't be the main path and it doesn't matter if that path is slow ...
Blocks: 768745
Assignee: general → nobody
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.