public RawClassSpec readSpec(Transaction trans, ByteArrayBuffer reader) {
   byte[] nameBytes = readName(trans, reader);
   String className = trans.container().stringIO().read(nameBytes);
   readMetaClassID(reader); // skip
   int ancestorID = reader.readInt();
   reader.incrementOffset(Const4.INT_LENGTH); // index ID
   int numFields = reader.readInt();
   return new RawClassSpec(className, ancestorID, numFields);
 }
Esempio n. 2
0
 public Slot debugReadPointerSlot(int id) {
   if (Deploy.debug) {
     readBytes(_pointerIo._buffer, id, Const4.POINTER_LENGTH);
     _pointerIo.seek(0);
     _pointerIo.readBegin(Const4.YAPPOINTER);
     int debugAddress = _pointerIo.readInt();
     int debugLength = _pointerIo.readInt();
     _pointerIo.readEnd();
     return new Slot(debugAddress, debugLength);
   }
   return null;
 }
 public Object read(ByteArrayBuffer buffer) {
   int size = buffer.readInt();
   int address = buffer.readInt();
   if (size > sizeLimit) {
     FreeSlotNode node = new FreeSlotNode(size);
     node.createPeer(address);
     if (Deploy.debug && Debug.xbytes) {
       debugCheckBuffer(buffer, node);
     }
     return node;
   }
   return null;
 }
  public final void read(ObjectContainerBase stream, ClassMetadata clazz, ByteArrayBuffer reader) {
    clazz.setAncestor(stream.classMetadataForId(reader.readInt()));

    if (clazz.callConstructor()) {
      // The logic further down checks the ancestor YapClass, whether
      // or not it is allowed, not to call constructors. The ancestor
      // YapClass may possibly have not been loaded yet.
      clazz.createConstructor(stream, clazz.classReflector(), clazz.getName(), true);
    }

    clazz.checkType();

    readIndex(stream, clazz, reader);

    clazz._aspects = createFields(clazz, reader.readInt());
    readFields(stream, reader, clazz._aspects);
  }
 private byte[] readName(LatinStringIO sio, ByteArrayBuffer reader) {
   if (Deploy.debug) {
     reader.readBegin(Const4.YAPCLASS);
   }
   int len = reader.readInt();
   len = len * sio.bytesPerChar();
   byte[] nameBytes = new byte[len];
   System.arraycopy(reader._buffer, reader._offset, nameBytes, 0, len);
   nameBytes = Platform4.updateClassName(nameBytes);
   reader.incrementOffset(len);
   return nameBytes;
 }
Esempio n. 6
0
 public Object read(ByteArrayBuffer reader) {
   SlotChange change = new SlotChange(reader.readInt());
   Slot newSlot = new Slot(reader.readInt(), reader.readInt());
   change.newSlot(newSlot);
   return change;
 }
 public final int readMetaClassID(ByteArrayBuffer reader) {
   return reader.readInt();
 }