private long writeLongFromHeapIndex(int index, long prev) throws IOException { final long v = longHeapObj.getHeapValue(heap[index]); writeLong(v, prev); return v; }
private long writeLongFromHeapIndex(int index, long prev) throws IOException { final long v = longHeapObj.getHeapValue(heap[index]); writeLong(v, prev); return v; }
public long ll_getLongValue(int offset) { return this.getLongHeap().getHeapValue(offset); }
public double ll_getDoubleValueFeatOffset(int fsRef, int featureOffset) { final int offset = this.getHeap().heap[fsRef + featureOffset]; long val = this.getLongHeap().getHeapValue(offset); return Double.longBitsToDouble(val); }
@Override public double ll_getDoubleValue(int fsRef, int featureCode) { final int offset = this.getHeap().heap[fsRef + this.svd.casMetadata.featureOffset[featureCode]]; long val = this.getLongHeap().getHeapValue(offset); return Double.longBitsToDouble(val); }
@Override public long ll_getLongValue(int fsRef, int featureCode) { final int offset = this.getHeap().heap[fsRef + this.svd.casMetadata.featureOffset[featureCode]]; long val = this.getLongHeap().getHeapValue(offset); return (val); }
public long ll_getLongValueFeatOffset(int fsRef, int featureOffset) { final int offset = this.getHeap().heap[fsRef + featureOffset]; long val = this.getLongHeap().getHeapValue(offset); return (val); }
return sb.append(cas.getStringForCode(heap[iHeap + offset])); case Slot_LongRef: return sb.append(String.format("%,d", cas.getLongHeap().getHeapValue(heap[iHeap + offset]))); case Slot_DoubleRef: { long v = cas.getLongHeap().getHeapValue(heap[iHeap + offset]); return sb.append(Double.longBitsToDouble(v)).append(' ').append(Long.toHexString(v));
return sb.append(cas.getStringForCode(heap[iHeap + offset])); case Slot_LongRef: return sb.append(String.format("%,d", cas.getLongHeap().getHeapValue(heap[iHeap + offset]))); case Slot_DoubleRef: { long v = cas.getLongHeap().getHeapValue(heap[iHeap + offset]); return sb.append(Double.longBitsToDouble(v)).append(' ').append(Long.toHexString(v));
@Override public double ll_getDoubleArrayValue(int fsRef, int position) { final int pos = this.getHeap().heap[getArrayStartAddress(fsRef)]; long val = this.getLongHeap().getHeapValue(pos + position); return Double.longBitsToDouble(val); }
break; case Slot_LongRef: case Slot_DoubleRef: { long v = cas.getLongHeap().getHeapValue(heap[iHeap + 2 + i]); if (arrayElementKind == Slot_DoubleRef) { sb.append(Double.longBitsToDouble(v));
break; case Slot_LongRef: case Slot_DoubleRef: { long v = cas.getLongHeap().getHeapValue(heap[iHeap + 2 + i]); if (arrayElementKind == Slot_DoubleRef) { sb.append(Double.longBitsToDouble(v));
private boolean compareSlot(int offset) { SlotKind kind = typeInfo.getSlotKind(offset); switch (kind) { case Slot_Int: case Slot_Short: case Slot_Boolean: case Slot_Byte: case Slot_Float: case Slot_HeapRef: return c1heap[iHeap + offset] == c2heap[iHeap + offset]; case Slot_StrRef: return compareStrings(c1.getStringForCode(c1heap[iHeap + offset]), c2.getStringForCode(c2heap[iHeap + offset])); case Slot_LongRef: case Slot_DoubleRef: return c1.getLongHeap().getHeapValue(c1heap[iHeap + offset]) == c2.getLongHeap().getHeapValue(c2heap[iHeap + offset]); default: throw new RuntimeException("internal error"); } }
@Override public long ll_getLongArrayValue(int fsRef, int position) { final int pos = this.getHeap().heap[getArrayStartAddress(fsRef)]; return this.getLongHeap().getHeapValue(pos + position); }
break; case Slot_DoubleRef: writeDouble(longHeapObj.getHeapValue(heap[nextMainHeapIndex])); break; default:
private void serializeByKind(int iHeap, int offset) throws IOException { SlotKind kind = typeInfo.getSlotKind(offset); switch (kind) { //Slot_Int, Slot_Float, Slot_Boolean, Slot_Byte, Slot_Short case Slot_Int: case Slot_Short: case Slot_HeapRef: serializeDiffWithPrevTypeSlot(kind, iHeap, offset); break; case Slot_Float: writeFloat(heap[iHeap + offset]); break; case Slot_Boolean: case Slot_Byte: byte_dos.write(heap[iHeap + offset]); break; case Slot_StrRef: writeString(stringHeapObj.getStringForCode(heap[iHeap + offset])); break; case Slot_LongRef: writeLongFromHeapIndex(iHeap + offset, (iPrevHeap == 0) ? 0L : longHeapObj.getHeapValue(heap[iPrevHeap + offset])); break; case Slot_DoubleRef: writeDouble(longHeapObj.getHeapValue(heap[iHeap + offset])); break; default: throw new RuntimeException("internal error"); } // end of switch }
private void serializeByKind(int iHeap, int offset) throws IOException { SlotKind kind = typeInfo.getSlotKind(offset); switch (kind) { //Slot_Int, Slot_Float, Slot_Boolean, Slot_Byte, Slot_Short case Slot_Int: case Slot_Short: case Slot_HeapRef: serializeDiffWithPrevTypeSlot(kind, iHeap, offset); break; case Slot_Float: writeFloat(heap[iHeap + offset]); break; case Slot_Boolean: case Slot_Byte: byte_dos.write(heap[iHeap + offset]); break; case Slot_StrRef: writeString(stringHeapObj.getStringForCode(heap[iHeap + offset])); break; case Slot_LongRef: writeLongFromHeapIndex(iHeap + offset, (iPrevHeap == 0) ? 0L : longHeapObj.getHeapValue(heap[iPrevHeap + offset])); break; case Slot_DoubleRef: writeDouble(longHeapObj.getHeapValue(heap[iHeap + offset])); break; default: throw new RuntimeException("internal error"); } // end of switch }
private boolean compareSlot(int offsetSrc, int offsetTgt) { SlotKind kind = typeInfo.getSlotKind(offsetSrc); switch (kind) { case Slot_Int: case Slot_Short: case Slot_Boolean: case Slot_Byte: case Slot_Float: return c1heap[c1heapIndex + offsetSrc] == c2heap[c2heapIndex + offsetTgt]; case Slot_HeapRef: { final int c1ref = c1heap[c1heapIndex + offsetSrc]; final int c2ref = c2heap[c2heapIndex + offsetTgt]; return diagnoseMiscompareHeapRef(c1ref, c2ref, offsetSrc); // if (!isInstanceInTgtTs(c1ref)) { // // source ref is for type not in target. Target value should be 0 // return (c2ref == 0); // } // return ((c1ref == 0) && (c2ref == 0)) || // ((c1ref != 0) && (c2ref != 0) && // (addr2seq1.get(c1ref) == addr2seq2.get(c2ref))); } case Slot_StrRef: return compareStrings(c1.getStringForCode(c1heap[c1heapIndex + offsetSrc]), c2.getStringForCode(c2heap[c2heapIndex + offsetTgt])); case Slot_LongRef: case Slot_DoubleRef: return c1.getLongHeap().getHeapValue(c1heap[c1heapIndex + offsetSrc]) == c2.getLongHeap().getHeapValue(c2heap[c2heapIndex + offsetTgt]); default: throw new RuntimeException("internal error"); } }
vPrevModShort = v; } else { long v = longHeapObj.getHeapValue(nextModAuxIndex); if (kind == Slot_LongRef) { writeLong(v, vPrevModLong);
private String getTraceRepOfObj( FeatureImpl fi, int v) { TypeImpl range = (TypeImpl) fi.getRange(); int rangeCode = range.getCode(); if (ll_isRefType(rangeCode)) { if (v == 0) return "null"; // FeatureStructureImpl fs = ll_getFSForRef(v); Type type = getTypeSystemImpl().ll_getTypeForCode(getTypeCode(v)); return ((type == null) ? "unknwn" : MiscImpl.elide(type.getShortName(), 5, false)) + ':' + v; } else if (isStringType(rangeCode)){ String s = this.getStringHeap().getStringForCode(v); s = MiscImpl.elide(s, 50, false); return MiscImpl.replaceWhiteSpace(s, "_"); } else if (isFloatType(rangeCode)) { return Float.toString(int2float(v)); } else if (isBooleanType(rangeCode)) { return (v == 1) ? "true" : "false"; } else if (isLongType(rangeCode)) { return Long.toString(this.getLongHeap().getHeapValue(v)); } else if (isDoubleType(rangeCode)) { return Double.toString(long2double(this.getLongHeap().getHeapValue(v))); } else { return Integer.toString(v); } }