Closed
Bug 807185
Opened 12 years ago
Closed 12 years ago
IonMonkey: optimize the non-native test in visitCallGeneric
Categories
(Core :: JavaScript Engine, defect)
Core
JavaScript Engine
Tracking
()
RESOLVED
FIXED
mozilla19
People
(Reporter: luke, Assigned: luke)
References
Details
(Whiteboard: [ion:t])
Attachments
(1 file)
6.92 KB,
patch
|
sstangl
:
review+
|
Details | Diff | Splinter Review |
In the earlier JSFunction days you had to mask flags with JSFUN_KINDMASK and then compare against JSFUN_INTERPRETED. Now that that gunk has been cleared, JSFUN_INTERPRETED is a single bit and can be tested directly. dvander said this code was hot (hence the custom load16ZeroExtend_mask which could now be removed). Ideally, I think, we'd load an (aligned) 32-bit word (at offset 0 in JSFunction) and test JSFUN_INTERPRETED bit shifted appropriately).
Assignee | ||
Comment 1•12 years ago
|
||
I forgot to mention, there is the same test in visitApplyArgsGeneric.
Comment 2•12 years ago
|
||
Great! Good good good. Since no code requires |flags| after this test, on x86 and x86_64, where TEST exists with signature r/m32,r32 (or r/m32,i32), we could even perform the test without loading into a register.
Assignee | ||
Comment 3•12 years ago
|
||
I can see a distinct 2-3% speedup on a micro-benchmark that has a polymorphic callsite. SS and V8 seem unaffected.
Updated•12 years ago
|
Whiteboard: [ion:t]
Comment 5•12 years ago
|
||
Comment on attachment 677237 [details] [diff] [review] patch Review of attachment 677237 [details] [diff] [review]: ----------------------------------------------------------------- ::: js/src/ion/IonMacroAssembler.h @@ +269,5 @@ > + // 16-bit loads are slow and unaligned 32-bit loads may be too so > + // perform an aligned 32-bit load and adjust the bitmask accordingly. > + JS_STATIC_ASSERT(offsetof(JSFunction, nargs) % sizeof(uint32_t) == 0); > + JS_STATIC_ASSERT(offsetof(JSFunction, flags) == offsetof(JSFunction, nargs) + 2); > + JS_STATIC_ASSERT(IS_LITTLE_ENDIAN); These asserts are extremely thorough. Hopefully, future modifications to this file will use them as an example.
Attachment #677237 -
Flags: review?(sstangl) → review+
Assignee | ||
Comment 6•12 years ago
|
||
https://hg.mozilla.org/integration/mozilla-inbound/rev/2628f57bdd4b
Comment 7•12 years ago
|
||
https://hg.mozilla.org/mozilla-central/rev/2628f57bdd4b
Status: ASSIGNED → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla19
You need to log in
before you can comment on or make changes to this bug.
Description
•