graal update with graal compiler

This commit is contained in:
minjaesong
2026-04-13 22:20:50 +09:00
parent ca977b074d
commit 1208690c4f
76 changed files with 84 additions and 99 deletions

View File

@@ -141,6 +141,26 @@ class VMJSR223Delegate(private val vm: VM) {
for (i in 0 until len) vm.poke(to + i*toVector, vm.peek(from + i*fromVector)!!)
}
}
fun pokeBytes(dest: Int, src: org.graalvm.polyglot.Value, len: Int) {
val destL = dest.toLong()
val lenL = len.toLong()
val devPtr = getDev(destL, lenL, true)
if (devPtr != null) {
var i = 0
while (i < len) {
UnsafeHelper.unsafe.putByte(devPtr + i, src.getArrayElement(i.toLong()).asInt().toByte())
i++
}
} else {
val vector = if (destL >= 0) 1L else -1L
var i = 0
while (i < len) {
vm.poke(destL + i * vector, src.getArrayElement(i.toLong()).asInt().toByte())
i++
}
}
}
fun mapRom(slot: Int) {
vm.romMapping = slot.and(255)
}

View File

@@ -4,7 +4,7 @@ import net.torvald.tsvm.VM
import java.util.concurrent.atomic.AtomicBoolean
import java.util.concurrent.atomic.AtomicInteger
abstract class BlockTransferInterface(val isMaster: Boolean, val isSlave: Boolean, val baudRate: Int = 20_000_000) {
abstract class BlockTransferInterface(val isMaster: Boolean, val isSlave: Boolean, val baudRate: Int = 0) {
var recipient: BlockTransferInterface? = null; protected set