Commit 7fe83fed authored by Kunshan Wang's avatar Kunshan Wang

Batch renaming

KeepAlive -> Keepalive
Watchpoint -> WatchPoint
Fp -> FP
parent ffe3b088
......@@ -155,7 +155,7 @@ instBody
(caseVal+=value caseDest+=destClause )* '}' # InstSwitch
// Inter-function Control Flow
| 'CALL' funcCallBody excClause keepAliveClause # InstCall
| 'CALL' funcCallBody excClause keepaliveClause # InstCall
| 'TAILCALL' funcCallBody # InstTailCall
| 'RET' retVals # InstRet
......@@ -190,20 +190,20 @@ instBody
| 'FENCE' memord # InstFence
// Trap
| 'TRAP' typeList excClause keepAliveClause # InstTrap
| 'TRAP' typeList excClause keepaliveClause # InstTrap
| 'WATCHPOINT' wpid=intLiteral typeList
dis=destClause ena=destClause ('WPEXC' '(' wpExc=destClause ')')? keepAliveClause # InstWatchPoint
dis=destClause ena=destClause ('WPEXC' '(' wpExc=destClause ')')? keepaliveClause # InstWatchPoint
| 'WPBRANCH' wpid=intLiteral dis=destClause ena=destClause # InstWPBranch
// Foreign Function Interface
| 'CCALL' callConv=flag '<' funcTy=type funcSig '>' callee=value argList excClause keepAliveClause # InstCCall
| 'CCALL' callConv=flag '<' funcTy=type funcSig '>' callee=value argList excClause keepaliveClause # InstCCall
// Thread and Stack Operations
| 'NEWTHREAD' stack=value threadLocalClause? newStackClause excClause # InstNewThread
| 'SWAPSTACK' swappee=value curStackClause newStackClause excClause keepAliveClause # InstSwapStack
| 'SWAPSTACK' swappee=value curStackClause newStackClause excClause keepaliveClause # InstSwapStack
// Common Instructions
| 'COMMINST' nam=globalName flagList? typeList? funcSigList? argList? excClause keepAliveClause # InstCommInst
| 'COMMINST' nam=globalName flagList? typeList? funcSigList? argList? excClause keepaliveClause # InstCommInst
;
retVals
......@@ -231,7 +231,7 @@ excClause
: ('EXC' '(' nor=destClause exc=destClause ')')?
;
keepAliveClause
keepaliveClause
: ('KEEPALIVE' '(' value* ')')?
;
......
......@@ -400,8 +400,8 @@ private[text] class FunctionBuilderImpl(
replacements.put(n, n2)
n2
} else { used += n; n }
def mapKeepAlive(ka: Option[KeepAliveClause]) =
ka map (c => KeepAliveClause(new IList(c.vars map r collect {case lv: LocalVarName => lv})))
def mapKeepalive(ka: Option[KeepaliveClause]) =
ka map (c => KeepaliveClause(new IList(c.vars map r collect {case lv: LocalVarName => lv})))
def mapNewStackClause(c: NewStackClause): NewStackClause = c match {
case NewStackClause.PassValue(argTy, arg) => NewStackClause.PassValue(argTy, r(arg))
case i: NewStackClause.PassVoid => i
......@@ -419,7 +419,7 @@ private[text] class FunctionBuilderImpl(
case Select(condTy, opndTy, cond, ifTrue, ifFalse) =>
Select(condTy, opndTy, r(cond), r(ifTrue), r(ifFalse))
case Call(sig, callee, argList, ka) =>
Call(sig, r(callee), new IList(argList map r), mapKeepAlive(ka))
Call(sig, r(callee), new IList(argList map r), mapKeepalive(ka))
case TailCall(sig, callee, argList) =>
TailCall(sig, r(callee), new IList(argList map r))
case Ret(rv) => Ret(new IList(rv map r))
......@@ -452,14 +452,14 @@ private[text] class FunctionBuilderImpl(
case i: CmpXchg => i.copy(loc = r(i.loc), expected = r(i.expected), desired = r(i.desired))
case i: AtomicRMW => i.copy(loc = r(i.loc), opnd = r(i.opnd))
case i: Fence => i
case Trap(retTy, ka) => Trap(retTy, mapKeepAlive(ka))
case Trap(retTy, ka) => Trap(retTy, mapKeepalive(ka))
case i: CCall => i.copy(callee = r(i.callee), argList = new IList(i.argList map r),
keepAliveClause = mapKeepAlive(i.keepAliveClause))
keepaliveClause = mapKeepalive(i.keepaliveClause))
case NewThread(stack, nsClause) => NewThread(r(stack), mapNewStackClause(nsClause))
case SwapStack(swappee, csClause, nsClause, ka) =>
SwapStack(r(swappee), csClause, mapNewStackClause(nsClause), mapKeepAlive(ka))
SwapStack(r(swappee), csClause, mapNewStackClause(nsClause), mapKeepalive(ka))
case i: CommInst => i.copy(argList = i.argList map (l => new IList(l map r)),
keepAliveClause = mapKeepAlive(i.keepAliveClause))
keepaliveClause = mapKeepalive(i.keepaliveClause))
}
Some(new IList(names map l) -> postInst)
case Id(_, v) =>
......@@ -482,7 +482,7 @@ private[text] class FunctionBuilderImpl(
new IList(cases map (c => SwitchCase(r(c.value), mapDest(c.dest)))))))
case PreWatchPoint(wpid, retTy, dis, ena, exc, ka) =>
val post = PostWatchPoint(wpid, retTy, mapDest(dis), mapDest(ena), exc map mapDest,
mapKeepAlive(ka))
mapKeepalive(ka))
Some((new IList(names map l), post))
}
PostBasicBlock(
......
......@@ -206,20 +206,20 @@ object Inst {
sig: FuncSigName,
callee: VarName,
argList: IList[VarName],
keepAliveClause: Option[KeepAliveClause]
) extends PrePostInst(s"CALL <$sig> $callee ($argList)" + ?(keepAliveClause)) with SupportsExcClause {
keepaliveClause: Option[KeepaliveClause]
) extends PrePostInst(s"CALL <$sig> $callee ($argList)" + ?(keepaliveClause)) with SupportsExcClause {
def this(sig: FuncSigName, callee: VarName, argList: IList[VarName]) =
this(sig, callee, argList, None)
def this(sig: FuncSigName, callee: VarName, argList: IList[VarName], keepAliveClause: KeepAliveClause) =
this(sig, callee, argList, Some(keepAliveClause))
def this(sig: FuncSigName, callee: VarName, argList: IList[VarName], keepaliveClause: KeepaliveClause) =
this(sig, callee, argList, Some(keepaliveClause))
override def returnTypes(implicit context: Context) =
(for (FuncSig(_, retTypes) <- context resolve sig) yield retTypes) getOrElse {
throw TypeResolveException(s"Undefined function signature: $sig")
}
override def referencedVars =
new IList(callee +: (argList.toSeq ++ keepAliveClause.toSeq.flatMap(_.vars)))
new IList(callee +: (argList.toSeq ++ keepaliveClause.toSeq.flatMap(_.vars)))
override def preExcString = s"CALL <$sig> $callee ($argList)"
override def postExcString = ?(keepAliveClause)
override def postExcString = ?(keepaliveClause)
}
case class TailCall(sig: FuncSigName, callee: VarName, argList: IList[VarName])
......@@ -447,15 +447,15 @@ object Inst {
case class Trap(
retTy: IList[TypeName],
keepAliveClause: Option[KeepAliveClause]
) extends PrePostInst(s"TRAP <$retTy>" + ?(keepAliveClause)) with SupportsExcClause {
keepaliveClause: Option[KeepaliveClause]
) extends PrePostInst(s"TRAP <$retTy>" + ?(keepaliveClause)) with SupportsExcClause {
def this(retTy: IList[TypeName]) = this(retTy, None)
def this(retTy: IList[TypeName], keepAliveClause: KeepAliveClause) =
this(retTy, Some(keepAliveClause))
def this(retTy: IList[TypeName], keepaliveClause: KeepaliveClause) =
this(retTy, Some(keepaliveClause))
override def preExcString = s"TRAP <$retTy>"
override def postExcString = ?(keepAliveClause)
override def postExcString = ?(keepaliveClause)
override def returnTypes(implicit context: Context) = retTy
override def referencedVars = new IList(keepAliveClause.toSeq.flatMap(_.vars))
override def referencedVars = new IList(keepaliveClause.toSeq.flatMap(_.vars))
}
case class PreWatchPoint(
......@@ -464,12 +464,12 @@ object Inst {
dis: LabelName,
ena: LabelName,
exc: Option[LabelName],
keepAliveClause: Option[KeepAliveClause]
keepaliveClause: Option[KeepaliveClause]
) extends PreInst {
override def returnTypes(implicit context: Context) = retTy
override def toString =
s"WATCHPOINT $wpid <$retTy> $dis $ena" + ?(exc map (l => s"WPEXC($l)")) + ?(keepAliveClause)
override def referencedVars = new IList(keepAliveClause.toSeq.flatMap(_.vars))
s"WATCHPOINT $wpid <$retTy> $dis $ena" + ?(exc map (l => s"WPEXC($l)")) + ?(keepaliveClause)
override def referencedVars = new IList(keepaliveClause.toSeq.flatMap(_.vars))
override def possibleJumps = new IList(Seq(dis, ena) ++ exc)
}
......@@ -479,13 +479,13 @@ object Inst {
dis: DestClause,
ena: DestClause,
exc: Option[DestClause],
keepAliveClause: Option[KeepAliveClause]
keepaliveClause: Option[KeepaliveClause]
) extends PostInst {
override def returnTypes(implicit context: Context) = retTy
override def toString =
s"WATCHPOINT $wpid <$retTy> $dis $ena" + ?(exc map (l => s"WPEXC($l)")) + ?(keepAliveClause)
s"WATCHPOINT $wpid <$retTy> $dis $ena" + ?(exc map (l => s"WPEXC($l)")) + ?(keepaliveClause)
override def referencedVars =
new IList(dis.args ++ ena.args ++ exc.toSeq.flatMap(_.args) ++ keepAliveClause.toSeq.flatMap(_.vars))
new IList(dis.args ++ ena.args ++ exc.toSeq.flatMap(_.args) ++ keepaliveClause.toSeq.flatMap(_.vars))
}
// Unsafe Native Call
......@@ -496,8 +496,8 @@ object Inst {
sig: FuncSigName,
callee: VarName,
argList: IList[VarName],
keepAliveClause: Option[KeepAliveClause]
) extends PrePostInst(s"CCALL $callConv <$calleeTy $sig> $callee ($argList)" + ?(keepAliveClause)) {
keepaliveClause: Option[KeepaliveClause]
) extends PrePostInst(s"CCALL $callConv <$calleeTy $sig> $callee ($argList)" + ?(keepaliveClause)) {
def this(
callConv: Flag,
calleeTy: TypeName,
......@@ -511,14 +511,14 @@ object Inst {
sig: FuncSigName,
callee: VarName,
argList: IList[VarName],
keepAliveClause: KeepAliveClause
) = this(callConv, calleeTy, sig, callee, argList, Some(keepAliveClause))
keepaliveClause: KeepaliveClause
) = this(callConv, calleeTy, sig, callee, argList, Some(keepaliveClause))
override def returnTypes(implicit context: Context) =
(for (FuncSig(_, retTypes) <- context resolve sig) yield retTypes) getOrElse {
throw TypeResolveException(s"Undefined function signature: $sig")
}
override def referencedVars =
new IList(callee +: (argList.toSeq ++ keepAliveClause.toSeq.flatMap(_.vars)))
new IList(callee +: (argList.toSeq ++ keepaliveClause.toSeq.flatMap(_.vars)))
}
// Thread and Stack
......@@ -534,19 +534,19 @@ object Inst {
swappee: VarName,
curStackClause: CurStackClause,
newStackClause: NewStackClause,
keepAliveClause: Option[KeepAliveClause]
) extends PrePostInst(s"SWAPSTACK $swappee $curStackClause $newStackClause" + ?(keepAliveClause))
keepaliveClause: Option[KeepaliveClause]
) extends PrePostInst(s"SWAPSTACK $swappee $curStackClause $newStackClause" + ?(keepaliveClause))
with SupportsExcClause {
def this(swappee: VarName, curStackClause: CurStackClause, newStackClause: NewStackClause) =
this(swappee, curStackClause, newStackClause, None)
def this(swappee: VarName, curStackClause: CurStackClause, newStackClause: NewStackClause,
keepAliveClause: KeepAliveClause) =
this(swappee, curStackClause, newStackClause, Some(keepAliveClause))
keepaliveClause: KeepaliveClause) =
this(swappee, curStackClause, newStackClause, Some(keepaliveClause))
override def returnTypes(implicit context: Context) = IList()
override def referencedVars =
new IList(swappee +: (newStackClause.referencedVars.toSeq ++ keepAliveClause.toSeq.flatMap(_.vars)))
new IList(swappee +: (newStackClause.referencedVars.toSeq ++ keepaliveClause.toSeq.flatMap(_.vars)))
override def preExcString = s"SWAPSTACK $swappee $curStackClause $newStackClause"
override def postExcString = ?(keepAliveClause)
override def postExcString = ?(keepaliveClause)
}
// Common Instructions
......@@ -558,25 +558,25 @@ object Inst {
typeList: Option[IList[TypeName]],
funcSigList: Option[IList[FuncSigName]],
argList: Option[IList[VarName]],
keepAliveClause: Option[KeepAliveClause]
keepaliveClause: Option[KeepaliveClause]
) extends PrePostInst(
s"COMMINST $instName" +
?(flagList map ("[" + _ + "]")) +
?(typeList map ("<" + _ + ">")) +
?(funcSigList map ("<[" + _ + "]>")) +
?(argList map ("(" + _ + ")")) +
?(keepAliveClause)
?(keepaliveClause)
) with SupportsExcClause {
// FIXME: Need source for comminst return types
override def returnTypes(implicit context: Context) = IList()
override def referencedVars =
new IList(instName +: (argList.toSeq.flatten ++ keepAliveClause.toSeq.flatMap(_.vars)))
new IList(instName +: (argList.toSeq.flatten ++ keepaliveClause.toSeq.flatMap(_.vars)))
override def preExcString = s"COMMINST $instName" +
?(flagList map ("[" + _ + "]")) +
?(typeList map ("<" + _ + ">")) +
?(funcSigList map ("<[" + _ + "]>")) +
?(argList map ("(" + _ + ")"))
override def postExcString = ?(keepAliveClause)
override def postExcString = ?(keepaliveClause)
}
}
......@@ -604,7 +604,7 @@ object AtomicRMWOptr extends Enumeration {
val UnsignMin = Value("UMIN")
}
case class KeepAliveClause(vars: IList[LocalVarName]) {
case class KeepaliveClause(vars: IList[LocalVarName]) {
override def toString = s"KEEPALIVE(${vars mkString " "})"
}
case class SwitchCase[T](value: VarName, dest: T) {
......
......@@ -60,8 +60,8 @@ object CommInsts extends SimpleNamespace[CommInst] {
commInst(0x25c, "@uvm.meta.pop_frames_to")
commInst(0x25d, "@uvm.meta.push_frame")
commInst(0x25e, "@uvm.meta.enable_watchpoint")
commInst(0x25f, "@uvm.meta.disable_watchpoint")
commInst(0x25e, "@uvm.meta.enable_watchPoint")
commInst(0x25f, "@uvm.meta.disable_watchPoint")
commInst(0x260, "@uvm.meta.set_trap_handler")
......
......@@ -397,7 +397,7 @@ private[textinput] class InstanceUIRTextReader(idFactory: IDFactory, source: Str
implicit def resArgList(a: ArgListContext): Seq[SSAVariable] = a.value.map(resVar)
implicit def resKA(ka: KeepAliveClauseContext): Seq[LocalVariable] = ka.value.map(resLocalVar)
implicit def resKA(ka: KeepaliveClauseContext): Seq[LocalVariable] = ka.value.map(resLocalVar)
def resFuncCallBody(fcb: FuncCallBodyContext): (FuncSig, SSAVariable, Seq[SSAVariable]) =
(fcb.funcSig, fcb.callee, fcb.argList)
......@@ -472,7 +472,7 @@ private[textinput] class InstanceUIRTextReader(idFactory: IDFactory, source: Str
case ii: InstCallContext =>
InstCall(null, null, null, null, null).later(phase4) { i =>
asgnFuncCallBody(i, ii.funcCallBody)
i.excClause = ii.excClause; i.keepAlives = ii.keepAliveClause
i.excClause = ii.excClause; i.keepalives = ii.keepaliveClause
}
case ii: InstTailCallContext =>
InstTailCall(null, null, null).later(phase4) { i =>
......@@ -566,11 +566,11 @@ private[textinput] class InstanceUIRTextReader(idFactory: IDFactory, source: Str
InstFence(ii.memord)
case ii: InstTrapContext =>
InstTrap(ii.typeList(), null, null).later(phase4) { i =>
i.excClause = ii.excClause; i.keepAlives = ii.keepAliveClause
i.excClause = ii.excClause; i.keepalives = ii.keepaliveClause
}
case ii: InstWatchPointContext =>
InstWatchPoint(ii.wpid.intValue(), ii.typeList(), null, null, null, null).later(phase4) { i =>
i.dis = ii.dis; i.ena = ii.ena; i.exc = Option(ii.wpExc).map(resDestClause); i.keepAlives = ii.keepAliveClause
i.dis = ii.dis; i.ena = ii.ena; i.exc = Option(ii.wpExc).map(resDestClause); i.keepalives = ii.keepaliveClause
}
case ii: InstWPBranchContext =>
InstWPBranch(ii.wpid.intValue(), null, null).later(phase4) { i =>
......@@ -578,7 +578,7 @@ private[textinput] class InstanceUIRTextReader(idFactory: IDFactory, source: Str
}
case ii: InstCCallContext =>
InstCCall(ii.callConv, ii.funcTy, ii.funcSig, null, null, null, null).later(phase4) { i =>
i.callee = ii.callee; i.argList = ii.argList; i.excClause = ii.excClause; i.keepAlives = ii.keepAliveClause
i.callee = ii.callee; i.argList = ii.argList; i.excClause = ii.excClause; i.keepalives = ii.keepaliveClause
}
case ii: InstNewThreadContext =>
InstNewThread(null, null, null, null).later(phase4) { i =>
......@@ -592,14 +592,14 @@ private[textinput] class InstanceUIRTextReader(idFactory: IDFactory, source: Str
i.swappee = ii.swappee
i.curStackAction = ii.curStackClause
i.newStackAction = ii.newStackClause
i.excClause = ii.excClause; i.keepAlives = ii.keepAliveClause
i.excClause = ii.excClause; i.keepalives = ii.keepaliveClause
}
case ii: InstCommInstContext =>
InstCommInst(CommInsts(ii.nam), Option(ii.flagList()).map(convFlagList).getOrElse(Seq()), null, null, null, null, null).later(phase4) { i =>
i.typeList = Option(ii.typeList).map(resTypeList).getOrElse(Seq())
i.funcSigList = Option(ii.funcSigList).map(resFuncSigList).getOrElse(Seq())
i.argList = Option(ii.argList).map(resArgList).getOrElse(Seq())
i.excClause = ii.excClause; i.keepAlives = ii.keepAliveClause
i.excClause = ii.excClause; i.keepalives = ii.keepaliveClause
}
}
......
......@@ -280,7 +280,7 @@ class InstanceHailScriptLoader(microVM: MicroVM, memorySupport: MemorySupport, m
}
kind match {
case 1 => { val r = mc.tr64FromFp(hv.asInstanceOf[MuDoubleValue]); mc.deleteValue(hv); r }
case 1 => { val r = mc.tr64FromFP(hv.asInstanceOf[MuDoubleValue]); mc.deleteValue(hv); r }
case 2 => { val r = mc.tr64FromInt(hv.asInstanceOf[MuIntValue]); mc.deleteValue(hv); r }
case 3 => { hv.asInstanceOf[MuTagRef64Value] }
}
......
......@@ -189,8 +189,8 @@ object TypeInferer {
case "@uvm.meta.pop_frames_to" => Seq()
case "@uvm.meta.push_frame" => Seq()
case "@uvm.meta.enable_watchpoint" => Seq()
case "@uvm.meta.disable_watchpoint" => Seq()
case "@uvm.meta.enable_watchPoint" => Seq()
case "@uvm.meta.disable_watchPoint" => Seq()
case "@uvm.meta.set_trap_handler" => Seq()
}
......
......@@ -22,7 +22,7 @@ trait CommInstExecutor extends InterpreterActions with ObjectPinner {
override def interpretCurrentCommonInstruction(): Unit = {
assert(curInst.isInstanceOf[InstCommInst])
val InstCommInst(ci, flagList, typeList, sigList, argList, excClause, keepAlives) = curInst
val InstCommInst(ci, flagList, typeList, sigList, argList, excClause, keepalives) = curInst
ci.name.get match {
// Thread and stack operations
......@@ -71,7 +71,7 @@ trait CommInstExecutor extends InterpreterActions with ObjectPinner {
case "@uvm.tr64.is_fp" => {
val Seq(tr) = argList
results(0).asBoolean = OpHelper.tr64IsFp(tr.asTR64Raw)
results(0).asBoolean = OpHelper.tr64IsFP(tr.asTR64Raw)
continueNormally()
}
......@@ -110,8 +110,8 @@ trait CommInstExecutor extends InterpreterActions with ObjectPinner {
case "@uvm.tr64.to_fp" => {
val Seq(tr) = argList
val raw = tr.asTR64Raw
if (OpHelper.tr64IsFp(raw)) {
val result = OpHelper.tr64ToFp(raw)
if (OpHelper.tr64IsFP(raw)) {
val result = OpHelper.tr64ToFP(raw)
results(0).asDouble = result
continueNormally()
} else {
......@@ -357,8 +357,8 @@ trait CommInstExecutor extends InterpreterActions with ObjectPinner {
case "@uvm.meta.pop_frame" => ???
case "@uvm.meta.push_frame" => ???
case "@uvm.meta.enable_watchpoint" => ???
case "@uvm.meta.disable_watchpoint" => ???
case "@uvm.meta.enable_watchPoint" => ???
case "@uvm.meta.disable_watchPoint" => ???
case "@uvm.meta.set_trap_handler" => ???
......
......@@ -240,7 +240,7 @@ trait InstructionExecutor extends InterpreterActions with CommInstExecutor {
}
}
case i @ InstCall(sig, callee, argList, excClause, keepAlives) => {
case i @ InstCall(sig, callee, argList, excClause, keepalives) => {
val calleeFunc = callee.asFunc.getOrElse {
throw new UvmRuntimeException(ctx + "Callee must not be NULL")
}
......@@ -484,11 +484,11 @@ trait InstructionExecutor extends InterpreterActions with CommInstExecutor {
continueNormally()
}
case i @ InstTrap(retTy, excClause, keepAlives) => {
case i @ InstTrap(retTy, excClause, keepalives) => {
doTrap(retTy, 0)
}
case i @ InstWatchPoint(wpID, retTy, dis, ena, exc, keepAlives) => {
case i @ InstWatchPoint(wpID, retTy, dis, ena, exc, keepalives) => {
val isEnabled = microVM.trapManager.isWatchPointEnabled(wpID)
if (isEnabled) {
......@@ -507,7 +507,7 @@ trait InstructionExecutor extends InterpreterActions with CommInstExecutor {
}
}
case i @ InstCCall(callConv, funcTy, sig, callee, argList, excClause, keepAlives) => {
case i @ InstCCall(callConv, funcTy, sig, callee, argList, excClause, keepalives) => {
if (callConv != Flag("#DEFAULT")) {
throw new UvmRefImplException(ctx + "Currently only support the #DEFAULT callConv. %s found.".format(callConv.name))
}
......@@ -544,7 +544,7 @@ trait InstructionExecutor extends InterpreterActions with CommInstExecutor {
continueNormally()
}
case i @ InstSwapStack(swappee, curStackAction, newStackAction, excClause, keepAlives) => {
case i @ InstSwapStack(swappee, curStackAction, newStackAction, excClause, keepalives) => {
val oldStack = curStack
val newStack = swappee.asStack.getOrElse {
throw new UvmUndefinedBehaviorException(ctx + "Swappee must not be NULL.")
......
......@@ -400,7 +400,7 @@ trait InterpreterActions extends InterpreterThreadState {
catchException(exc)
}
// Trap and watchpoint handling
// Trap and watchPoint handling
/** Execute the trap handler in the Client. Work for both TRAP and WATCHPOINT. */
protected def doTrap(retTys: Seq[Type], wpID: Int) = {
......
......@@ -551,8 +551,8 @@ class DefinedMuFrame(
def keepaliveBoxes(): Seq[ValueBox] = {
curInst match {
case hka: HasKeepAliveClause =>
val kas = hka.keepAlives
case hka: HasKeepaliveClause =>
val kas = hka.keepalives
val kaBoxes = kas.map(boxes.apply)
kaBoxes
case i => throw new UvmRefImplException("Instruction does not have keepalives: " + i.repr)
......
......@@ -55,8 +55,8 @@ object MemoryDataScanner extends StrictLogging {
val bits = memorySupport.loadLong(iRef)
if (paranoiaLogger.underlying.isDebugEnabled()) {
paranoiaLogger.debug(s"Tagref bits ${bits}")
if (OpHelper.tr64IsFp(bits)) {
paranoiaLogger.debug("Tagref is FP: %f".format(OpHelper.tr64ToFp(bits)))
if (OpHelper.tr64IsFP(bits)) {
paranoiaLogger.debug("Tagref is FP: %f".format(OpHelper.tr64ToFP(bits)))
} else if (OpHelper.tr64IsInt(bits)) {
paranoiaLogger.debug("Tagref is Int: %d".format(OpHelper.tr64ToInt(bits)))
} else if (OpHelper.tr64IsRef(bits)) {
......
......@@ -331,8 +331,8 @@ object NativeMuCtx {
def tr64_from_int(ctx: MuCtx, value: MuIntValue): MuValueFak = exposeMuValue(ctx, ctx.tr64FromInt(value))
def tr64_from_ref(ctx: MuCtx, ref: MuRefValue, tag: MuIntValue): MuValueFak = exposeMuValue(ctx, ctx.tr64FromRef(ref, tag))
def enable_watchpoint(ctx: MuCtx, wpid: Int): Unit = ctx.enableWatchPoint(wpid)
def disable_watchpoint(ctx: MuCtx, wpid: Int): Unit = ctx.disableWatchPoint(wpid)
def enable_watchPoint(ctx: MuCtx, wpid: Int): Unit = ctx.enableWatchPoint(wpid)
def disable_watchPoint(ctx: MuCtx, wpid: Int): Unit = ctx.disableWatchPoint(wpid)
def pin(ctx: MuCtx, loc: MuValue): MuValueFak = exposeMuValue(ctx, ctx.pin(loc))
def unpin(ctx: MuCtx, loc: MuValue): Unit = ctx.unpin(loc)
......@@ -421,7 +421,7 @@ object NativeMuCtx {
def new_atomicrmw(ctx: MuCtx, bb: MuBBNode, is_ptr: Int, ord: MuMemOrd, optr: MuAtomicRMWOptr, refTy: MuTypeNode, loc: MuVarNode, opnd: MuVarNode): MuValueFak = exposeMuValue(ctx, ctx.newAtomicRMW(bb, is_ptr != 0, ord, optr, refTy, loc, opnd))
def new_fence(ctx: MuCtx, bb: MuBBNode, ord: MuMemOrd): MuValueFak = exposeMuValue(ctx, ctx.newFence(bb, ord))
def new_trap(ctx: MuCtx, bb: MuBBNode, rettys: MuValueFakArrayPtr, nrettys: Int): MuValueFak = exposeMuValue(ctx, ctx.newTrap(bb, readFromValueFakArray(rettys, nrettys)))
def new_watchpoint(ctx: MuCtx, bb: MuBBNode, wpid: MuWPID, rettys: MuValueFakArrayPtr, nrettys: Int): MuValueFak = exposeMuValue(ctx, ctx.newWatchPoint(bb, wpid, readFromValueFakArray(rettys, nrettys)))
def new_watchPoint(ctx: MuCtx, bb: MuBBNode, wpid: MuWPID, rettys: MuValueFakArrayPtr, nrettys: Int): MuValueFak = exposeMuValue(ctx, ctx.newWatchPoint(bb, wpid, readFromValueFakArray(rettys, nrettys)))
def new_wpbranch(ctx: MuCtx, bb: MuBBNode, wpid: MuWPID): MuValueFak = exposeMuValue(ctx, ctx.newWPBranch(bb, wpid))
def new_ccall(ctx: MuCtx, bb: MuBBNode, callconv: MuCallConv, callee_ty: MuTypeNode, sig: MuFuncSigNode, callee: MuVarNode, args: MuValueFakArrayPtr, nargs: Int): MuValueFak = exposeMuValue(ctx, ctx.newCCall(bb, callconv, callee_ty, sig, callee, readFromValueFakArray(args, nargs)))
def new_newthread(ctx: MuCtx, bb: MuBBNode, stack: MuVarNode, threadlocal: Option[MuVarNode]): MuValueFak = exposeMuValue(ctx, ctx.newNewThread(bb, stack, threadlocal))
......
......@@ -115,7 +115,7 @@ class BundleBuilderTest extends UvmTestBase {
SwitchCase(LocalVarName("v1"), LabelName("d1")),
SwitchCase(LocalVarName("v2"), LabelName("d2")),
SwitchCase(LocalVarName("v3"), LabelName("d3")))).toString shouldEqual "SWITCH <@x> %a %l1 { %v1: %d1; %v2: %d2; %v3: %d3; }"
PostExcClause(Inst.Call(s, f, IList(a, b, c), Some(KeepAliveClause(IList(a, b)))), nor, exc).toString shouldEqual
PostExcClause(Inst.Call(s, f, IList(a, b, c), Some(KeepaliveClause(IList(a, b)))), nor, exc).toString shouldEqual
"CALL <@s> @f (%a %b %c) EXC(%nor() %exc()) KEEPALIVE(%a %b)"
Inst.TailCall(s, f, IList(a, b, c)).toString shouldEqual
"TAILCALL <@s> @f (%a %b %c)"
......@@ -147,35 +147,35 @@ class BundleBuilderTest extends UvmTestBase {
PostExcClause(Inst.AtomicRMW(ptr = true, SeqConsistent, AtomicRMWOptr.Xor, x, a, b), nor, exc).toString shouldEqual
"ATOMICRMW PTR SEQ_CST XOR <@x> %a %b EXC(%nor() %exc())"
Inst.Fence(SeqConsistent).toString shouldEqual "FENCE SEQ_CST"
PostExcClause(Inst.Trap(IList(x), Some(KeepAliveClause(IList(a, b)))), nor, exc).toString shouldEqual
PostExcClause(Inst.Trap(IList(x), Some(KeepaliveClause(IList(a, b)))), nor, exc).toString shouldEqual
"TRAP <@x> EXC(%nor() %exc()) KEEPALIVE(%a %b)"
Inst.PostWatchPoint(42, IList(x), dest1, dest2, Some(dest1), Some(KeepAliveClause(IList(a, b)))).toString shouldEqual
Inst.PostWatchPoint(42, IList(x), dest1, dest2, Some(dest1), Some(KeepaliveClause(IList(a, b)))).toString shouldEqual
"WATCHPOINT 42 <@x> %l1(%a %b) %l2(%c) WPEXC(%l1(%a %b)) KEEPALIVE(%a %b)"
Inst.CCall(new Flag("DEFAULT"), x, s, f, IList(a, b, c), Some(KeepAliveClause(IList(a, b)))).toString shouldEqual
Inst.CCall(new Flag("DEFAULT"), x, s, f, IList(a, b, c), Some(KeepaliveClause(IList(a, b)))).toString shouldEqual
"CCALL #DEFAULT <@x @s> @f (%a %b %c) KEEPALIVE(%a %b)"
PostExcClause(Inst.NewThread(f, NewStackClause.PassVoid()), nor, exc).toString shouldEqual
"NEWTHREAD @f PASS_VOID EXC(%nor() %exc())"
PostExcClause(Inst.SwapStack(a,
CurStackClause.RetWith(x),
NewStackClause.PassValue(y, b),
Some(KeepAliveClause(IList(a, b)))), nor, exc).toString shouldEqual
Some(KeepaliveClause(IList(a, b)))), nor, exc).toString shouldEqual
"SWAPSTACK %a RET_WITH <@x> PASS_VALUE <@y> %b EXC(%nor() %exc()) KEEPALIVE(%a %b)"
PostExcClause(Inst.SwapStack(a,
CurStackClause.KillOld(),
NewStackClause.PassVoid(),
Some(KeepAliveClause(IList(a, b)))), nor, exc).toString shouldEqual
Some(KeepaliveClause(IList(a, b)))), nor, exc).toString shouldEqual
"SWAPSTACK %a KILL_OLD PASS_VOID EXC(%nor() %exc()) KEEPALIVE(%a %b)"
PostExcClause(Inst.SwapStack(a,
CurStackClause.KillOld(),
NewStackClause.ThrowExc(b),
Some(KeepAliveClause(IList(a, b)))), nor, exc).toString shouldEqual
Some(KeepaliveClause(IList(a, b)))), nor, exc).toString shouldEqual
"SWAPSTACK %a KILL_OLD THROW_EXC %b EXC(%nor() %exc()) KEEPALIVE(%a %b)"
PostExcClause(Inst.CommInst(GlobalVarName("foo.bar"),
Some(IList(new Flag("A"), new Flag("B"))),
Some(IList(x, y)),
Some(IList(s, FuncSigName("s2"))),
Some(IList(a, b)),
Some(KeepAliveClause(IList(a, b)))), nor, exc).toString shouldEqual
Some(KeepaliveClause(IList(a, b)))), nor, exc).toString shouldEqual
"COMMINST @foo.bar [#A #B] <@x @y> <[@s @s2]> (%a %b) EXC(%nor() %exc()) KEEPALIVE(%a %b)"
}
......
......@@ -673,7 +673,7 @@ trait TestingBundlesValidators extends Matchers with ExtraMatchers {
its.callee shouldBe (our value "@callee1")
its.argList shouldBe empty
its.excClause shouldBe None
its.keepAlives shouldBe empty
its.keepalives shouldBe empty
}
my inst "%call2" shouldBeA[InstCall] { its =>
......@@ -681,7 +681,7 @@ trait TestingBundlesValidators extends Matchers with ExtraMatchers {
its.callee shouldBe (our value "@callee2")
its.argList shouldEqual Seq("@I64_1", "@I64_2").map(our.value)
its.excClause shouldBe None
its.keepAlives shouldBe empty
its.keepalives shouldBe empty
}
my inst "%call3" shouldBeA[InstCall] { its =>
......@@ -691,7 +691,7 @@ trait TestingBundlesValidators extends Matchers with ExtraMatchers {
its.excClause shouldBe Some(ExcClause(
DestClause(the bb "%cont", qw"%v2 %v3".map(my.ires)),
DestClause(the bb "%catch", Seq())))
its.keepAlives shouldBe empty
its.keepalives shouldBe empty
}
}
......@@ -701,7 +701,7 @@ trait TestingBundlesValidators extends Matchers with ExtraMatchers {
its.callee shouldBe (our globalValue "@callee1")
its.argList shouldBe empty
its.excClause shouldBe None
its.keepAlives shouldBe Seq("%v2", "%v3").map(my.value)
its.keepalives shouldBe Seq("%v2", "%v3").map(my.value)
}
my inst "%call5" shouldBeA[InstCall] { its =>
......@@ -711,7 +711,7 @@ trait TestingBundlesValidators extends Matchers with ExtraMatchers {
its.excClause shouldBe Some(ExcClause(
DestClause(the bb "%cont2", Seq()),
DestClause(the bb "%catch", Seq())))
its.keepAlives shouldEqual Seq(my ires "%v2")
its.keepalives shouldEqual Seq(my ires "%v2")
}
}
......@@ -1127,13 +1127,13 @@ trait TestingBundlesValidators extends Matchers with ExtraMatchers {
my inst "%t" shouldBeA[InstTrap] { its =>
its.retTys shouldBe qw"@i32".map(our.ty)
its.excClause shouldBe None
its.keepAlives shouldBe Seq(my value "%a")
its.keepalives shouldBe Seq(my value "%a")
}
my inst "%t0" shouldBeA[InstTrap] { its =>
its.retTys shouldBe empty
its.excClause shouldBe None
its.keepAlives shouldBe empty
its.keepalives shouldBe empty
}
my inst "%ts" shouldBeA[InstTrap] { its =>
......@@ -1141,7 +1141,7 @@ trait TestingBundlesValidators extends Matchers with ExtraMatchers {
its.excClause shouldBe Some(ExcClause(
DestClause(the bb "%tp_s_cont", Seq("%a", "%b").map(my.value)),
DestClause(the bb "%tp_s_exc", Seq())))
its.keepAlives shouldBe Seq(my value "%b")
its.keepalives shouldBe Seq(my value "%b")
}
}
......@@ -1153,7 +1153,7 @@ trait TestingBundlesValidators extends Matchers with ExtraMatchers {
its.dis shouldBe DestClause(the bb "%wp_dis_cont", Seq(my value "%b"))
its.ena shouldBe DestClause(the bb "%wp_ena_cont", Seq())
its.exc shouldBe None
its.keepAlives shouldBe Seq(my value "%a")
its.keepalives shouldBe Seq(my value "%a")
}
}
......@@ -1164,7 +1164,7 @@ trait TestingBundlesValidators extends Matchers with ExtraMatchers {
its.dis shouldBe DestClause(the bb "%wp_s_dis_cont", Seq())
its.ena shouldBe DestClause(the bb "%wp_s_ena_cont", Seq())
its.exc shouldBe Some(DestClause(the bb "%wp_s_exc", Seq()))
its.keepAlives shouldBe Seq(my value "%b")
its.keepalives shouldBe Seq(my value "%b")
}
}
......@@ -1198,14 +1198,14 @@ trait TestingBundlesValidators extends Matchers with ExtraMatchers {
its.curStackAction shouldBe RetWith(Seq())
its.newStackAction shouldBe PassValues(Seq(our ty "@i64"), Seq(our value "@I64_0"))
its.excClause shouldBe None
its.keepAlives shouldBe empty
its.keepalives shouldBe empty
}
my inst "%ss2" shouldBeA[InstSwapStack] { its =>
its.swappee shouldBe (my value "%main")
its.curStackAction shouldBe KillOld()
its.newStackAction shouldBe ThrowExc(our value "@NULLREF")
its.excClause shouldBe None
its.keepAlives shouldBe empty
its.keepalives shouldBe empty
}
}
}
......@@ -1246,7 +1246,7 @@ trait TestingBundlesValidators extends Matchers with ExtraMatchers {