Closed
Bug 503990
Opened 16 years ago
Closed 15 years ago
nanojit: make isStmt() table-driven
Categories
(Core :: JavaScript Engine, defect)
Tracking
()
RESOLVED
FIXED
People
(Reporter: n.nethercote, Assigned: n.nethercote)
References
Details
(Whiteboard: fixed-in-nanojit, fixed-in-tracemonkey)
Attachments
(1 file, 2 obsolete files)
1.32 KB,
patch
|
rreitmai
:
review+
|
Details | Diff | Splinter Review |
isStmt() is currently a rat's nest of conditionals. This patch makes it table-driven by adding an extra 'isStmt' field to every opcode in LIRopcode.tbl. It also cleans up the formatting in LIRopcode.tbl a little.
I'm seeing a 3--5ms speedup for SunSpider on my Mac with this change. In an earlier version I wasn't seeing any speed-up, but I suspect this change interacts well with the change from bug 496693.
Attachment #388378 -
Flags: review?(gal)
![]() |
Assignee | |
Comment 1•16 years ago
|
||
Nb: for the review, I'd appreciate it if you could check the isStmt field for
all the opcodes extra carefully -- I'm pretty confident I preserved the meaning
of isStmt(), but it deserves a very close look.
Comment 2•16 years ago
|
||
Comment on attachment 388378 [details] [diff] [review]
patch
Optional nit: The naming is a bit inconsistent (isStmtArray vs repKind vs insSize).
3-5ms speedup is awesome.
Attachment #388378 -
Flags: review?(gal) → review+
![]() |
Assignee | |
Comment 3•16 years ago
|
||
(In reply to comment #2)
> (From update of attachment 388378 [details] [diff] [review])
> Optional nit: The naming is a bit inconsistent (isStmtArray vs repKind vs
> insSize).
I can't call it isStmt because there's a function of the same name. I'll add a comment to that effect.
![]() |
Assignee | |
Comment 4•16 years ago
|
||
Sigh... after updating to r30233, I get a 2--6ms slowdown. I think this is just noise, that really there's no performance effect, but it's worth doing for the code cleanup.
![]() |
Assignee | |
Comment 5•16 years ago
|
||
Whiteboard: fixed-in-tracemonkey
Comment 6•16 years ago
|
||
Status: ASSIGNED → RESOLVED
Closed: 16 years ago
Resolution: --- → FIXED
Comment 7•16 years ago
|
||
patch asserts in debug mode
-OPDEF64(ldq, LIR_ld, 1, Ld) // 64-bit (quad) load
+OPDEF64(ldq, LIR_ld, 2, Ld, 0) // 64-bit (quad) load
operand count changed, hitting an assert
this was just merged and will burn any debug tinder boxes
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
![]() |
Assignee | |
Comment 8•16 years ago
|
||
This should fix the breakage. I'm not seeing the failure in the shell, though, which is really weird. I haven't tested the fix on a browser yet, I will shortly.
Attachment #388412 -
Flags: review?(gal)
![]() |
Assignee | |
Comment 9•16 years ago
|
||
Ah, I understand now: it's only occurring for ldc/ldcs/ldcb, which don't get used in trace-tests.js. The operand count is also wrong for ld/ldq/ldqc, but the operand count is never used for those ones. (One of the reasons I don't like the operand count much is that it's never used for many of the opcodes and so many of them could be wrong without consequence.)
Comment 10•16 years ago
|
||
Comment on attachment 388412 [details] [diff] [review]
patch that should fix breakage
I was about to upload the same patch, except that my browser keeps GCing. Another patch is bad too.
Attachment #388412 -
Flags: review?(gal) → review+
![]() |
Assignee | |
Comment 11•16 years ago
|
||
Comment 12•16 years ago
|
||
Is it worth it to add testcases to trace-test.js that exercise those opcodes?
Comment 13•16 years ago
|
||
had to back this out for the time being, to sort out some regressions. it can probably go back in shortly.
Whiteboard: fixed-in-tracemonkey
![]() |
Assignee | |
Comment 14•16 years ago
|
||
(In reply to comment #12)
> Is it worth it to add testcases to trace-test.js that exercise those opcodes?
Definitely. But I don't know what those test cases are. Looking at the code they seem to be generated in jsregexp.cpp.
![]() |
Assignee | |
Comment 15•16 years ago
|
||
This will conflict horribly with bug 504506, and that one is more important, so I'm marking this as dependent.
Depends on: 504506
![]() |
Assignee | |
Comment 16•15 years ago
|
||
The patch is overly conservative for calls -- it assumes all calls are stmts, when some of them (the CSEable ones) are not. Hmm.
![]() |
Assignee | |
Comment 17•15 years ago
|
||
This can be done (mostly) via the retType field added by the patch in bug 504507 -- all statements have void return types except for some calls. Preliminary tests indicate a small (eg. 3ms) SunSpider speedup with this change.
Also removing the dependency on bug 504506, this one could be done first.
![]() |
Assignee | |
Comment 18•15 years ago
|
||
This patch changes isStmt() to use retType[] for all cases except calls.
Performance changes are in the noise for SunSpider, but it's fewer
instructions, fewer branches, and neater code, which adds up to a win in
my books.
One side-effect of this is that LIR_file and LIR_line are now considered
statements, they previously weren't. I think the old behaviour was a bug,
because it meant LIR_file/LIR_line never did anything -- I think those
opcodes are broken, they only do something if VTUNE is defined anyway.
Attachment #388378 -
Attachment is obsolete: true
Attachment #388412 -
Attachment is obsolete: true
Attachment #419051 -
Flags: review?(rreitmai)
Comment 19•15 years ago
|
||
Comment on attachment 419051 [details] [diff] [review]
patch v3
Seems fine and yes I think this fixes a LIR_line and LIR_file bug, they should be treated as statements.
Attachment #419051 -
Flags: review?(rreitmai) → review+
![]() |
Assignee | |
Comment 20•15 years ago
|
||
Whiteboard: fixed-in-nanojit
![]() |
Assignee | |
Comment 21•15 years ago
|
||
Whiteboard: fixed-in-nanojit → fixed-in-nanojit, fixed-in-tracemonkey
Comment 22•15 years ago
|
||
Status: REOPENED → RESOLVED
Closed: 16 years ago → 15 years ago
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•