< prev index next >

agent/src/share/classes/sun/jvm/hotspot/oops/Method.java

Print this page
rev 4134 : 7178145: Change constMethodOop::_exception_table to optionally inlined u2 table.
Summary: Change constMethodOop::_exception_table to optionally inlined u2 table.
Reviewed-by: bdelsart, coleenp, kamg


 110     }
 111     return objectInitializerName;
 112   }
 113   private static Symbol classInitializerName() {
 114     if (classInitializerName == null) {
 115       classInitializerName = VM.getVM().getSymbolTable().probe("<clinit>");
 116     }
 117     return classInitializerName;
 118   }
 119 
 120 
 121   /*
 122   private static AddressCField       interpreterEntry;
 123   private static AddressCField       fromCompiledCodeEntryPoint;
 124   */
 125 
 126   // Accessors for declared fields
 127   public ConstMethod  getConstMethod()                { return (ConstMethod)  constMethod.getValue(this);       }
 128   public ConstantPool getConstants()                  { return (ConstantPool) constants.getValue(this);         }
 129   public MethodData   getMethodData()                 { return (MethodData) methodData.getValue(this);          }
 130   public TypeArray    getExceptionTable()             { return getConstMethod().getExceptionTable();            }
 131   /** WARNING: this is in words, not useful in this system; use getObjectSize() instead */
 132   public long         getMethodSize()                 { return                methodSize.getValue(this);        }
 133   public long         getMaxStack()                   { return                maxStack.getValue(this);          }
 134   public long         getMaxLocals()                  { return                maxLocals.getValue(this);         }
 135   public long         getSizeOfParameters()           { return                sizeOfParameters.getValue(this);  }
 136   public long         getNameIndex()                  { return                getConstMethod().getNameIndex();  }
 137   public long         getSignatureIndex()             { return            getConstMethod().getSignatureIndex(); }
 138   public long         getGenericSignatureIndex()      { return     getConstMethod().getGenericSignatureIndex(); }
 139   public long         getAccessFlags()                { return                accessFlags.getValue(this);       }
 140   public long         getCodeSize()                   { return                getConstMethod().getCodeSize();   }
 141   public long         getVtableIndex()                { return                vtableIndex.getValue(this);       }
 142   public long         getInvocationCounter()          {
 143     if (Assert.ASSERTS_ENABLED) {
 144       Assert.that(!VM.getVM().isCore(), "must not be used in core build");
 145     }
 146     return invocationCounter.getValue(this);
 147   }
 148   public long         getBackedgeCounter()          {
 149     if (Assert.ASSERTS_ENABLED) {
 150       Assert.that(!VM.getVM().isCore(), "must not be used in core build");


 310   public LocalVariableTableElement[] getLocalVariableTable() {
 311     return getConstMethod().getLocalVariableTable();
 312   }
 313 
 314   public Symbol getLocalVariableName(int bci, int slot) {
 315     if (! hasLocalVariableTable()) {
 316        return null;
 317     }
 318 
 319     LocalVariableTableElement[] locals = getLocalVariableTable();
 320     for (int l = 0; l < locals.length; l++) {
 321        LocalVariableTableElement local = locals[l];
 322        if ((bci >= local.getStartBCI()) &&
 323           (bci < (local.getStartBCI() + local.getLength())) &&
 324           slot == local.getSlot()) {
 325           return getConstants().getSymbolAt(local.getNameCPIndex());
 326        }
 327     }
 328 
 329     return null;








 330   }
 331 
 332   public boolean hasCheckedExceptions() {
 333     return getConstMethod().hasCheckedExceptions();
 334   }
 335 
 336   /** Should only be called if table is present */
 337   public CheckedExceptionElement[] getCheckedExceptions() {
 338     return getConstMethod().getCheckedExceptions();
 339   }
 340 
 341   /** Returns name and signature in external form for debugging
 342       purposes */
 343   public String externalNameAndSignature() {
 344     final StringBuffer buf = new StringBuffer();
 345     buf.append(getMethodHolder().getName().asString());
 346     buf.append(".");
 347     buf.append(getName().asString());
 348     buf.append("(");
 349     new SignatureConverter(getSignature(), buf).iterateParameters();


 110     }
 111     return objectInitializerName;
 112   }
 113   private static Symbol classInitializerName() {
 114     if (classInitializerName == null) {
 115       classInitializerName = VM.getVM().getSymbolTable().probe("<clinit>");
 116     }
 117     return classInitializerName;
 118   }
 119 
 120 
 121   /*
 122   private static AddressCField       interpreterEntry;
 123   private static AddressCField       fromCompiledCodeEntryPoint;
 124   */
 125 
 126   // Accessors for declared fields
 127   public ConstMethod  getConstMethod()                { return (ConstMethod)  constMethod.getValue(this);       }
 128   public ConstantPool getConstants()                  { return (ConstantPool) constants.getValue(this);         }
 129   public MethodData   getMethodData()                 { return (MethodData) methodData.getValue(this);          }

 130   /** WARNING: this is in words, not useful in this system; use getObjectSize() instead */
 131   public long         getMethodSize()                 { return                methodSize.getValue(this);        }
 132   public long         getMaxStack()                   { return                maxStack.getValue(this);          }
 133   public long         getMaxLocals()                  { return                maxLocals.getValue(this);         }
 134   public long         getSizeOfParameters()           { return                sizeOfParameters.getValue(this);  }
 135   public long         getNameIndex()                  { return                getConstMethod().getNameIndex();  }
 136   public long         getSignatureIndex()             { return            getConstMethod().getSignatureIndex(); }
 137   public long         getGenericSignatureIndex()      { return     getConstMethod().getGenericSignatureIndex(); }
 138   public long         getAccessFlags()                { return                accessFlags.getValue(this);       }
 139   public long         getCodeSize()                   { return                getConstMethod().getCodeSize();   }
 140   public long         getVtableIndex()                { return                vtableIndex.getValue(this);       }
 141   public long         getInvocationCounter()          {
 142     if (Assert.ASSERTS_ENABLED) {
 143       Assert.that(!VM.getVM().isCore(), "must not be used in core build");
 144     }
 145     return invocationCounter.getValue(this);
 146   }
 147   public long         getBackedgeCounter()          {
 148     if (Assert.ASSERTS_ENABLED) {
 149       Assert.that(!VM.getVM().isCore(), "must not be used in core build");


 309   public LocalVariableTableElement[] getLocalVariableTable() {
 310     return getConstMethod().getLocalVariableTable();
 311   }
 312 
 313   public Symbol getLocalVariableName(int bci, int slot) {
 314     if (! hasLocalVariableTable()) {
 315        return null;
 316     }
 317 
 318     LocalVariableTableElement[] locals = getLocalVariableTable();
 319     for (int l = 0; l < locals.length; l++) {
 320        LocalVariableTableElement local = locals[l];
 321        if ((bci >= local.getStartBCI()) &&
 322           (bci < (local.getStartBCI() + local.getLength())) &&
 323           slot == local.getSlot()) {
 324           return getConstants().getSymbolAt(local.getNameCPIndex());
 325        }
 326     }
 327 
 328     return null;
 329   }
 330 
 331   public boolean hasExceptionTable() {
 332     return getConstMethod().hasExceptionTable();
 333   }
 334 
 335   public ExceptionTableElement[] getExceptionTable() {
 336     return getConstMethod().getExceptionTable();
 337   }
 338 
 339   public boolean hasCheckedExceptions() {
 340     return getConstMethod().hasCheckedExceptions();
 341   }
 342 
 343   /** Should only be called if table is present */
 344   public CheckedExceptionElement[] getCheckedExceptions() {
 345     return getConstMethod().getCheckedExceptions();
 346   }
 347 
 348   /** Returns name and signature in external form for debugging
 349       purposes */
 350   public String externalNameAndSignature() {
 351     final StringBuffer buf = new StringBuffer();
 352     buf.append(getMethodHolder().getName().asString());
 353     buf.append(".");
 354     buf.append(getName().asString());
 355     buf.append("(");
 356     new SignatureConverter(getSignature(), buf).iterateParameters();
< prev index next >