WARNING! Access to this system is limited to authorised users only.
Unauthorised users may be subject to prosecution.
Unauthorised access to this system is a criminal offence under Australian law (Federal Crimes Act 1914 Part VIA)
It is a criminal offence to:
(1) Obtain access to data without authority. -Penalty 2 years imprisonment.
(2) Damage, delete, alter or insert data without authority. -Penalty 10 years imprisonment.
User activity is monitored and recorded. Anyone using this system expressly consents to such monitoring and recording.

To protect your data, the CISO officer has suggested users to enable 2FA as soon as possible.
Currently 2.7% of users enabled 2FA.

Commit abf3d0a3 authored by Kunshan Wang's avatar Kunshan Wang
Browse files

WIP: Use MuID and MuName in scala, too.

parent a6ff7b64
......@@ -154,6 +154,7 @@ _special_cases = {
"newstack": "NewStack",
"swapstack": "SwapStack",
"comminst": "CommInst",
"ir": "IR",
}
def toCamelCase(name):
......@@ -198,7 +199,6 @@ _special_converters = {
"MuCmpOptr" : "toCmpOptr",
"MuConvOptr" : "toConvOptr",
"MuCallConv" : "toFlag",
"MuDestKind" : "toDestKind",
}
_special_return_converters = {
......@@ -375,7 +375,6 @@ def generate_enums(ast):
return "\n".join(vals)
_enum_types_to_generate_converters = [
("MuDestKind", "DestKind", 'MU_DEST_'),
("MuBinOptr", "BinOptr", 'MU_BINOP_'),
("MuCmpOptr", "CmpOptr", 'MU_CMP_'),
("MuConvOptr", "ConvOptr", 'MU_CONV_'),
......
......@@ -31,7 +31,7 @@ object MuCtx {
* A client context. The main part of the API. It keeps thread-local states, including a set of handles. It provides
* operations on the Mu VM.
*/
class MuCtx(val ctxID: Int, _mutator: Mutator)(
class MuCtx(val ctxID: MuInternalID, _mutator: Mutator)(
implicit protected val microVM: MicroVM, memorySupport: MemorySupport)
extends ObjectPinner with AutoCloseable {
import MuCtx._
......
......@@ -3,6 +3,7 @@ package uvm.refimpl
import scala.collection.mutable.ArrayBuffer
import scala.collection.mutable.Buffer
import uvm.{ MuID, MuName }
import uvm.ssavariables.MemoryOrder._
object RichMuCtx {
......@@ -85,7 +86,7 @@ object RichMuCtx {
// legacy support
/** Get the ID of the current function of a frame. Return 0 for native frames. */
def curFunc(stack: MuStackRefValue, frame: Int): Int = {
def curFunc(stack: MuStackRefValue, frame: Int): MuID = {
val cursor = ctx.newCursor(stack)
for (i <- 0 until frame) {
ctx.nextFrame(cursor)
......@@ -100,7 +101,7 @@ object RichMuCtx {
* Get the ID of the current function version of a frame. Return 0 for native frames
* or Mu frames of undefined functions
*/
def curFuncVer(stack: MuStackRefValue, frame: Int): Int = {
def curFuncVer(stack: MuStackRefValue, frame: Int): MuID = {
val cursor = ctx.newCursor(stack)
for (i <- 0 until frame) {
ctx.nextFrame(cursor)
......@@ -115,7 +116,7 @@ object RichMuCtx {
* Get the ID of the current instruction of a frame. Return 0 for native frames, Mu frames for undefined
* functions, or if the frame is just created by newStack or pushFrame.
*/
def curInst(stack: MuStackRefValue, frame: Int): Int = {
def curInst(stack: MuStackRefValue, frame: Int): MuID = {
val cursor = ctx.newCursor(stack)
for (i <- 0 until frame) {
ctx.nextFrame(cursor)
......
......@@ -2,17 +2,21 @@ package uvm.refimpl.bootimg
import java.io.BufferedReader
import java.io.Closeable
import java.io.FileNotFoundException
import java.io.InputStream
import java.io.InputStreamReader
import java.io.Reader
import java.nio.charset.StandardCharsets
import java.nio.file.Paths
import java.util.zip.ZipEntry
import java.util.zip.ZipFile
import scala.collection.Map
import scala.collection.mutable.HashMap
import uvm.{ MuID, MuName }
import uvm.refimpl.MicroVM
import uvm.refimpl.itpr.OpHelper
import uvm.refimpl.mem.TypeSizes
import uvm.refimpl.nat.NativeSupport
import uvm.refimpl.nat.PlatformConstants.{ Word, WORD_SIZE_BYTES }
......@@ -20,10 +24,6 @@ import uvm.types.TypeHybrid
import uvm.utils.IOHelpers.forEachLine
import uvm.utils.MappedIDFactory
import uvm.utils.WithUtils.tryWithResource
import uvm.refimpl.itpr.OpHelper
import uvm.Function
import java.io.FileNotFoundException
import java.util.zip.ZipEntry
object BootImageLoader {
val MUTATOR_NAME = "bootimgldr"
......@@ -100,8 +100,8 @@ class BootImageLoader(file: String)(implicit microVM: MicroVM) extends AutoClose
microVM.idFactory.setNextID(maxID + 1)
}
private def loadIDNameMap(): Map[String, Int] = {
val map = new HashMap[String, Int]()
private def loadIDNameMap(): Map[MuName, MuID] = {
val map = new HashMap[MuName, MuID]()
val idNameMapTxt = tryWithResource(zipFileTextBuf(IDNAMEMAP_FILE)) { br =>
var finished = false
while (!finished) {
......
package uvm.refimpl.cmdline
import uvm.refimpl.MicroVM
import uvm.refimpl.nat.ScalaCInitiater
import scala.collection.mutable.HashMap
import uvm.refimpl.VMConf
import java.io.BufferedReader
import java.io.InputStreamReader
import java.nio.charset.StandardCharsets
import java.util.zip.ZipFile
import uvm.utils.WithUtils.tryWithResource
import scala.collection.mutable.HashMap
import uvm.{MuID, MuName}
import uvm.refimpl.HowToResume.PassValues
import uvm.refimpl.InternalTypes
import uvm.refimpl.MicroVM
import uvm.refimpl.UvmRuntimeException
import java.nio.charset.StandardCharsets
import java.io.InputStreamReader
import java.io.BufferedReader
import uvm.refimpl.VMConf
import uvm.refimpl.nat.NativeSupport
import uvm.refimpl.nat.PlatformConstants
import uvm.refimpl.HowToResume.PassValues
import uvm.refimpl.InternalTypes
import uvm.utils.WithUtils.tryWithResource
/** Run Mu from the command line. */
object RunMu {
......@@ -67,7 +69,7 @@ object RunMu {
val microVM = new MicroVM(VMConf(props.toMap))
val entryPoint: Either[Int, String] = {
val entryPoint: Either[MuID, MuName] = {
tryWithResource(new ZipFile(bootImg)) { zipFile =>
val entryPointEntry = Option(zipFile.getEntry(ENTRYPOINT_FILE)).getOrElse {
throw new UvmRuntimeException("Boot image has no entry point. Use tools/mar.py to set entry point. Image: " + bootImg)
......
package uvm.refimpl.hail
import java.io.Reader
import scala.collection.JavaConversions._
import scala.collection.mutable.HashMap
import org.antlr.v4.runtime.ANTLRInputStream
import org.antlr.v4.runtime.CommonTokenStream
import org.antlr.v4.runtime.ParserRuleContext
import org.slf4j.LoggerFactory
import com.typesafe.scalalogging.Logger
import uvm.Function
import uvm._
import uvm.ir.textinput.TextIRParsingException
import uvm.ir.textinput.gen.HAILLexer
import uvm.ir.textinput.gen.HAILParser
......@@ -19,16 +23,17 @@ import uvm.refimpl.mem.MemorySupport
import uvm.ssavariables._
import uvm.ssavariables.MemoryOrder.NOT_ATOMIC
import uvm.types._
import uvm.utils.AdvancedAntlrHelper
import uvm.utils.AntlrHelpers._
import uvm.utils.IOHelpers
import uvm.utils.AdvancedAntlrHelper
object HailScriptLoader {
val logger = Logger(LoggerFactory.getLogger(getClass.getName))
type HailName = String
}
class HailScriptLoader(recordSourceInfo: Boolean = true)(implicit microVM: MicroVM, memorySupport: MemorySupport) {
import HailScriptLoader._
def loadHail(hailScript: Reader): Unit = {
loadHail(IOHelpers.slurp(hailScript))
......@@ -67,7 +72,7 @@ class InstanceHailScriptLoader(microVM: MicroVM, memorySupport: MemorySupport, m
val sourceLines = source.lines.toIndexedSeq
private type HailObjMap = HashMap[String, MuRefValue]
private type HailObjMap = HashMap[HailName, MuRefValue]
val hailObjMap = new HailObjMap
def loadTopLevel(ast: HailContext): Unit = {
......@@ -466,10 +471,10 @@ class InstanceHailScriptLoader(microVM: MicroVM, memorySupport: MemorySupport, m
}
implicit def resTy(ctx: TypeContext): Type = catchIn(ctx, "Unable to resolve type") { resTyByName(ctx.getText) }
private def resTyByName(name: String): Type = microVM.globalBundle.typeNs(name)
private def resTyByName(name: MuName): Type = microVM.globalBundle.typeNs(name)
implicit def resConstInt(ctx: IntGlobalContext): BigInt = catchIn(ctx, "Unable to resolve constant int") { resConstIntByName(ctx.getText) }
private def resConstIntByName(name: String): BigInt = {
private def resConstIntByName(name: MuName): BigInt = {
val const = microVM.globalBundle.constantNs.get(name).getOrElse {
throw new UvmHailParsingException("Type %s not found".format(name))
}
......@@ -488,7 +493,7 @@ class InstanceHailScriptLoader(microVM: MicroVM, memorySupport: MemorySupport, m
gv
}
def resHailRef(name: String, ctx: ParserRuleContext): MuRefValue = {
def resHailRef(name: HailName, ctx: ParserRuleContext): MuRefValue = {
hailObjMap.getOrElse(name, {
throw new UvmHailParsingException(inCtx(ctx, "HAIL name %s not defined. It needs to be defined BEFORE use.".format(name)))
})
......
......@@ -33,7 +33,7 @@ object HowToResume {
* @param mutator The Mutator object, for memory management
* @param htr How to resume. Either pass value or throw exception.
*/
class InterpreterThread(val id: Int, initialStack: InterpreterStack, initialThreadLocal: Long, htr: HowToResume, val mutator: Mutator)(
class InterpreterThread(val id: MuInternalID, initialStack: InterpreterStack, initialThreadLocal: Long, htr: HowToResume, val mutator: Mutator)(
implicit protected val microVM: MicroVM) extends InstructionExecutor with HasID {
import InterpreterThread._
......@@ -57,7 +57,7 @@ class InterpreterThread(val id: Int, initialStack: InterpreterStack, initialThre
*/
trait InterpreterThreadState {
/** Thread ID */
def id: Int
def id: MuInternalID
/** The Micro VM */
implicit protected def microVM: MicroVM
......@@ -403,7 +403,7 @@ trait InterpreterActions extends InterpreterThreadState {
// 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) = {
protected def doTrap(retTys: Seq[Type], wpID: MuID) = {
val curCtx = ctx // save the context string for debugging
val c = microVM.newContext("trap")
......
......@@ -7,7 +7,7 @@ import org.slf4j.LoggerFactory
import com.typesafe.scalalogging.Logger
import uvm.Function
import uvm.refimpl.MicroVM
import uvm.refimpl._
import uvm.refimpl.UvmRuntimeException
import uvm.refimpl.UvmUnknownIDException
import uvm.refimpl.mem._
......@@ -22,7 +22,7 @@ import uvm.utils.IDFactory
* IDs.
*/
trait HasID {
def id: Int
def id: MuInternalID
}
/**
......@@ -35,7 +35,7 @@ class IDObjectKeeper[T <: HasID](val kind: String) {
val idFactory = IDFactory.newOneBasedIDFactory()
/** Get an object by its ID. */
def apply(id: Int) = try {
def apply(id: MuInternalID) = try {
registry.apply(id)
} catch {
case e: NoSuchElementException => throw new UvmUnknownIDException(
......@@ -43,7 +43,7 @@ class IDObjectKeeper[T <: HasID](val kind: String) {
}
/** Get an object by its ID, handle non-existing cases. */
def get(id: Int) = registry.get(id)
def get(id: MuInternalID) = registry.get(id)
/** Add an object to the registry. */
def put(obj: T): Unit = {
......@@ -121,7 +121,7 @@ class ThreadStackManager(implicit microVM: MicroVM, nativeCallHelper: NativeCall
//// Frame cursors related operations
private def createAndAddFrameCursor(id: Int, stack: InterpreterStack, frame: InterpreterFrame): FrameCursor = {
private def createAndAddFrameCursor(id: MuInternalID, stack: InterpreterStack, frame: InterpreterFrame): FrameCursor = {
val fc = new FrameCursor(id, stack, frame)
frameCursorRegistry.put(fc)
stack.frameCursors.add(fc)
......
package uvm.refimpl.itpr
import uvm.MuID
import uvm.refimpl._
import scala.collection.mutable.HashSet
class TrapManager(implicit microVM: MicroVM) {
var trapHandler: TrapHandler = DefaultTrapHandler
private val enabledWatchPoints = new HashSet[Int]()
private val enabledWatchPoints = new HashSet[MuID]()
def isWatchPointEnabled(wpID: Int): Boolean = enabledWatchPoints.contains(wpID)
def isWatchPointEnabled(wpID: MuID): Boolean = enabledWatchPoints.contains(wpID)
def enableWatchPoint(wpID: Int): Unit = enabledWatchPoints.add(wpID)
def enableWatchPoint(wpID: MuID): Unit = enabledWatchPoints.add(wpID)
def disableWatchPoint(wpID: Int): Unit = enabledWatchPoints.remove(wpID)
def disableWatchPoint(wpID: MuID): Unit = enabledWatchPoints.remove(wpID)
object DefaultTrapHandler extends TrapHandler {
def handleTrap(ctx: MuCtx, thread: MuThreadRefValue, stack: MuStackRefValue, watchPointID: Int): TrapHandlerResult = {
def handleTrap(ctx: MuCtx, thread: MuThreadRefValue, stack: MuStackRefValue, watchPointID: MuID): TrapHandlerResult = {
val thrID = thread.vb.asInstanceOf[BoxThread].thread.get.id
val staID = stack.vb.asInstanceOf[BoxStack].stack.get.id
val cursor = ctx.newCursor(stack)
......
......@@ -4,6 +4,7 @@ import uvm._
import uvm.types._
import uvm.refimpl._
import uvm.refimpl.mem.TypeSizes.Word
import uvm.ir.irbuilder.IRBuilder
abstract class ValueBox {
def copyFrom(other: ValueBox): Unit
......@@ -72,9 +73,9 @@ case class BoxFrameCursor(var cursor: Option[FrameCursor]) extends ObjectBox[Fra
def obj = cursor
def obj_=(other: Option[FrameCursor]): Unit = { cursor = other }
}
case class BoxIRNode(var node: Option[IRNode]) extends ObjectBox[IRNode] {
def obj = node
def obj_=(other: Option[IRNode]): Unit = { node = other }
case class BoxIRBuilder(var builder: Option[IRBuilder]) extends ObjectBox[IRBuilder] {
def obj = builder
def obj_=(other: Option[IRBuilder]): Unit = { builder = other }
}
case class BoxTagRef64(var raw: Long) extends HasObjRef {
def copyFrom(other: ValueBox): Unit = { this.raw = other.asInstanceOf[BoxTagRef64].raw }
......@@ -113,7 +114,7 @@ object ValueBox {
case _: TypeStackRef => BoxStack(None)
case _: TypeThreadRef => BoxThread(None)
case _: TypeFrameCursorRef => BoxFrameCursor(None)
case _: TypeIRNodeRef => BoxIRNode(None)
case _: TypeIRBuilderRef => BoxIRBuilder(None)
}
}
\ No newline at end of file
......@@ -30,7 +30,7 @@ object FrameState {
/**
* Implements a Mu Stack. Contains both Mu frames and native frames.
*/
class InterpreterStack(val id: Int, val stackMemory: StackMemory, stackBottomFunc: Function)(
class InterpreterStack(val id: MuInternalID, val stackMemory: StackMemory, stackBottomFunc: Function)(
implicit nativeCallHelper: NativeCallHelper, microVM: MicroVM) extends HasID {
var gcMark: Boolean = false // Mark for GC.
......@@ -333,13 +333,13 @@ abstract class InterpreterFrame(val prev: Option[InterpreterFrame]) {
var state: FrameState = _
/** ID of the current function. Return 0 for native frames. */
def curFuncID: Int
def curFuncID: MuID
/** ID of the current function version Return 0 for native frames or undefined Mu frames. */
def curFuncVerID: Int
def curFuncVerID: MuID
/** ID of the current instruction. Return 0 for native frames, undefined Mu frames, or a just-created frame. */
def curInstID: Int
def curInstID: MuID
}
......@@ -366,9 +366,9 @@ object InterpreterFrame {
}
class NativeFrame(val func: Word, prev: Option[InterpreterFrame]) extends InterpreterFrame(prev) {
override def curFuncID: Int = 0
override def curFuncVerID: Int = 0
override def curInstID: Int = 0
override def curFuncID: MuID = 0
override def curFuncVerID: MuID = 0
override def curInstID: MuID = 0
override def toString(): String = "NativeFrame(func=0x%x)".format(func)
}
......@@ -421,9 +421,9 @@ class UndefinedMuFrame(func: Function, prev: Option[InterpreterFrame]) extends M
override def scannableBoxes = boxes
override def curFuncID: Int = func.id
override def curFuncVerID: Int = 0
override def curInstID: Int = 0
override def curFuncID: MuID = func.id
override def curFuncVerID: MuID = 0
override def curInstID: MuID = 0
def resumeNormally(args: Seq[ValueBox]): Boolean = {
if (justCreated) {
......@@ -523,9 +523,9 @@ class DefinedMuFrame(
}
}
override def curFuncID: Int = func.id
override def curFuncVerID: Int = funcVer.id
override def curInstID: Int = if (justCreated) 0 else curInst.id
override def curFuncID: MuID = func.id
override def curFuncVerID: MuID = funcVer.id
override def curInstID: MuID = if (justCreated) 0 else curInst.id
def curInst: Instruction = try {
curBB.insts(curInstIndex)
......@@ -605,7 +605,7 @@ class DefinedMuFrame(
/**
* A mutable cursor that iterates through stack frames.
*/
class FrameCursor(val id: Int, val stack: InterpreterStack, var frame: InterpreterFrame) extends HasID {
class FrameCursor(val id: MuInternalID, val stack: InterpreterStack, var frame: InterpreterFrame) extends HasID {
def nextFrame(): Unit = {
frame = frame.prev.getOrElse {
throw new UvmRuntimeException("Attempt to go below the stack-bottom frame. Stack id: %d, Frame: %s".format(
......
package uvm.refimpl.mem
import uvm.MuID
import uvm.types.Type
import uvm.refimpl.MicroVM
import uvm.refimpl.mem.TypeSizes.Word
......@@ -38,7 +39,7 @@ object HeaderUtils extends StrictLogging {
memorySupport.storeLong(objRef + TypeSizes.GC_HEADER_OFFSET_HYBRID_LENGTH, len)
}
def getTypeID(tag: Word): Int = (tag & 0x00000000ffffffffL).toInt
def getTypeID(tag: Word): MuID = (tag & 0x00000000ffffffffL).toInt
def getType(microVM: MicroVM, tag: Word): Type = {
val typeID = getTypeID(tag)
......
......@@ -8,7 +8,6 @@ import NativeSupport._
import PlatformConstants._
import uvm.refimpl._
import uvm.ssavariables.{BinOptr, CmpOptr, ConvOptr, MemoryOrder, AtomicRMWOptr}
import uvm.ir.irbuilder.DestKind
import uvm.refimpl.MicroVM
......@@ -903,7 +902,7 @@ val _RV = ctx.unexpose(call_conv, value)
val MUCTX__NEW_IR_BUILDER = exposedMethod("MuCtx.new_ir_builder", JType.POINTER, Array(JType.POINTER)) { _jffiBuffer =>
val _raw_ctx = _jffiBuffer.getAddress(0)
val ctx = getMuCtx(_raw_ctx)
val _RV = ctx.newIrBuilder()
val _RV = ctx.newIRBuilder()
val _RV_FAK = exposeMuIRBuilder(_RV)
_jffiBuffer.setAddressReturn(_RV_FAK)
}
......@@ -2294,8 +2293,6 @@ val MU_CI_UVM_IRBUILDER_NEW_CCALL = 0x34a
val MU_CI_UVM_IRBUILDER_NEW_NEWTHREAD = 0x34b
val MU_CI_UVM_IRBUILDER_NEW_SWAPSTACK = 0x34c
val MU_CI_UVM_IRBUILDER_NEW_COMMINST = 0x34d
def toDestKind(cval: MuDestKind): DestKind.Value = cval match {
}
def toBinOptr(cval: MuBinOptr): BinOptr.Value = cval match {
case 0x01 => BinOptr.ADD
case 0x02 => BinOptr.SUB
......
......@@ -8,7 +8,6 @@ import NativeSupport._
import PlatformConstants._
import uvm.refimpl._
import uvm.ssavariables.{ BinOptr, CmpOptr, ConvOptr, MemoryOrder, AtomicRMWOptr }
import uvm.ir.irbuilder.DestKind
import CDefsHelperFunctions._
import uvm.refimpl.MicroVM
......@@ -17,6 +16,7 @@ import java.nio.charset.StandardCharsets
import uvm.TrantientBundle
import uvm.types.Type
import uvm.ssavariables.Constant
import uvm.ir.irbuilder.IRBuilder
class ExposedMethod(name: String, jRetTy: JType, jParamTys: Array[JType], invokeFunc: Buffer => Unit) {
val closure = new SimpleClosure(name, invokeFunc)
......@@ -163,9 +163,9 @@ private object CDefsHelperFunctions {
}
}
def newConstIntEx(b: MuIRNode[TrantientBundle], ty: MuIRNode[Type], values: Seq[Long]): MuIRNode[Constant] = {
def newConstIntEx(b: IRBuilder, id: MuID, ty: MuID, values: Seq[Long]): Unit = {
val bigNum = unsignedLongSeqToBigInt(values)
ctx.newConstInt(b, ty, bigNum)
b.newConstInt(b, id, ty, value)
}
}
......
......@@ -253,6 +253,7 @@ object NativeClientSupport {
def getMicroVM(funcTableAddr: FuncTablePtr): MicroVM = getObjFromFuncTableAddrNotNull(funcTableAddr, microVMs)
def getMuCtx(funcTableAddr: FuncTablePtr): MuCtx = getObjFromFuncTableAddrNotNull(funcTableAddr, muCtxs)
def getMuIRBuilder(funcTableAddr: FuncTablePtr): IRBuilder = getObjFromFuncTableAddrNotNull(funcTableAddr, muIRBuilders)
/** Given a function table pointer, get an object from a ObjectReferenceManager. Assert it is not null. */
def getObjFromFuncTableAddrNotNull[T](funcTableAddr: FuncTablePtr, orm: ObjectReferenceManager[T]): T = {
......@@ -332,6 +333,13 @@ object NativeClientSupport {
funcTableAddr
}
/** Expose an IRBuilder. Return a pointer to the C MuIRBuilder structure. */
def exposeMuIRBuilder(irBuilder: IRBuilder): FuncTablePtr = {
val objFak = muIRBuilders.add(irBuilder).address()
val funcTableAddr = muIRBuilderExposer.makeFuncTable(objFak)
funcTableAddr
}
/** Expose a MuValue. Return an "object pointer", i.e. faked by ObjectReferenceManager. */
def exposeMuValue(muCtx: MuCtx, muValue: MuValue): MuValueFak = {
val fak = muValues.add(muValue).address()
......
package uvm
import uvm.refimpl.nat.PlatformConstants
package object refimpl {
/** Internal identifier of various things, such as threads and stacks, not related to MuID. */
type MuInternalID = Int
type Word = PlatformConstants.Word
}
\ No newline at end of file
......@@ -253,11 +253,11 @@ case class InstFence(var ord: MemoryOrder) extends Instruction
case class InstTrap(var retTys: Seq[Type], var excClause: Option[ExcClause], var keepalives: Seq[LocalVariable])
extends AbstractTrap with HasExcClause
case class InstWatchPoint(var wpID: Int, var retTys: Seq[Type],
case class InstWatchPoint(var wpID: MuID, var retTys: Seq[Type],
var dis: DestClause, var ena: DestClause, var exc: Option[DestClause],
var keepalives: Seq[LocalVariable]) extends AbstractTrap with Terminator
case class InstWPBranch(var wpID: Int, var dis: DestClause, var ena: DestClause) extends Instruction with Terminator
case class InstWPBranch(var wpID: MuID, var dis: DestClause, var ena: DestClause) extends Instruction with Terminator
case class InstCCall(var callConv: Flag, var funcTy: Type, var sig: FuncSig, var callee: SSAVariable,
var argList: Seq[SSAVariable], var excClause: Option[ExcClause], var keepalives: Seq[LocalVariable])
......
......@@ -47,7 +47,7 @@ case class TypeFuncRef(var sig: FuncSig) extends AbstractGenRefType
case class TypeThreadRef() extends AbstractGenRefType
case class TypeStackRef() extends AbstractGenRefType
case class TypeFrameCursorRef() extends AbstractGenRefType
case class TypeIRNodeRef() extends AbstractGenRefType
case class TypeIRBuilderRef() extends AbstractGenRefType
object Type {
def prettyPrint(ty: Type): String = ty match {
......@@ -69,7 +69,7 @@ object Type {
case TypeThreadRef() => "threadref"
case TypeStackRef() => "stackref"
case TypeFrameCursorRef() => "framecursorref"
case TypeIRNodeRef() => "irnoderef"
case TypeIRBuilderRef() => "irbuilderref"
case _ => "unknown type " + ty.getClass.getName
}
}
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