Closed Bug 118823 Opened 23 years ago Closed 22 years ago

better assembler for win32 xptcinvoke

Categories

(Core :: XPConnect, defect, P3)

x86
Windows 2000
defect

Tracking

()

VERIFIED FIXED
mozilla1.3beta

People

(Reporter: bernard.alleysson, Assigned: dbradley)

Details

(Keywords: perf)

Attachments

(2 files)

modifications: 

* make invoke_copy_to_stack fastcall instead of stdcall
* test edx,edx instead of cmp edx,0
* use call [edx][eax*4] instead of computing address by hand

results:

this saves a few push/pop for arguments and better use addressing capabilities
of x86 CPU

I've tested this and everything works fine (mail, browser)
Attached patch better assemblerSplinter Review
marking new 
Status: UNCONFIRMED → NEW
Ever confirmed: true
Did you run TestXPCTCInvoke?
Status: NEW → ASSIGNED
ok, I've just run through it
I'll attach the results

I've put some breakpoints and stepped through the assembly code (tested the case
with 0 params)
Attached file TestXPTCInvoke output
Keywords: perf
Priority: -- → P3
Target Milestone: --- → mozilla1.2
Moving out to 1.3. If this needs to be in before 1.3 please comment.
Target Milestone: mozilla1.2alpha → mozilla1.3alpha
Everything looks good, one question I have is about the last call statement call
   [edx][eax*4]. I'm not real familiar with the call[reg][reg] syntax.
Admittedly my x86 assembler is weak. Is this form new, or has it been around a
while. When was it introduced?
This addressing mode is valid for Intel 80386:
http://sources.redhat.com/binutils/docs-2.12/as.info/i386-Memory.html

And the CALL instruction can take a memory reference of 32 bits or a register
reference (r/m 32). The syntax for a memory reference is "section:[base +
index*scale + disp]".

So I think that this was introduced with the Intel 80386 processor.
so [edx][eax*4] is the same as [edx+eax*4]?
yes, absolutely
Moving to 1.4 Alpha
Target Milestone: mozilla1.3alpha → mozilla1.4alpha
Is there a reason not to land this patch? It should give some perfimprovement to
a function called quite a lot.
Keywords: patch
Comment on attachment 64010 [details] [diff] [review]
better assembler

I meant to r= this, but forgot to. We need to get an sr=. Requesting shaver.
Attachment #64010 - Flags: superreview?(shaver)
Attachment #64010 - Flags: review+
Comment on attachment 64010 [details] [diff] [review]
better assembler

My first assembler of the new year!  Looks good, thanks for the patch.
Attachment #64010 - Flags: superreview?(shaver) → superreview+
Patch checked in

Thanks for the quick response Shaver.

Updated milestone to 1.3beta to reflect when patch went in
Status: ASSIGNED → RESOLVED
Closed: 22 years ago
Resolution: --- → FIXED
Target Milestone: mozilla1.4alpha → mozilla1.3beta
Patch check-in verified -
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: