public void iterateFields(OopVisitor visitor, boolean doVMFields) {
   super.iterateFields(visitor, doVMFields);
   if (doVMFields) {
     visitor.doOop(elementKlass, true);
     visitor.doOop(bottomKlass, true);
   }
 }
Esempio n. 2
0
 public void iterateFields(OopVisitor visitor, boolean doVMFields) {
   super.iterateFields(visitor, doVMFields);
   if (doVMFields) {
     visitor.doCInt(dimension, true);
     visitor.doOop(higherDimension, true);
     visitor.doOop(lowerDimension, true);
     visitor.doCInt(vtableLen, true);
     visitor.doCInt(allocSize, true);
     visitor.doOop(componentMirror, true);
   }
 }
 public void iterateFields(OopVisitor visitor, boolean doVMFields) {
   super.iterateFields(visitor, doVMFields);
   TypeArrayKlass klass = (TypeArrayKlass) getKlass();
   int length = (int) getLength();
   int type = (int) klass.getElementType();
   for (int index = 0; index < length; index++) {
     FieldIdentifier id = new IndexableFieldIdentifier(index);
     switch (type) {
       case TypeArrayKlass.T_BOOLEAN:
         {
           long offset =
               baseOffsetInBytes(BasicType.T_BOOLEAN) + index * getHeap().getBooleanSize();
           visitor.doBoolean(new BooleanField(id, offset, false), false);
           break;
         }
       case TypeArrayKlass.T_CHAR:
         {
           long offset = baseOffsetInBytes(BasicType.T_CHAR) + index * getHeap().getCharSize();
           visitor.doChar(new CharField(id, offset, false), false);
           break;
         }
       case TypeArrayKlass.T_FLOAT:
         {
           long offset = baseOffsetInBytes(BasicType.T_FLOAT) + index * getHeap().getFloatSize();
           visitor.doFloat(new FloatField(id, offset, false), false);
           break;
         }
       case TypeArrayKlass.T_DOUBLE:
         {
           long offset = baseOffsetInBytes(BasicType.T_DOUBLE) + index * getHeap().getDoubleSize();
           visitor.doDouble(new DoubleField(id, offset, false), false);
           break;
         }
       case TypeArrayKlass.T_BYTE:
         {
           long offset = baseOffsetInBytes(BasicType.T_BYTE) + index * getHeap().getByteSize();
           visitor.doByte(new ByteField(id, offset, false), false);
           break;
         }
       case TypeArrayKlass.T_SHORT:
         {
           long offset = baseOffsetInBytes(BasicType.T_SHORT) + index * getHeap().getShortSize();
           visitor.doShort(new ShortField(id, offset, false), false);
           break;
         }
       case TypeArrayKlass.T_INT:
         {
           long offset = baseOffsetInBytes(BasicType.T_INT) + index * getHeap().getIntSize();
           visitor.doInt(new IntField(id, offset, false), false);
           break;
         }
       case TypeArrayKlass.T_LONG:
         {
           long offset = baseOffsetInBytes(BasicType.T_LONG) + index * getHeap().getLongSize();
           visitor.doLong(new LongField(id, offset, false), false);
           break;
         }
     }
   }
 }
Esempio n. 4
0
 public void iterateFields(OopVisitor visitor, boolean doVMFields) {
   super.iterateFields(visitor, doVMFields);
   if (doVMFields) {
     visitor.doOop(constants, true);
     for (int i = 0; i < getLength(); i++) {
       ConstantPoolCacheEntry entry = getEntryAt(i);
       entry.iterateFields(visitor);
     }
   }
 }
Esempio n. 5
0
 public void iterateFields(OopVisitor visitor, boolean doVMFields) {
   super.iterateFields(visitor, doVMFields);
   if (doVMFields) {
     visitor.doOop(constMethod, true);
     visitor.doOop(constants, true);
     visitor.doCInt(methodSize, true);
     visitor.doCInt(maxStack, true);
     visitor.doCInt(maxLocals, true);
     visitor.doCInt(sizeOfParameters, true);
     visitor.doCInt(accessFlags, true);
   }
 }
 private void visitField(OopVisitor visitor, FieldType type, int index) {
   Field f = newField(index);
   if (type.isOop()) {
     visitor.doOop((OopField) f, false);
     return;
   }
   if (type.isByte()) {
     visitor.doByte((ByteField) f, false);
     return;
   }
   if (type.isChar()) {
     visitor.doChar((CharField) f, false);
     return;
   }
   if (type.isDouble()) {
     visitor.doDouble((DoubleField) f, false);
     return;
   }
   if (type.isFloat()) {
     visitor.doFloat((FloatField) f, false);
     return;
   }
   if (type.isInt()) {
     visitor.doInt((IntField) f, false);
     return;
   }
   if (type.isLong()) {
     visitor.doLong((LongField) f, false);
     return;
   }
   if (type.isShort()) {
     visitor.doShort((ShortField) f, false);
     return;
   }
   if (type.isBoolean()) {
     visitor.doBoolean((BooleanField) f, false);
     return;
   }
 }
