Closed Bug 651627 Opened 9 years ago Closed 9 years ago

TI: incorrect result with try..catch, loops

Categories

(Core :: JavaScript Engine, defect)

defect
Not set

Tracking

()

RESOLVED FIXED

People

(Reporter: jandem, Unassigned)

References

(Blocks 1 open bug)

Details

Attachments

(1 file)

247 bytes, application/x-javascript
Details
$ ./js -n -m test.js
test.js:5: Error: Assertion failed: got (void 0), expected 0
Attached file Testcase
The problem here looks like when we enter from the interpreter, we don't fix up the type tags of variables which have a known type, and we then forget the constant type of 'j' after the 'try' so the resulting torn value passed to assertEq looks like an undefined.

This is fixed by the SSA patch, arriving shortly --- it removes the invariant we have that expects known type tags of locals to always be in sync (this invariant doesn't make much sense for SSA, as we can track different types for locals in different regions of the script).  Instead, we avoid stores of type tags for locals/args when we know their type is being preserved by a write, and issue the store when the var may be initially written.  (This could introduce extra memory traffic in nested loops or in branchy loops with vars that are not live around the backedge, but doesn't seem to affect benchmarks.  Could be fixed by not requiring vars with known type to have that type synced at join points).
Fixed by rev 90a7b141e0cf.
Status: NEW → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.