public final class

Vset

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

Class Overview

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
Vset()
Create an empty Vset.
Public Methods
Vset addDAandJoinDU(Vset other)
Add in the definite assignment bits of another vset, but join the definite unassignment bits.
Vset addVar(int varNumber)
Note that a var is definitely assigned.
Vset addVarUnassigned(int varNumber)
Note that a var is definitely un-assigned.
Vset clearDeadEnd()
Replace canonical DEAD_END with a distinct but equivalent Vset.
Vset clearVar(int varNumber)
Retract any assertion about the var.
Vset copy()
Create an copy of the given Vset.
static Vset firstDAandSecondDU(Vset sourceDA, Vset sourceDU)
Construct a vset consisting of the DA bits of the first argument and the DU bits of the second argument.
boolean isDeadEnd()
Ask if this is a vset for a dead end.
boolean isReallyDeadEnd()
Ask if this is a vset for a dead end.
Vset join(Vset other)
Join with another vset.
Vset removeAdditionalVars(int varNumber)
Remove variables from the vset that are no longer part of a context.
boolean testVar(int varNumber)
Ask if a var is definitely assigned.
boolean testVarUnassigned(int varNumber)
Ask if a var is definitely un-assigned.
String toString()
Returns a string representation of the object.
int varLimit()
Return one larger than the highest bit set.
[Expand]
Inherited Methods
From class java.lang.Object

Public Constructors

public Vset ()

Create an empty Vset.

Public Methods

public Vset addDAandJoinDU (Vset other)

Add in the definite assignment bits of another vset, but join the definite unassignment bits. This unusual operation is used only for 'finally' blocks. The original vset 'this' is destroyed by this operation. (Part of fix for 4068688.)

public Vset addVar (int varNumber)

Note that a var is definitely assigned. (Side-effecting.)

public Vset addVarUnassigned (int varNumber)

Note that a var is definitely un-assigned. (Side-effecting.)

public Vset clearDeadEnd ()

Replace canonical DEAD_END with a distinct but equivalent Vset. The bits are unaltered, but the result does not answer true to 'isDeadEnd'.

Used mostly for error recovery, but see 'IfStatement.check', where it is used to implement the special-case treatment of statement reachability for such statements.

public Vset clearVar (int varNumber)

Retract any assertion about the var. This operation is ineffective on a dead-end. (Side-effecting.)

public Vset copy ()

Create an copy of the given Vset. (However, DEAD_END simply returns itself.)

public static Vset firstDAandSecondDU (Vset sourceDA, Vset sourceDU)

Construct a vset consisting of the DA bits of the first argument and the DU bits of the second argument. This is a higly unusual operation, as it implies a case where the flowgraph for DA analysis differs from that for DU analysis. It is only needed for analysing 'try' blocks. The result is a dead-end iff the first argument is dead-end. (Part of fix for 4068688.)

public boolean isDeadEnd ()

Ask if this is a vset for a dead end. Answer true only for the canonical dead-end, DEAD_END. A canonical dead-end is produced only as a result of a statement that cannot complete normally, as specified by the JLS. Due to the special-case rules for if-then and if-then-else, this may fail to detect actual unreachable code that could easily be identified.

public boolean isReallyDeadEnd ()

Ask if this is a vset for a dead end. Answer true for any dead-end. Since 'clearDeadEnd' has no effect on this predicate, if-then and if-then-else are handled in the more 'obvious' and precise way. This predicate is to be preferred for dead code elimination purposes. (Presently used in workaround for bug 4173473 in MethodExpression.java)

public Vset join (Vset other)

Join with another vset. This is set intersection. (Side-effecting.)

public Vset removeAdditionalVars (int varNumber)

Remove variables from the vset that are no longer part of a context. Zeroes are stored past varNumber. (Side-effecting.)

However, if this is a dead end, keep it so. That is, leave an infinite tail of bits set.

public boolean testVar (int varNumber)

Ask if a var is definitely assigned.

public boolean testVarUnassigned (int varNumber)

Ask if a var is definitely un-assigned. (This is not just the negation of testVar: It's possible for neither to be true.)

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 int varLimit ()

Return one larger than the highest bit set.