This is the mail archive of the java-discuss@sourceware.cygnus.com mailing list for the GCJ project. See the GCJ home page for more information.


[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index] [Subject Index] [Author Index] [Thread Index]

Is every Java method really a varargs method?



>From the assembler output of the Java compiler, it appears that
gcj treats every method as if it has a variable length arglist.  Note
the following output from an arm-gcj cross assembler:

	.align	4
	.global	___13HelloWorldApp
___13HelloWorldApp:
	; args = 4, pretend = 16, frame = 0
	; frame_needed = 0, current_function_anonymous_args = 1
	stmfd	sp!, {r0, r1, r2, r3}	<-- Pushes register arguments???
	stmfd	sp!, {lr}
	ldr	r0,[sp, #4]
	bl	___Q34java4lang6Object
	ldmfd	sp!, {lr}
	add	sp, sp, #16
	mov	pc, lr

Is there some magical reason for this that I don't comprehend?  For
many architectures with alot of registers like sparc or a29k, this
would incur a big overhead...

--
Jon Olson, Modular Mining Systems
	   3289 E. Hemisphere Loop
	   Tucson, AZ 85706
INTERNET:  olson@mmsi.com
PHONE:     (520)746-9127
FAX:       (520)889-5790