develooper Front page | perl.perl6.internals | Postings from May 2001

RE: Stacks, registers, and bytecode. (Oh, my!)

Thread Previous | Thread Next
From:
Dan Sugalski
Date:
May 29, 2001 15:14
Subject:
RE: Stacks, registers, and bytecode. (Oh, my!)
Message ID:
5.1.0.14.0.20010529180124.02240620@24.8.96.48
At 02:15 PM 5/29/2001 -0700, Hong Zhang wrote:
> > we have a simple set of load literal, push/pop (multiple) registers op
> > codes.
>
>There should be no push/pop opcodes. They are simply register moves.

The one handy thing about push and pop is you don't need to go tracking the 
stack manually--that's taken care of by the push and pop opcodes. They can 
certainly be replaced with manipulations of a temp register and indirect 
register stores or loads, but that's more expensive--you do the same thing 
only with more dispatch overhead.

And I'm considering the stack as a place to put registers temporarily when 
the compiler runs out and needs a spot to squirrel something away, rather 
than as a mechanism to pass parameters to subs or opcodes. This is a stack 
in the traditional scratch-space sense.

					Dan

--------------------------------------"it's like this"-------------------
Dan Sugalski                          even samurai
dan@sidhe.org                         have teddy bears and even
                                      teddy bears get drunk


Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About