Closed Bug 489124 Opened 15 years ago Closed 15 years ago

Perform some minor JSVAL_TFUN-induced optimizations/cleanups

Categories

(Core :: JavaScript Engine, enhancement)

enhancement
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: Waldo, Assigned: Waldo)

Details

(Keywords: fixed1.9.1, Whiteboard: fixed-in-tracemonkey)

Attachments

(1 file)

Attached patch PatchSplinter Review
Found when skimming for places that might be able to benefit from splitting functions from non-null objects; note that VALUE_IS_FUNCTION is !primitive && function-classed object, so the previous tag-check was superfluous.  The typeof optimization probably won't appreciably speed up anything but artificial testcases, but removing a guard every time we write an object-valued property could speed up some of the real world, depending on how undisciplined code is in using global variables.

Speaking of which, with current code that guard's emitted if JSVAL_IS_OBJECT, not if !JSVAL_IS_PRIMITIVE.  Why does it not show up in the final native instruction sequence when the value being written is null?  Verbose output clearly shows this code causes a class-check to occur, but by the time we execute native code it's not there any more.
Attachment #373610 - Flags: review?(gal)
Flags: wanted1.9.1?
Comment on attachment 373610 [details] [diff] [review]
Patch

supernit (optional): though instead of tho and maybe clarify the comment that we type-specialize for functions.
Attachment #373610 - Flags: review?(gal) → review+
(In reply to comment #1)
> (From update of attachment 373610 [details] [diff] [review])
> supernit (optional): though instead of tho and maybe clarify the comment that
> we type-specialize for functions.

Hm, yeah, I've slipped into the habit of spelling it that way even tho (pun intended!) it's the less common spelling, I can change that.  I also tweaked the comment a little bit to be clearer, although I think as it was it might only have been unclear once, and the first hit in the file would have been sufficient explanation.

http://hg.mozilla.org/tracemonkey/rev/81ea33f9a7a7
Whiteboard: fixed-in-tracemonkey
http://hg.mozilla.org/mozilla-central/rev/81ea33f9a7a7
Status: ASSIGNED → RESOLVED
Closed: 15 years ago
Resolution: --- → FIXED
Flags: wanted1.9.1? → wanted1.9.1+
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: