Class EDU.gac.max.MC97.S97.compiler_support.RegisterAllocator
All Packages Class Hierarchy This Package Previous Next Index
Class EDU.gac.max.MC97.S97.compiler_support.RegisterAllocator
java.lang.Object
|
+----EDU.gac.max.MC97.S97.compiler_support.RegisterAllocator
- public class RegisterAllocator
- extends Object
The Register class is used to represent a pool from which
Registers can be allocated and to which they can then later be
deallocated.
Some to-do items:
- signal a better exception than array out of bounds for out of
registers
- signal an exception for deallocating an already free register
- provide enumerations of free and allocated registers
Written 7 Feb 1997 by
Max Hailperin
<max@gac.edu>
-
RegisterAllocator(String, int)
- The RegisterAllocator constructor takes a String prefix argument
that is used for constructing each Register.
-
allocate()
-
-
deallocate(Register)
-
-
deallocateIfYours(Register)
-
RegisterAllocator
public RegisterAllocator(String prefix,
int number)
- The RegisterAllocator constructor takes a String prefix argument
that is used for constructing each Register. It also takes an
int number argument, which specifies how many registers there
will be. They are numbered consectively from 0. For example,
new RegisterAllocator("t", 10)
will allocate
registers $t0
through $t9
.
allocate
public Register allocate()
deallocate
public void deallocate(Register r) throws NotMyRegisterException
deallocateIfYours
public void deallocateIfYours(Register r)
All Packages Class Hierarchy This Package Previous Next Index