Commit ea45e61b authored by George Rayns's avatar George Rayns

Extra debugging and other things

parent 2990e693
......@@ -367,11 +367,14 @@ class MuCtx(val ctxID: MuInternalID, _mutator: Mutator)(
MemoryOperations.load(ptr, uty, addr, nb)
print("Loading: " + nb + "\n")
addHandle(MuValue(uty, nb))
}
/** Store to a location. */
def store(ord: MemoryOrder, loc: MuIRefValue, newVal: MuValue): Unit = {
print("Storing: " + newVal + "\n")
val (ptr, ty) = loc.ty match {
case TypeIRef(t) => (false, t)
}
......
......@@ -462,7 +462,6 @@ object MemoryOperations {
case _ => throw new UvmUnimplementedOperationException(
"Loading int of length %d is not supported".format(l))
}
logger.debug("Loaded: " + bi)
br.asInstanceOf[BoxInt].value = OpHelper.unprepare(bi, l)
case _: TypeFloat =>
val fv = memorySupport.loadFloat(loc, !ptr)
......
......@@ -3,6 +3,7 @@ package uvm.refimpl.mem
import uvm._
import uvm.refimpl._
import uvm.refimpl.integerize._
import uvm.refimpl.itpr.InterpreterThread.logger
import uvm.refimpl.nat.NativeSupport
import uvm.ssavariables.AtomicRMWOptr._
......@@ -40,7 +41,8 @@ class MemorySupport(val muMemorySize: Word) extends AutoCloseable {
def loadByte(addr: Word, inMu: Boolean = true): Byte = { assertInMuMemory(inMu, addr); theMemory.getByte(addr) }
def loadShort(addr: Word, inMu: Boolean = true): Short = { assertInMuMemory(inMu, addr); theMemory.getShort(addr) }
def loadInt(addr: Word, inMu: Boolean = true): Int = { assertInMuMemory(inMu, addr); theMemory.getInt(addr) }
def loadLong(addr: Word, inMu: Boolean = true): Long = { assertInMuMemory(inMu, addr); theMemory.getLong(addr) }
def loadLong(addr: Word, inMu: Boolean = true): Long = { assertInMuMemory(inMu, addr); val v = theMemory.getLong(addr);
logger.debug("Loaded: " + v); v}
def loadI128(addr: Word, inMu: Boolean = true): (Long, Long) = { assertInMuMemory(inMu, addr); (theMemory.getLong(addr), theMemory.getLong(addr + 8)) }
def loadFloat(addr: Word, inMu: Boolean = true): Float = { assertInMuMemory(inMu, addr); theMemory.getFloat(addr) }
def loadDouble(addr: Word, inMu: Boolean = true): Double = { assertInMuMemory(inMu, addr); theMemory.getDouble(addr) }
......@@ -48,7 +50,8 @@ class MemorySupport(val muMemorySize: Word) extends AutoCloseable {
def storeByte(addr: Word, v: Byte, inMu: Boolean = true): Unit = { assertInMuMemory(inMu, addr); theMemory.putByte(addr, v) }
def storeShort(addr: Word, v: Short, inMu: Boolean = true): Unit = { assertInMuMemory(inMu, addr); theMemory.putShort(addr, v) }
def storeInt(addr: Word, v: Int, inMu: Boolean = true): Unit = { assertInMuMemory(inMu, addr); theMemory.putInt(addr, v) }
def storeLong(addr: Word, v: Long, inMu: Boolean = true): Unit = { assertInMuMemory(inMu, addr); theMemory.putLong(addr, v) }
def storeLong(addr: Word, v: Long, inMu: Boolean = true): Unit = { assertInMuMemory(inMu, addr); theMemory.putLong(addr, v);
logger.debug("Stored: " + v) }
def storeI128(addr: Word, v: (Long, Long), inMu: Boolean = true): Unit = { assertInMuMemory(inMu, addr); val (low, high) = v; theMemory.putLong(addr, low); theMemory.putLong(addr + 8, high) }
def storeFloat(addr: Word, v: Float, inMu: Boolean = true): Unit = { assertInMuMemory(inMu, addr); theMemory.putFloat(addr, v) }
def storeDouble(addr: Word, v: Double, inMu: Boolean = true): Unit = { assertInMuMemory(inMu, addr); theMemory.putDouble(addr, v) }
......
......@@ -605,7 +605,14 @@ class BundleChecker {
}
}
case i: InstGetFieldIRef => {
checkPtrAndOpnd(i.ptr, i.opnd.inferredType)
try {
checkPtrAndOpnd(i.ptr, i.opnd.inferredType)
} catch {
case fbi: StaticCheckingException => {
println(s"The operand was: ${i.opnd}")
throw fbi
}
}
i.referentTy match {
case _: AbstractStructType =>
case ty => {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment