Exemplo n.º 1
0
 /** Get the String stored at a particular index of a class's constant pool. */
 public static OPT_StringConstantOperand getStringFromConstantPool(VM_Class klass, int index) {
   Offset offset = klass.getLiteralOffset(index);
   try {
     String val;
     val = (String) VM_Statics.getSlotContentsAsObject(offset);
     return new OPT_StringConstantOperand(val, offset);
   } catch (ClassCastException e) {
     throw new Error("Corrupt JTOC at offset " + offset.toInt(), e);
   }
 }
Exemplo n.º 2
0
 /** Get the long stored at a particular index of a class's constant pool. */
 public static OPT_LongConstantOperand getLongFromConstantPool(VM_Class klass, int index) {
   Offset offset = klass.getLiteralOffset(index);
   long val = VM_Statics.getSlotContentsAsLong(offset);
   return new OPT_LongConstantOperand(val, offset);
 }
Exemplo n.º 3
0
 /** Get the double stored at a particular index of a class's constant pool. */
 public static OPT_DoubleConstantOperand getDoubleFromConstantPool(VM_Class klass, int index) {
   Offset offset = klass.getLiteralOffset(index);
   long val_raw = VM_Statics.getSlotContentsAsLong(offset);
   double val = Double.longBitsToDouble(val_raw);
   return new OPT_DoubleConstantOperand(val, offset);
 }
Exemplo n.º 4
0
 /** Get the float stored at a particular index of a class's constant pool. */
 public static OPT_FloatConstantOperand getFloatFromConstantPool(VM_Class klass, int index) {
   Offset offset = klass.getLiteralOffset(index);
   int val_raw = VM_Statics.getSlotContentsAsInt(offset);
   float val = Float.intBitsToFloat(val_raw);
   return new OPT_FloatConstantOperand(val, offset);
 }
Exemplo n.º 5
0
 /** Get the integer stored at a particular index of a class's constant pool. */
 public static OPT_IntConstantOperand getIntFromConstantPool(VM_Class klass, int index) {
   Offset offset = klass.getLiteralOffset(index);
   int val = VM_Statics.getSlotContentsAsInt(offset);
   return new OPT_IntConstantOperand(val);
 }