allit=cn.getFieldTable().getAllDescriptorsIterator();
while(allit.hasNext()) {
FieldDescriptor fd=(FieldDescriptor)allit.next();
- if(fd.isStatic() || fd.isVolatile()) {
+ if(fd.isStatic() /*|| fd.isVolatile()*/) {
continue;
}
TypeDescriptor type=fd.getType();
public void generateFlatOffsetNode(FlatMethod fm, FlatOffsetNode fofn, PrintWriter output) {
output.println("/* FlatOffsetNode */");
FieldDescriptor fd=fofn.getField();
- if(!fd.isStatic() && !fd.isVolatile()) {
+ if(!fd.isStatic() /*&& !fd.isVolatile()*/) {
output.println(generateTemp(fm, fofn.getDst())+ " = (short)(int) (&((struct "+fofn.getClassType().getSafeSymbol() +" *)0)->"+
fd.getSafeSymbol()+");");
}
}
protected void generateFlatFieldNode(FlatMethod fm, FlatFieldNode ffn, PrintWriter output) {
- if(ffn.getField().isStatic() || ffn.getField().isVolatile()) {
+ if(ffn.getField().isStatic()/* || ffn.getField().isVolatile()*/) {
// static field
if((fm.getMethod().isStaticBlock()) || (fm.getMethod().isInvokedByStatic()/* && mgcstaticinit*/)) {
// is a static block or is invoked in some static block
}
}
// redirect to the global_defs_p structure
- if((ffn.getField().isStatic()) || (ffn.getField().isVolatile()) || (ffn.getSrc().getType().isClassNameRef())) {
+ if((ffn.getField().isStatic()) || (ffn.getSrc().getType().isClassNameRef())) {
// reference to the static field with Class name
if (ffn.getField().getType().isPtr())
output.println(generateTemp(fm, ffn.getDst())+"=global_defs_p->"+ffn.getField().getSafeSymbol()+";");
}
}
// redirect to the global_defs_p structure
- if((fsfn.getDst().getType().isClassNameRef()) || (fsfn.getField().isStatic()) || (fsfn.getField().isVolatile())) {
+ if((fsfn.getDst().getType().isClassNameRef()) || (fsfn.getField().isStatic()) /*|| (fsfn.getField().isVolatile())*/) {
// reference to the static field with Class name
if (fsfn.getField().getType().isPtr())
output.println("global_defs_p->" +
public void createFullTable() {
subclasstable=new Hashtable();
- //subIFclasstable = new Hashtable();
HashSet tovisit=new HashSet();
HashSet visited=new HashSet();
Iterator classit=state.getClassSymbolTable().getDescriptorsIterator();
while(classit.hasNext()) {
+ tovisit.clear();
+ visited.clear();
ClassDescriptor cd=(ClassDescriptor)classit.next();
ClassDescriptor tmp=cd.getSuperDesc();
- // check tmp's interface ancestors
+ // check cd's interface ancestors
{
Iterator it_sifs = cd.getSuperInterfaces();
while(it_sifs.hasNext()) {
if(!this.subclasstable.containsKey(sif)) {
this.subclasstable.put(sif, new HashSet());
}
- HashSet hs = (HashSet)this.subclasstable/*subIFclasstable*/.get(sif);
+ HashSet hs = (HashSet)this.subclasstable.get(sif);
hs.add(cd);
Iterator it_sifs = sif.getSuperInterfaces();
public interface Instrument {
// Compile-time constant:
- int VALUE;// = 5; // static & final
+ int VALUE = 5; // static & final
// Cannot have method definitions:
void play(int n); // Automatically public
void adjust();
}
public static void main(String[] args) {
// Upcasting during addition to the array:
- Instrument.VALUE=5;
Instrument[] orchestra = new Instrument[5];
orchestra[0] = new Wind();
orchestra[1] = new Percussion();