Closed Bug 470133 Opened 16 years ago Closed 16 years ago

TM: fails to trace condswitch with type mismatch

Categories

(Core :: JavaScript Engine, defect)

x86
macOS
defect
Not set
minor

Tracking

()

VERIFIED FIXED

People

(Reporter: jruderman, Assigned: Waldo)

Details

(Keywords: perf, testcase, verified1.9.1, Whiteboard: fixed-in-tracemonkey)

Attachments

(1 file)

20% slower with -j than without: three=3; for(i=0;i<500000;++i) { switch("") { case three: } }
Running with TRACEMONKEY=verbose, it says: recording starting from /Users/jruderman/e.js:1@20 globalObj=0x24f000, shape=143 import vp=0x811334 name=$global0 type=int flags=0 abort: 4590: unsupported type for cmp vs string Abort recording (line 1, pc 27): JSOP_CASE. I believe switch uses === instead of ==, so why is this using a cmp that becomes unhappy when the types don't match?
Attached patch PatchSplinter Review
I can't figure out how to demonstrate misbehavior caused by using == instead of === in comparing a case value with the switch value. I think this might be caused by the way that currently case returns from ::equality before getting to the fusing/setting code, but I don't know that for sure.
Attachment #353600 - Flags: review?(gal)
Attachment #353600 - Flags: review?(gal) → review+
This should block, I think, because it makes us fall off trace and because the wrong comparison function is used; I was unsuccessful at getting semantically different behavior with the wrong comparison function, but that doesn't mean it wasn't present. Better not to depend on being lucky somehow, methinks.
Status: NEW → ASSIGNED
Flags: blocking1.9.1?
Hmm, forgot it wasn't blocking yet, but fixed in TM: http://hg.mozilla.org/tracemonkey/rev/cc3cbf3ea676
Whiteboard: fixed-in-tracemonkey
merged to mc
Status: ASSIGNED → RESOLVED
Closed: 16 years ago
Flags: blocking1.9.1? → blocking1.9.1+
Resolution: --- → FIXED
test included in js1_8_1/trace/trace-test.js http://hg.mozilla.org/mozilla-central/rev/8f967a7729e2
Flags: in-testsuite+
Flags: in-litmus-
v 1.9.1, 1.9.2
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: