| java.lang.Object gnu.expr.Declaration
Declaration | public class Declaration (Code) | | The static information associated with a local variable binding.
These are the kinds of Declaration we use:
A local variable that is not captured by an inner lambda is stored
in a Java local variables slot (register). The predicate isSimple ()
is true, and offset is the number of the local variable slot.
If a local variable is captured by an inner lambda, the
variable is stored in a field of the LambdaExp's heapFrame variable.
(The latter declaration has isSimple and isArtificial true.)
The Declaration's field specifies the Field used.
If a function takes a fixed number of parameters, at most four,
then the arguments are passed in Java registers 1..4.
If a parameter is not captured by an inner lambda, the parameter
has the flags isSimple and isParameter true.
A parameter named "foo" that is captured by an inner lambda is represented
using two Declarations, named "foo" and "fooIncoming".
The "fooIncoming" declaration is the actual parameter as passed
by the caller using a Java local variable slot. It has isParameter(),
isSimple(), and isArtificial set. The "foo" Declaration has isParameter()
set. The procedure prologue copies "fooIncoming" to "foo", which acts
just like a normal captured local variable.
If a function takes more than 4 or a variable number of parameters,
the arguments are passed in an array (using the applyN virtual method).
This array is referenced by the argsArray declaration, which has
isSimple(), isParameter(), and isArtificial() true, and its offset is 1.
The parameters are copied into the program-named variables by the
procedure prologue, so the parameters henceforth act like local variables.
author: Per Bothner |
CAN_CALL | final static int CAN_CALL(Code) | | |
CAN_READ | final static int CAN_READ(Code) | | |
CAN_WRITE | final static int CAN_WRITE(Code) | | |
EXPORT_SPECIFIED | final public static int EXPORT_SPECIFIED(Code) | | |
INDIRECT_BINDING | final static int INDIRECT_BINDING(Code) | | |
IS_ALIAS | final static int IS_ALIAS(Code) | | |
IS_CONSTANT | final public static int IS_CONSTANT(Code) | | |
IS_FLUID | final static int IS_FLUID(Code) | | |
IS_SIMPLE | final static int IS_SIMPLE(Code) | | |
IS_SINGLE_VALUE | final public static int IS_SINGLE_VALUE(Code) | | |
IS_SYNTAX | final public static int IS_SYNTAX(Code) | | |
IS_UNKNOWN | final public static int IS_UNKNOWN(Code) | | |
NONSTATIC_SPECIFIED | final public static int NONSTATIC_SPECIFIED(Code) | | |
NOT_DEFINING | final public static int NOT_DEFINING(Code) | | Set if this is just a declaration, not a definition.
|
NOT_INITIALIZED | final public static int NOT_INITIALIZED(Code) | | |
PRIVATE | final static int PRIVATE(Code) | | |
PRIVATE_SPECIFIED | final public static int PRIVATE_SPECIFIED(Code) | | |
PROCEDURE | final static int PROCEDURE(Code) | | |
STATIC_SPECIFIED | final public static int STATIC_SPECIFIED(Code) | | |
TRANSIENT | final public static int TRANSIENT(Code) | | |
TYPE_SPECIFIED | final public static int TYPE_SPECIFIED(Code) | | |
VOLATILE | final public static int VOLATILE(Code) | | |
base | public Declaration base(Code) | | If non-null, field is relative to base.
If IS_FLUID, base points to IS_UNKNOWN Binding.
|
counter | static int counter(Code) | | |
firstCall | public ApplyExp firstCall(Code) | | List of ApplyExp where this declaration is the function called.
The applications are chained using their nextcall fields.
|
flags | protected int flags(Code) | | |
id | protected int id(Code) | | Unique id number, to ease print-outs and debugging.
|
name | String name(Code) | | The (interned) name of the new variable.
This is the source-level (non-mangled) name.
|
nextCapturedVar | Declaration nextCapturedVar(Code) | | Used to link Declarations in a LambdaExp's capturedVars list.
|
value | protected Expression value(Code) | | If non-null, the single expression used to set this variable.
If the variable can be set more than once, then value is null.
|
Declaration | protected Declaration()(Code) | | |
getCanCall | final public boolean getCanCall()(Code) | | |
getCanRead | final public boolean getCanRead()(Code) | | |
getCanWrite | final public boolean getCanWrite()(Code) | | |
getColumn | final public int getColumn()(Code) | | |
getConstantValue | final public Object getConstantValue()(Code) | | If getValue() is a constant, return the constant value, otherwise null.
|
getContext | final public ScopeExp getContext()(Code) | | Return the ScopeExp that contains (declares) this Declaration.
|
getFlag | final public boolean getFlag(int flag)(Code) | | |
getLine | final public int getLine()(Code) | | Get the line number of (the start of) this Expression.
The "first" line is line 1.
|
ignorable | public boolean ignorable()(Code) | | True if we never need to access this declaration.
|
initBinding | public void initBinding(Compilation comp)(Code) | | Generate code to initialize the location for this.
Assume the initial value is already pushed on the stack.
|
isAlias | final public boolean isAlias()(Code) | | |
isFluid | final public boolean isFluid()(Code) | | True if this is a fluid binding (in a FluidLetExp).
|
isIndirectBinding | final public boolean isIndirectBinding()(Code) | | True if the value of the variable is the contents of a Binding.
|
isLexical | final public boolean isLexical()(Code) | | |
isPrivate | final public boolean isPrivate()(Code) | | |
isProcedureDecl | final public boolean isProcedureDecl()(Code) | | |
isPublic | final public boolean isPublic()(Code) | | |
isSimple | final public boolean isSimple()(Code) | | |
isSpecifiedPrivate | final public boolean isSpecifiedPrivate()(Code) | | |
isStatic | public boolean isStatic()(Code) | | |
loadOwningObject | public void loadOwningObject(Compilation comp)(Code) | | If this is a field in some object, load a reference to that object.
|
needsInit | public boolean needsInit()(Code) | | Does this variable need to be initialized or is default ok
|
pushIndirectBinding | public void pushIndirectBinding(Compilation comp)(Code) | | Create a Binding object, given that isIndirectBinding().
Assume the initial value is already pushed on the stack;
leaves initialized Binding object on stack.
|
setAlias | final public void setAlias(boolean flag)(Code) | | |
setCanCall | final public void setCanCall(boolean called)(Code) | | |
setCanCall | final public void setCanCall()(Code) | | |
setCanRead | final public void setCanRead(boolean read)(Code) | | |
setCanRead | final public void setCanRead()(Code) | | |
setCanWrite | final public void setCanWrite(boolean written)(Code) | | |
setCanWrite | final public void setCanWrite()(Code) | | |
setFlag | final public void setFlag(boolean setting, int flag)(Code) | | |
setFlag | final public void setFlag(int flag)(Code) | | |
setFluid | final public void setFluid(boolean fluid)(Code) | | |
setIndirectBinding | final public void setIndirectBinding(boolean indirectBinding)(Code) | | |
setLine | final public void setLine(int lineno, int colno)(Code) | | |
setLine | final public void setLine(int lineno)(Code) | | |
setPrivate | final public void setPrivate(boolean isPrivate)(Code) | | |
setProcedureDecl | final public void setProcedureDecl(boolean val)(Code) | | |
setSimple | final public void setSimple(boolean b)(Code) | | |
setSpecifiedPrivate | final public void setSpecifiedPrivate(boolean isPrivate)(Code) | | |
|
|