Closed Bug 451787 Opened 16 years ago Closed 16 years ago

TM: Trace unary not for numbers and strings

Categories

(Core :: JavaScript Engine, enhancement, P3)

x86
macOS
enhancement

Tracking

()

RESOLVED FIXED

People

(Reporter: bzbarsky, Unassigned)

References

Details

Attachments

(2 files)

TraceRecorder::record_JSOP_NOT bails out of the arg is not boolean or object.  I don't see why we couldn't use the code it has right now for INT and DOUBLE as well...

As far as that goes, we should be able to do strings too, right?
Yeah, we just add stuff on demand as we go along (gives an entirely new meaning to incremental compilation).
For double, eq0 isn't sufficient, since NaN != 0 but !NaN is true.  I bet we can get there by chaining enough eq0s together, though. :)
So I tried just doing that, but I ran into the little issue where Assembler::asm_cmp has this to say:

537         // Not supported yet.
538 #if !defined NANOJIT_64BIT
539         NanoAssert(!lhs->isQuad() && !rhs->isQuad());
540 #endif
Attached file Simple JS test file
This tests the performance (delta1 and delta2 should be about equal, not differ by a factor of 8) and the NaN behavior (i should end up as 1000).
Boris, the parser will nuke useless if statements like the one in your first test, so the first test is equivalent to |for (lots of stuff) /* empty */;|
Ah.  I guess I should assign the false to a var.  In any case, the second test should be about as fast as the first one.
Priority: -- → P3
Severity: normal → enhancement
Attachment #339353 - Flags: review?
Attachment #339353 - Flags: review? → review?(bzbarsky)
Attachment #339353 - Flags: review?(bzbarsky) → review?(danderson)
Attachment #339353 - Flags: review?(danderson) → review+
http://hg.mozilla.org/tracemonkey/rev/4d02662a0cd2
Status: NEW → RESOLVED
Closed: 16 years ago
Resolution: --- → FIXED
test also included in js1_8_1/trace/trace-test.js
Flags: in-testsuite+
Flags: in-litmus-
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: