Closed
Bug 431540
Opened 16 years ago
Closed 16 years ago
TT: obj == null should not call obj.valueOf
Categories
(Tamarin Graveyard :: Tracing Virtual Machine, defect, P1)
Tracking
(Not tracked)
RESOLVED
FIXED
People
(Reporter: edwsmith, Assigned: stejohns)
Details
Attachments
(1 file)
1.83 KB,
patch
|
edwsmith
:
review+
|
Details | Diff | Splinter Review |
but it does. see vm.fs ==vec, calls obj==nonobj which always calls defaultValue test case: var o = { valueOf: function() { print("valueOf"); return 0 } } print(o != null) this should not print "valueOf" please add test case to regression suite when fixing.
Reporter | ||
Updated•16 years ago
|
Assignee: nobody → stejohns
Priority: -- → P1
Assignee | ||
Comment 1•16 years ago
|
||
I think this has it nailed. Still passes sanities.
Attachment #320308 -
Flags: review?(edwsmith)
Reporter | ||
Comment 2•16 years ago
|
||
do the obj==ns and ns==obj cases need to check for a hook?
Reporter | ||
Comment 3•16 years ago
|
||
this fix makes access-binary-trees 2X faster because this function is hot and frequently compares a pointer to null. TreeNode.prototype.itemCheck = function(){ if (this.left==null) return this.item; else return this.item + this.left.itemCheck() - this.right.itemCheck(); }
Assignee | ||
Comment 4•16 years ago
|
||
(In reply to comment #2) > do the obj==ns and ns==obj cases need to check for a hook? AFAIK, no. If ES4 adds the ability to override operator== (to use C++ terminology) then we might need to do so, but nothing in standard builtin objects needs it that I aware of. (Changing it back wouldn't hurt, this is just a performance optimization)
Reporter | ||
Updated•16 years ago
|
Attachment #320308 -
Flags: review?(edwsmith) → review+
Assignee | ||
Comment 5•16 years ago
|
||
pushed as changeset: 361:3b882d257ab0
Assignee | ||
Comment 6•16 years ago
|
||
marked fixed; added acceptance test in changeset: 376:c9f90e0fd541
Status: NEW → RESOLVED
Closed: 16 years ago
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•