public class

UplevelReference

extends Object
implements Constants
java.lang.Object
   ↳ sun.tools.tree.UplevelReference

Class Overview

A reference from one scope to another. WARNING: The contents of this source file are not part of any supported API. Code that depends on them does so at its own risk: they are subject to change or removal without notice.

Summary

[Expand]
Inherited Constants
From interface sun.tools.java.Constants
From interface sun.tools.java.RuntimeConstants
[Expand]
Inherited Fields
From interface sun.tools.java.Constants
From interface sun.tools.java.RuntimeConstants
Public Constructors
UplevelReference(ClassDefinition client, LocalMember target)
constructor
Public Methods
void codeArguments(Environment env, Context ctx, Assembler asm, long where, MemberDefinition conField)
Code is being generated for a call to a constructor of the client class.
void codeInitialization(Environment env, Context ctx, Assembler asm, long where, MemberDefinition conField)
Code is being generated for a constructor of the client class.
final ClassDefinition getClient()
the client class
final LocalMember getLocalArgument()
the local argument for this reference
final MemberDefinition getLocalField(Environment env)
Get the local field, creating one if necessary.
final MemberDefinition getLocalField()
the field allocated in the client for this reference
final UplevelReference getNext()
the next reference in the client's list
final LocalMember getTarget()
the target of this reference
UplevelReference insertInto(UplevelReference references)
Insert self into a list of references.
boolean isClientOuterField()
Tell if this uplevel reference is the up-level "this" pointer of an inner class.
final boolean isEarlierThan(UplevelReference other)
Tells if self precedes the other in the canonical ordering.
boolean localArgumentAvailable(Environment env, Context ctx)
Tell if my local argument is directly available in this context.
Expression makeFieldReference(Environment env, Context ctx)
As with makeLocalReference(), build a locally-usable reference.
Expression makeLocalReference(Environment env, Context ctx)
Assuming noteReference() is all taken care of, build an uplevel reference.
void noteReference(Environment env, Context ctx)
Process an uplevel reference.
String toString()
Returns a string representation of the object.
void willCodeArguments(Environment env, Context ctx)
During the inline phase, call this on a list of references for which the code phase will later emit arguments.
[Expand]
Inherited Methods
From class java.lang.Object

Public Constructors

public UplevelReference (ClassDefinition client, LocalMember target)

constructor

Public Methods

public void codeArguments (Environment env, Context ctx, Assembler asm, long where, MemberDefinition conField)

Code is being generated for a call to a constructor of the client class. Push an argument for the constructor.

public void codeInitialization (Environment env, Context ctx, Assembler asm, long where, MemberDefinition conField)

Code is being generated for a constructor of the client class. Emit code which initializes the instance.

public final ClassDefinition getClient ()

the client class

public final LocalMember getLocalArgument ()

the local argument for this reference

public final MemberDefinition getLocalField (Environment env)

Get the local field, creating one if necessary. The client class must not be frozen.

public final MemberDefinition getLocalField ()

the field allocated in the client for this reference

public final UplevelReference getNext ()

the next reference in the client's list

public final LocalMember getTarget ()

the target of this reference

public UplevelReference insertInto (UplevelReference references)

Insert self into a list of references. Maintain "isEarlierThan" as an invariant of the list. This is important (a) to maximize stability of signatures, and (b) to allow uplevel "this" parameters to come at the front of every argument list they appear in.

public boolean isClientOuterField ()

Tell if this uplevel reference is the up-level "this" pointer of an inner class. Such references are treated differently than others, because they affect constructor calls across compilation units.

public final boolean isEarlierThan (UplevelReference other)

Tells if self precedes the other in the canonical ordering.

public boolean localArgumentAvailable (Environment env, Context ctx)

Tell if my local argument is directly available in this context. If not, the uplevel reference will have to be via a class field.

This must be called in a context which is local to the client of the uplevel reference.

public Expression makeFieldReference (Environment env, Context ctx)

As with makeLocalReference(), build a locally-usable reference. Ignore the availability of local arguments; always use a class field.

public Expression makeLocalReference (Environment env, Context ctx)

Assuming noteReference() is all taken care of, build an uplevel reference.

This must be called in a context which is local to the client of the uplevel reference.

public void noteReference (Environment env, Context ctx)

Process an uplevel reference. The only decision to make at this point is whether to build a "localField" instance variable, which is done (lazily) when localArgumentAvailable() proves false.

public String toString ()

Returns a string representation of the object. In general, the toString method returns a string that "textually represents" this object. The result should be a concise but informative representation that is easy for a person to read. It is recommended that all subclasses override this method.

The toString method for class Object returns a string consisting of the name of the class of which the object is an instance, the at-sign character `@', and the unsigned hexadecimal representation of the hash code of the object. In other words, this method returns a string equal to the value of:

 getClass().getName() + '@' + Integer.toHexString(hashCode())
 

Returns
  • a string representation of the object.

public void willCodeArguments (Environment env, Context ctx)

During the inline phase, call this on a list of references for which the code phase will later emit arguments. It will make sure that any "double-uplevel" values needed by the callee are also present at the call site.

If any reference is a "ClientOuterField", it is skipped by this method (and by willCodeArguments). This is because