Esempio n. 7
0
  public void iterateFields(OopVisitor visitor, boolean doVMFields) {
    super.iterateFields(visitor, doVMFields);
    if (doVMFields) {
      visitor.doOop(tags, true);
      visitor.doOop(cache, true);
      visitor.doOop(poolHolder, true);

      final int length = (int) getLength();
      // zero'th pool entry is always invalid. ignore it.
      for (int index = 1; index < length; index++) {
        int ctag = (int) getTags().getByteAt((int) index);
        switch (ctag) {
          case JVM_CONSTANT_ClassIndex:
          case JVM_CONSTANT_StringIndex:
          case JVM_CONSTANT_Integer:
            visitor.doInt(
                new IntField(new NamedFieldIdentifier(nameForTag(ctag)), indexOffset(index), true),
                true);
            break;

          case JVM_CONSTANT_Float:
            visitor.doFloat(
                new FloatField(
                    new NamedFieldIdentifier(nameForTag(ctag)), indexOffset(index), true),
                true);
            break;

          case JVM_CONSTANT_Long:
            visitor.doLong(
                new LongField(new NamedFieldIdentifier(nameForTag(ctag)), indexOffset(index), true),
                true);
            // long entries occupy two slots
            index++;
            break;

          case JVM_CONSTANT_Double:
            visitor.doDouble(
                new DoubleField(
                    new NamedFieldIdentifier(nameForTag(ctag)), indexOffset(index), true),
                true);
            // double entries occupy two slots
            index++;
            break;

          case JVM_CONSTANT_UnresolvedClass:
          case JVM_CONSTANT_Class:
          case JVM_CONSTANT_UnresolvedString:
          case JVM_CONSTANT_Utf8:
            visitor.doOop(
                new OopField(new NamedFieldIdentifier(nameForTag(ctag)), indexOffset(index), true),
                true);
            break;

          case JVM_CONSTANT_Fieldref:
          case JVM_CONSTANT_Methodref:
          case JVM_CONSTANT_InterfaceMethodref:
          case JVM_CONSTANT_NameAndType:
            visitor.doInt(
                new IntField(new NamedFieldIdentifier(nameForTag(ctag)), indexOffset(index), true),
                true);
            break;
        }
      }
    }
    /*
    int length = getLength();
    for (int index = 0; index < length; index++) {
      long offset = baseOffset + (index + typeDataBase.getOopSize());
      visitor.doOop(new IndexableField(index, offset, false), getObjAt(index));
    }
    */
  }
  public void iterateFields(OopVisitor visitor, boolean doVMFields) {
    super.iterateFields(visitor, doVMFields);
    if (doVMFields) {
      visitor.doOop(arrayKlasses, true);
      visitor.doOop(methods, true);
      visitor.doOop(methodOrdering, true);
      visitor.doOop(localInterfaces, true);
      visitor.doOop(transitiveInterfaces, true);
      visitor.doCInt(nofImplementors, true);
      for (int i = 0; i < IMPLEMENTORS_LIMIT; i++) visitor.doOop(implementors[i], true);
      visitor.doOop(fields, true);
      visitor.doOop(constants, true);
      visitor.doOop(classLoader, true);
      visitor.doOop(protectionDomain, true);
      visitor.doOop(signers, true);
      visitor.doOop(sourceFileName, true);
      visitor.doOop(innerClasses, true);
      visitor.doCInt(nonstaticFieldSize, true);
      visitor.doCInt(staticFieldSize, true);
      visitor.doCInt(staticOopFieldSize, true);
      visitor.doCInt(nonstaticOopMapSize, true);
      visitor.doCInt(isMarkedDependent, true);
      visitor.doCInt(initState, true);
      visitor.doCInt(vtableLen, true);
      visitor.doCInt(itableLen, true);
    }

    TypeArray fields = getFields();
    int length = (int) fields.getLength();
    for (int index = 0; index < length; index += NEXT_OFFSET) {
      short accessFlags = fields.getShortAt(index + ACCESS_FLAGS_OFFSET);
      short signatureIndex = fields.getShortAt(index + SIGNATURE_INDEX_OFFSET);
      FieldType type = new FieldType((Symbol) getConstants().getObjAt(signatureIndex));
      AccessFlags access = new AccessFlags(accessFlags);
      if (access.isStatic()) {
        visitField(visitor, type, index);
      }
    }
  }
 public void iterateFields(OopVisitor visitor, boolean doVMFields) {
   super.iterateFields(visitor, doVMFields);
   if (doVMFields) {
     visitor.doCInt(maxLength, true);
   }
 }