Closed Bug 807185 Opened 7 years ago Closed 7 years ago
Monkey: optimize the non-native test in visit Call Generic
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).
I forgot to mention, there is the same test in visitApplyArgsGeneric.
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.
I can see a distinct 2-3% speedup on a micro-benchmark that has a polymorphic callsite. SS and V8 seem unaffected.
Assignee: general → luke
Status: NEW → ASSIGNED
Attachment #677237 - Flags: review?(sstangl)
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+
Status: ASSIGNED → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla19
You need to log in before you can comment on or make changes to this bug.