comp.lang.ada
 help / color / mirror / Atom feed
From: Roedy Green <roedy@mindprod.com>
Subject: Re: S/390 (was Market pressures for more reliable software)
Date: Thu, 28 Jun 2001 21:49:23 GMT
Date: 2001-06-28T21:49:23+00:00	[thread overview]
Message-ID: <lt8njt0ugifck5tneg57ln5nauenqcj527@4ax.com> (raw)
In-Reply-To: xME_6.9627$e5.27883@newsfeeds.bigpond.com

On Thu, 28 Jun 2001 11:44:29 GMT, robin <robin_v@bigpond.nospam.com>
wrote or quoted :

>With the BALR instruction, one or
>more registers can be loaded with the absolute address of the next
>instruction.  This register(s) can then be used as the
>base register(s).  No address constants needed.

The BALR was S/360's rather odd subroutine jump instruction.

BALR 14,15 would put the return address in reg 14 and jump to the
subroutine addressed by reg 15.

There was no hardware stack.  If the called routine was not a leaf
routine it that to call GETMAIN to allocate a block of RAM to store
the regs, and when it was done call FREEMAIN to give it back.  OUCH.

However, when the subroutine was a leaf (called no methods), this was
very efficient, because you could return without having to access
ram/stack, just look in R14. 

Now to bring this back to JAVA.  I thought there should be special
optimisations for calls to Java leaf routines where the return address
is left in a register, and the usual overhead of creating a stack
frame is bypassed. This would be analogous to the old S/360 BALR
14,15.

Clever lookahed logic in hardware could then get you your subroutine
return for free.

I did an optimisation of this form in my BBL Forth compiler.  It made
a huge difference on the old 8086 that did not have an optimised
stack-based call/ret.  Chuck Moore's SHBOOM chip reserved a bit in
each operand for piggybacking a ret.

The Pentium has such a well optimised CALL/RET using this trick would
not buy you anything. However, it might be something clever to try in
a Picojava processor.




For more detail, please look up the key words mentioned in this post in
the Java Glossary at: http://mindprod.com/gloss.html 

--
Roedy Green, Canadian Mind Products
Custom computer programming since 1963. Ready to take on new work.



  parent reply	other threads:[~2001-06-28 21:49 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-06-28 11:44 S/390 (was Market pressures for more reliable software) robin
2001-06-28 13:04 ` Gary Labowitz
2001-06-28 21:49 ` Roedy Green [this message]
  -- strict thread matches above, loose matches on Subject: below --
2001-06-28 23:17 robin
2001-06-28 23:46 ` Roedy Green
2001-06-29  0:27   ` John Homes
2001-06-29  6:41     ` Randy Hudson
2001-06-29 19:25     ` hack
2001-06-29  0:52   ` Gary Labowitz
2001-06-29  8:21   ` Clem Clarke
2001-06-29 12:20   ` Shmuel (Seymour J.) Metz
2001-06-29 12:19 ` Shmuel (Seymour J.) Metz
2001-06-30  6:13   ` Randy Hudson
2001-07-02  0:18     ` Shmuel (Seymour J.) Metz
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox