Commit f92fbb2f authored by Kunshan Wang's avatar Kunshan Wang

Passes gc and futex test.

parent 87c9ebdc
......@@ -11,6 +11,8 @@ import scala.collection.AbstractIterator
import uvm.refimpl.nat.NativeStackKeeper
import uvm.refimpl.nat.NativeCallResult
import uvm.refimpl.nat.NativeCallHelper
import org.slf4j.LoggerFactory
import com.typesafe.scalalogging.Logger
abstract class StackState
......@@ -216,8 +218,16 @@ class MuFrame(val funcVer: FuncVer, val cookie: Long, prev: Option[InterpreterFr
}
private def putBox(lv: LocalVariable) {
import MuFrame.logger
val ty = TypeInferer.inferType(lv)
boxes.put(lv, ValueBox.makeBoxForType(ty))
try {
boxes.put(lv, ValueBox.makeBoxForType(ty))
} catch {
case e: UvmRefImplException => {
logger.error("Having problem creating box for lv: %s".format(lv))
throw e
}
}
if (lv.isInstanceOf[Parameter]) {
edgeAssignedBoxes.put(lv.asInstanceOf[Parameter], ValueBox.makeBoxForType(ty))
}
......@@ -256,6 +266,10 @@ class MuFrame(val funcVer: FuncVer, val cookie: Long, prev: Option[InterpreterFr
}
}
object MuFrame {
val logger = Logger(LoggerFactory.getLogger(getClass.getName))
}
class NativeFrame(val func: Word, prev: Option[InterpreterFrame]) extends InterpreterFrame(prev) {
/**
* When calling back from native, maybeCallback is set to the CallBack object.
......
......@@ -33,7 +33,7 @@ class UvmInterpreterFutexTests extends UvmBundleTesterBase {
val trapName = nameOf(ca.currentInstruction(st, 0))
trapName match {
case "@futex_waiter_v1.trap_waiter" => {
case "@futex_waiter_v1.entry.trap_waiter" => {
val Seq(rv, sv) = ca.dumpKeepalives(st, 0)
ca.toInt(rv, signExt = true) shouldBe 0
......@@ -43,7 +43,7 @@ class UvmInterpreterFutexTests extends UvmBundleTesterBase {
TrapRebindPassVoid(st)
}
case "@futex_setter_v1.trap_setter" => {
case "@futex_setter_v1.wait_exit.trap_setter" => {
trapSetterReached = true
TrapRebindPassVoid(st)
......@@ -69,7 +69,7 @@ class UvmInterpreterFutexTests extends UvmBundleTesterBase {
val trapName = nameOf(ca.currentInstruction(st, 0))
trapName match {
case "@futex_delayer_v1.trap_delayer" => {
case "@futex_delayer_v1.entry.trap_delayer" => {
val Seq(rv) = ca.dumpKeepalives(st, 0)
ca.toInt(rv, signExt = true) shouldBe -3
......@@ -98,7 +98,7 @@ class UvmInterpreterFutexTests extends UvmBundleTesterBase {
val trapName = nameOf(ca.currentInstruction(st, 0))
trapName match {
case "@futex_no_sleep_v1.trap_no_sleep" => {
case "@futex_no_sleep_v1.entry.trap_no_sleep" => {
val Seq(rv) = ca.dumpKeepalives(st, 0)
ca.toInt(rv, signExt = true) shouldBe -1
......@@ -128,7 +128,7 @@ class UvmInterpreterFutexTests extends UvmBundleTesterBase {
val trapName = nameOf(ca.currentInstruction(st, 0))
trapName match {
case "@futex_requeue_waiter_v1.trap_requeue_waiter" => {
case "@futex_requeue_waiter_v1.entry.trap_requeue_waiter" => {
val Seq(rv) = ca.dumpKeepalives(st, 0)
ca.toInt(rv, signExt = true) shouldBe 0
......@@ -137,7 +137,7 @@ class UvmInterpreterFutexTests extends UvmBundleTesterBase {
TrapRebindPassVoid(st)
}
case "@futex_requeue_test_v1.trap_wait" => {
case "@futex_requeue_test_v1.wait_body.trap_wait" => {
val Seq(nt, nt2) = ca.dumpKeepalives(st, 0)
val nthr = nt.vb.asThread.get
......@@ -151,7 +151,7 @@ class UvmInterpreterFutexTests extends UvmBundleTesterBase {
TrapRebindPassValue(st, zero)
}
}
case "@futex_requeue_test_v1.trap_setter" => {
case "@futex_requeue_test_v1.wait_exit.trap_setter" => {
val Seq(nwakes, nwakes2) = ca.dumpKeepalives(st, 0)
ca.toInt(nwakes, signExt = true) shouldBe 1
......@@ -198,7 +198,7 @@ class UvmInterpreterFutexTests extends UvmBundleTesterBase {
val trapName = nameOf(ca.currentInstruction(st, 0))
trapName match {
case "@futex_gc_waiter_v1.trap_gc_waiter" => {
case "@futex_gc_waiter_v1.entry.trap_gc_waiter" => {
val Seq(rv) = ca.dumpKeepalives(st, 0)
ca.toInt(rv, signExt = true) shouldBe 0
......@@ -207,7 +207,7 @@ class UvmInterpreterFutexTests extends UvmBundleTesterBase {
TrapRebindPassVoid(st)
}
case "@futex_with_gc_v1.trap_wait" => {
case "@futex_with_gc_v1.wait_body.trap_wait" => {
val Seq(nt) = ca.dumpKeepalives(st, 0)
val nthr = nt.vb.asThread.get
......@@ -220,12 +220,12 @@ class UvmInterpreterFutexTests extends UvmBundleTesterBase {
TrapRebindPassValue(st, zero)
}
}
case "@futex_with_gc_v1.trap_gc" => {
case "@futex_with_gc_v1.wait_exit.trap_gc" => {
gc()
TrapRebindPassVoid(st)
}
case "@futex_with_gc_v1.trap_exit" => {
case "@futex_with_gc_v1.wait_exit.trap_exit" => {
val Seq(nwakes) = ca.dumpKeepalives(st, 0)
ca.toInt(nwakes, signExt = true) shouldBe 1
......
......@@ -45,11 +45,11 @@ class UvmInterpreterGCTests extends UvmBundleTesterBase {
val func = ca.putFunction("@keepglobal")
testFunc(ca, func, Seq()) { (ca, th, st, wp) =>
nameOf(ca.currentInstruction(st, 0)) match {
case "@keepglobal_v1.gctrap" => {
case "@keepglobal_v1.entry.gctrap" => {
gc()
TrapRebindPassVoid(st)
}
case "@keepglobal_v1.checktrap" => {
case "@keepglobal_v1.entry.checktrap" => {
val Seq(obj2, obj2val) = ca.dumpKeepalives(st, 0)
obj2.vb.asRef shouldNot be(0L)
......@@ -69,11 +69,11 @@ class UvmInterpreterGCTests extends UvmBundleTesterBase {
val func = ca.putFunction("@nokeepalloca")
testFunc(ca, func, Seq()) { (ca, th, st, wp) =>
nameOf(ca.currentInstruction(st, 0)) match {
case "@nokeepalloca_v1.gctrap" => {
case "@nokeepalloca_v1.entry.gctrap" => {
gc()
TrapRebindPassVoid(st)
}
case "@allocatest_v1.gctrap" => {
case "@allocatest_v1.entry.gctrap" => {
gc()
TrapRebindPassVoid(st)
}
......@@ -119,18 +119,18 @@ class UvmInterpreterGCTests extends UvmBundleTesterBase {
val func = ca.putFunction("@testweakref")
testFunc(ca, func, Seq()) { (ca, th, st, wp) =>
nameOf(ca.currentInstruction(st, 0)) match {
case "@testweakref_v1.gctrap" => {
case "@testweakref_v1.entry.gctrap" => {
gc()
TrapRebindPassVoid(st)
}
case "@peekweakref_v1.checknztrap" => {
case "@peekweakref_v1.entry.checknztrap" => {
val Seq(refval) = ca.dumpKeepalives(st, 0)
refval.vb.asRef shouldNot be(0L)
TrapRebindPassVoid(st)
}
case "@testweakref_v1.checkztrap" => {
case "@testweakref_v1.entry.checkztrap" => {
val Seq(refval) = ca.dumpKeepalives(st, 0)
refval.vb.asRef should be(0L)
......@@ -151,12 +151,12 @@ class UvmInterpreterGCTests extends UvmBundleTesterBase {
val func = ca.putFunction("@testtagrefgc")
testFunc(ca, func, Seq()) { (ca, th, st, wp) =>
nameOf(ca.currentInstruction(st, 0)) match {
case "@testtagrefgc_v1.gctrap" => {
case "@testtagrefgc_v1.entry.gctrap" => {
gc()
TrapRebindPassVoid(st)
}
case "@testtagrefgc_v1.checktrap" => {
case "@testtagrefgc_v1.entry.checktrap" => {
val Seq(tr, refv, tagv, iv) = ca.dumpKeepalives(st, 0)
ca.toInt(tagv) shouldBe 13
......@@ -178,12 +178,12 @@ class UvmInterpreterGCTests extends UvmBundleTesterBase {
val func = ca.putFunction("@testtagrefgcmem")
testFunc(ca, func, Seq()) { (ca, th, st, wp) =>
nameOf(ca.currentInstruction(st, 0)) match {
case "@testtagrefgcmem_v1.gctrap" => {
case "@testtagrefgcmem_v1.entry.gctrap" => {
gc()
TrapRebindPassVoid(st)
}
case "@testtagrefgcmem_v1.checktrap" => {
case "@testtagrefgcmem_v1.entry.checktrap" => {
val Seq(tr, refv, tagv, iv) = ca.dumpKeepalives(st, 0)
ca.toInt(tagv) shouldBe 13
......
......@@ -8,8 +8,8 @@
.const @I32_0 <@i32> = 0
.const @I32_1 <@i32> = 1
.funcdef @futex_waiter VERSION @futex_waiter_v1 <@noparamsnoret> () {
%entry:
.funcdef @futex_waiter VERSION @futex_waiter_v1 <@noparamsnoret> {
%entry():
%rv = COMMINST @uvm.futex.wait <@i32> (@the_futex @I32_0)
%sv = LOAD <@i64> @shared_value1
......@@ -17,8 +17,8 @@
COMMINST @uvm.thread_exit
}
.funcdef @futex_setter VERSION @futex_setter_v1 <@noparamsnoret> () {
%entry:
.funcdef @futex_setter VERSION @futex_setter_v1 <@noparamsnoret> {
%entry():
STORE <@i64> @shared_value1 @I64_0
STORE <@i64> @shared_value2 @I64_0
STORE <@i32> @the_futex @I32_0
......@@ -28,30 +28,30 @@
STORE <@i64> @shared_value1 @I64_42
BRANCH %wait_body
BRANCH %wait_body()
%wait_body:
%wait_body():
%nwakes = COMMINST @uvm.futex.wake <@i32> (@the_futex @I32_1)
%is_1 = EQ <@i32> %nwakes @I32_1
BRANCH2 %is_1 %wait_exit %wait_body
BRANCH2 %is_1 %wait_exit() %wait_body()
%wait_exit:
%wait_exit():
%trap_setter = TRAP <@void>
COMMINST @uvm.thread_exit
}
.const @I64_ONE_SECOND <@i64> = 1000000000
.funcdef @futex_delayer VERSION @futex_delayer_v1 <@noparamsnoret> () {
%entry:
.funcdef @futex_delayer VERSION @futex_delayer_v1 <@noparamsnoret> {
%entry():
STORE <@i32> @the_futex @I32_0
%rv = COMMINST @uvm.futex.wait_timeout <@i32> (@the_futex @I32_0 @I64_ONE_SECOND)
%trap_delayer = TRAP <@void> KEEPALIVE(%rv)
COMMINST @uvm.thread_exit
}
.funcdef @futex_no_sleep VERSION @futex_no_sleep_v1 <@noparamsnoret> () {
%entry:
.funcdef @futex_no_sleep VERSION @futex_no_sleep_v1 <@noparamsnoret> {
%entry():
STORE <@i32> @the_futex @I32_0
%rv = COMMINST @uvm.futex.wait <@i32> (@the_futex @I32_1)
%trap_no_sleep = TRAP <@void> KEEPALIVE(%rv)
......@@ -60,15 +60,15 @@
.global @the_other_futex <@i32>
.funcdef @futex_requeue_waiter VERSION @futex_requeue_waiter_v1 <@noparamsnoret> () {
%entry:
.funcdef @futex_requeue_waiter VERSION @futex_requeue_waiter_v1 <@noparamsnoret> {
%entry():
%rv = COMMINST @uvm.futex.wait <@i32> (@the_futex @I32_0)
%trap_requeue_waiter = TRAP <@void> KEEPALIVE(%rv)
COMMINST @uvm.thread_exit
}
.funcdef @futex_requeue_test VERSION @futex_requeue_test_v1 <@noparamsnoret> () {
%entry:
.funcdef @futex_requeue_test VERSION @futex_requeue_test_v1 <@noparamsnoret> {
%entry():
STORE <@i32> @the_futex @I32_0
STORE <@i32> @the_other_futex @I32_0
......@@ -78,14 +78,14 @@
%ns2 = NEWSTACK <@noparamsnoret> @futex_requeue_waiter ()
%nt2 = COMMINST @uvm.new_thread (%ns2)
BRANCH %wait_body
BRANCH %wait_body(%nt %nt2)
%wait_body:
%wait_body(<@thread> %nt <@thread> %nt2):
%trap_wait = TRAP <@i32> KEEPALIVE (%nt %nt2)
%is_1 = EQ <@i32> %trap_wait @I32_1
BRANCH2 %is_1 %wait_exit %wait_body
BRANCH2 %is_1 %wait_exit() %wait_body()
%wait_exit:
%wait_exit():
%nwakes = COMMINST @uvm.futex.cmp_requeue <@i32> (@the_futex @the_other_futex @I32_0 @I32_1)
%nwakes2 = COMMINST @uvm.futex.wake <@i32> (@the_other_futex @I32_1)
%trap_setter = TRAP <@void> KEEPALIVE (%nwakes %nwakes2)
......@@ -96,16 +96,16 @@
.typedef @irefi32 = iref<@i32>
.funcsig @futex_gc_waiter_sig = @void (@refi32)
.funcdef @futex_gc_waiter VERSION @futex_gc_waiter_v1 <@futex_gc_waiter_sig> (%ref) {
%entry:
.funcdef @futex_gc_waiter VERSION @futex_gc_waiter_v1 <@futex_gc_waiter_sig> {
%entry(<@refi32> %ref):
%ir = GETIREF <@i32> %ref
%rv = COMMINST @uvm.futex.wait <@i32> (%ir @I32_0)
%trap_gc_waiter = TRAP <@void> KEEPALIVE(%rv)
COMMINST @uvm.thread_exit
}
.funcdef @futex_with_gc VERSION @futex_with_gc_v1 <@noparamsnoret> () {
%entry:
.funcdef @futex_with_gc VERSION @futex_with_gc_v1 <@noparamsnoret> {
%entry():
%obj = NEW <@i64>
%ir = GETIREF <@i64> %obj
STORE <@i32> %ir @I32_0
......@@ -113,14 +113,14 @@
%ns = NEWSTACK <@noparamsnoret> @futex_gc_waiter (%obj)
%nt = COMMINST @uvm.new_thread (%ns)
BRANCH %wait_body
BRANCH %wait_body(%ir %nt)
%wait_body:
%wait_body(<@irefi64> %ir <@thread> %nt):
%trap_wait = TRAP <@i32> KEEPALIVE (%nt)
%is_1 = EQ <@i32> %trap_wait @I32_1
BRANCH2 %is_1 %wait_exit %wait_body
BRANCH2 %is_1 %wait_exit(%ir) %wait_body(%ir %nt)
%wait_exit:
%wait_exit(<@irefi64> %ir):
%trap_gc = TRAP<@void>
%nwakes = COMMINST @uvm.futex.wake <@i32> (%ir @I32_1)
......
......@@ -9,10 +9,10 @@
.funcsig @noparamsnoret = @void ()
.typedef @funcdumb = func<@noparamsnoret>
.typedef @funcdumb = funcref<@noparamsnoret>
.typedef @thread = thread
.typedef @stack = stack
.typedef @thread = threadref
.typedef @stack = stackref
.typedef @tagref64 = tagref64
.const @TRUE <@i64> = 1
......@@ -64,6 +64,8 @@
.typedef @weakrefvoid = weakref<@void>
.const @NULLREF <@refvoid> = NULL
.const @VOID <@void> = NULL
.typedef @StructFoo = struct <@i32 @i64 @float @double>
.const @STRUCT_FOO <@StructFoo> = {@I32_1 @I64_2 @F_3 @D_4}
......@@ -106,8 +108,8 @@
.global @g_refi64 <@refi64>
.funcdef @keepglobal VERSION @keepglobal_v1 <@noparamsnoret> () {
%entry:
.funcdef @keepglobal VERSION @keepglobal_v1 <@noparamsnoret> {
%entry():
CALL <@noparamsnoret> @storeglobal ()
%gctrap = TRAP <@void>
......@@ -122,68 +124,67 @@
COMMINST @uvm.thread_exit
}
.funcdef @storeglobal VERSION @storeglobal_v1 <@noparamsnoret> () {
%entry:
.funcdef @storeglobal VERSION @storeglobal_v1 <@noparamsnoret> {
%entry():
%obj = NEW <@i64>
STORE <@refi64> @g_refi64 %obj
%iref = GETIREF <@i64> %obj
STORE <@i64> %iref @I64_42
RETVOID
RET @VOID
}
.funcdef @nokeepalloca VERSION @nokeepalloca_v1 <@noparamsnoret> () {
%entry:
.funcdef @nokeepalloca VERSION @nokeepalloca_v1 <@noparamsnoret> {
%entry():
CALL <@noparamsnoret> @allocatest ()
%gctrap = TRAP <@void>
COMMINST @uvm.thread_exit
}
.funcdef @allocatest VERSION @allocatest_v1 <@noparamsnoret> () {
%entry:
.funcdef @allocatest VERSION @allocatest_v1 <@noparamsnoret> {
%entry():
%alloca = ALLOCA <@refi64>
CALL <@allocasettersig> @allocasetter (%alloca)
%gctrap = TRAP <@void>
RETVOID
RET @VOID
}
.funcsig @allocasettersig = @void (@irefi64)
.funcdef @allocasetter VERSION @allocasetter_v1 <@allocasettersig> (%ir) {
%entry:
.funcdef @allocasetter VERSION @allocasetter_v1 <@allocasettersig> {
%entry(<@irefi64> %ir):
%obj = NEW <@i64>
%iref = GETIREF <@i64> %obj
STORE <@i64> %iref @I64_42
STORE <@refi64> %ir %obj
RETVOID
RET @VOID
}
.const @CRAZY_ALLOC_COUNT <@i64> = 1000
.funcdef @crazy_allocator VERSION @crazy_allocator_v1 <@noparamsnoret> () {
%entry:
BRANCH %head
.funcdef @crazy_allocator VERSION @crazy_allocator_v1 <@noparamsnoret> {
%entry():
BRANCH %head(@CRAZY_ALLOC_COUNT)
%head:
%togo = PHI <@i64> { %entry: @CRAZY_ALLOC_COUNT; %body: %togo2; }
%head(<@i64> %togo):
%nz = NE <@i64> %togo @I64_0
BRANCH2 %nz %body %exit
BRANCH2 %nz %body(%togo) %exit()
%body:
%body(<@i64> %togo):
NEWHYBRID <@hCharArray @i64> @I64_30000
%togo2 = SUB <@i64> %togo @I64_1
BRANCH %head
BRANCH %head(%togo2)
%exit:
RETVOID
%exit():
RET @VOID
}
.funcdef @crazy_allocation_test VERSION @crazy_allocation_test_v1 <@noparamsnoret> () {
%entry:
.funcdef @crazy_allocation_test VERSION @crazy_allocation_test_v1 <@noparamsnoret> {
%entry():
CALL <@noparamsnoret> @crazy_allocator ()
COMMINST @uvm.thread_exit
}
......@@ -195,38 +196,35 @@
.const @NALLOCS <@i64> = 1000000
// Retain one object per @REM_SZ objects. Testing defragmentation
.funcdef @breadcrumbs VERSION @breadcrumbs_v1 <@noparamsnoret> () {
%entry:
.funcdef @breadcrumbs VERSION @breadcrumbs_v1 <@noparamsnoret> {
%entry():
%remember = NEWHYBRID <@refi64array @i64> @REM_SZ
%rememberiref = GETIREF <@refi64array> %remember
%remv = GETVARPARTIREF <@refi64array> %rememberiref
BRANCH %head
BRANCH %head(@I64_0 @I64_0 %remv)
%head:
%i = PHI <@i64> { %entry: @I64_0; %next: %i2; }
%nrem = PHI <@i64> { %entry: @I64_0; %next: %nrem3; }
%head(<@i64> %i <@i64> %nrem <@irefi64> %remv):
%enough = SLT <@i64> %i @NALLOCS
BRANCH2 %enough %body %exit
BRANCH2 %enough %body(%i %nrem %remv) %exit()
%body:
%body(<@i64> %i <@i64> %nrem <@irefi64> %remv):
%obj = NEW <@i64>
%rem = SREM <@i64> %i @REM_PER_ALLOC
%z = EQ <@i64> %rem @I64_0
BRANCH2 %z %body2 %next
BRANCH2 %z %body2(%i %nrem %remv %obj) %next(%i %nrem %remv)
%body2:
%body2(<@i64> %i <@i64> %nrem <@irefi64> %remv <@refi64> %obj):
%loc = SHIFTIREF <@refi64 @i64> %remv %nrem
STORE <@refi64> %loc %obj
%nrem2 = ADD <@i64> %nrem @I64_1
BRANCH %next
BRANCH %next(%i %nrem2 %remv)
%next:
%nrem3 = PHI <@i64> { %body: %nrem; %body2: %nrem2; }
%next(<@i64> %i <@i64> %nrem <@irefi64> %remv):
%i2 = ADD <@i64> %i @I64_1
BRANCH %head
BRANCH %head(%i2 %nrem %remv)
%exit:
%exit():
COMMINST @uvm.thread_exit
}
......@@ -234,24 +232,24 @@
.funcsig @makestorewri64sig = @void (@WRI64Cell)
.funcdef @makestorewri64 VERSION @makestorewri64_v1 <@makestorewri64sig> (%cell) {
%entry:
.funcdef @makestorewri64 VERSION @makestorewri64_v1 <@makestorewri64sig> {
%entry(<@WRI64Cell> %cell):
%ri64 = NEW <@i64>
%iri64 = GETIREF <@i64> %ri64
STORE <@i64> %iri64 @I64_42
STORE <@weakrefi64> %cell %ri64
RETVOID
RET @VOID
}
.funcdef @peekweakref VERSION @peekweakref_v1 <@makestorewri64sig> (%cell) {
%entry:
.funcdef @peekweakref VERSION @peekweakref_v1 <@makestorewri64sig> {
%entry(<@WRI64Cell> %cell):
%refval = LOAD <@weakrefi64> %cell
%checknztrap = TRAP <@void> KEEPALIVE (%refval)
RETVOID
RET @VOID
}
.funcdef @testweakref VERSION @testweakref_v1 <@noparamsnoret> () {
%entry:
.funcdef @testweakref VERSION @testweakref_v1 <@noparamsnoret> {
%entry():
%irwr = ALLOCA <@weakrefi64>
CALL <@makestorewri64sig> @makestorewri64 (%irwr)
CALL <@makestorewri64sig> @peekweakref (%irwr)
......@@ -270,18 +268,18 @@
.funcsig @maketr64intref_sig = @tagref64 ()
.funcdef @maketr64intref VERSION @maketr64intref_v1 <@maketr64intref_sig> () {
%entry:
.funcdef @maketr64intref VERSION @maketr64intref_v1 <@maketr64intref_sig> {
%entry():
%refi64 = NEW <@i64>
%irefi64 = GETIREF <@i64> %refi64
STORE <@i64> %irefi64 @I64_42
%refv = REFCAST <@refi64 @refvoid> %refi64
%tr = COMMINST @uvm.tr64.from_ref (%refv @I6_13)
RET <@tagref64> %tr
RET %tr
}
.funcdef @testtagrefgc VERSION @testtagrefgc_v1 <@noparamsnoret> () {
%entry:
.funcdef @testtagrefgc VERSION @testtagrefgc_v1 <@noparamsnoret> {
%entry():
%tr = CALL <@maketr64intref_sig> @maketr64intref ()
%gctrap = TRAP <@void>
......@@ -301,8 +299,8 @@
.typedef @ireftr64 = iref<@tagref64>
.funcsig @settr64intref_sig = @void (@ireftr64)
.funcdef @settr64intref VERSION @settr64intref_v1 <@settr64intref_sig> (%ireftr64) {
%entry:
.funcdef @settr64intref VERSION @settr64intref_v1 <@settr64intref_sig> {
%entry(<@ireftr64> %ireftr64):
%refi64 = NEW <@i64>
%irefi64 = GETIREF <@i64> %refi64
STORE <@i64> %irefi64 @I64_42
......@@ -310,11 +308,11 @@
%tr = COMMINST @uvm.tr64.from_ref (%refv @I6_13)
STORE <@tagref64> %ireftr64 %tr
RETVOID
RET @VOID
}
.funcdef @testtagrefgcmem VERSION @testtagrefgcmem_v1 <@noparamsnoret> () {
%entry:
.funcdef @testtagrefgcmem VERSION @testtagrefgcmem_v1 <@noparamsnoret> {
%entry():
%ireftr64 = ALLOCA <@tagref64>
CALL <@settr64intref_sig> @settr64intref (%ireftr64)
%gctrap = TRAP <@void>
......@@ -333,64 +331,60 @@
.typedef @tr64array = hybrid <@void @tagref64>
.funcdef @breadcrumbstr64 VERSION @breadcrumbstr64_v1 <@noparamsnoret> () {
%entry:
.funcdef @breadcrumbstr64 VERSION @breadcrumbstr64_v1 <@noparamsnoret> {
%entry():
%remember = NEWHYBRID <@tr64array @i64> @REM_SZ
%rememberiref = GETIREF <@tr64array> %remember
%remv = GETVARPARTIREF <@tr64array> %rememberiref
BRANCH %head
BRANCH %head(@I64_0 @I64_0 %remv)
%head:
%i = PHI <@i64> { %entry: @I64_0; %next: %i2; }
%nrem = PHI <@i64> { %entry: @I64_0; %next: %nrem3; }
%head(<@i64> %i <@i64> %nrem <@irefi64> %remv):
%enough = SLT <@i64> %i @NALLOCS
BRANCH2 %enough %body %exit
BRANCH2 %enough %body(%i %nrem %remv) %exit()
%body:
%body(<@i64> %i <@i64> %nrem <@irefi64> %remv):
%obj = NEW <@i64>
%rem = SREM <@i64> %i @REM_PER_ALLOC
%z = EQ <@i64> %rem @I64_0
BRANCH2 %z %body2 %next
BRANCH2 %z %body2(%i %nrem %remv %obj) %next(%i %nrem %remv)
%body2:
%body2(<@i64> %i <@i64> %nrem <@irefi64> %remv <@refi64> %obj):
%loc = SHIFTIREF <@tagref64 @i64> %remv %nrem
%objv = REFCAST <@refi64 @refvoid> %obj
%tr = COMMINST @uvm.tr64.from_ref(%objv @I6_13)
STORE <@tagref64> %loc %tr
%nrem2 = ADD <@i64> %nrem @I64_1
BRANCH %next
BRANCH %next(%i %nrem2 %remv)
%next:
%nrem3 = PHI <@i64> { %body: %nrem; %body2: %nrem2; }
%next(<@i64> %i <@i64> %nrem <@irefi64> %remv):
%i2 = ADD <@i64> %i @I64_1
BRANCH %head
BRANCH %head(%i2 %nrem %remv)
%exit:
%exit():
COMMINST @uvm.thread_exit()
}
.funcdef @emptystack VERSION @emptystack_v1 <@noparamsnoret> () {
%entry:
RETVOID