Optimize cmd VM with scoped slot addressing
This commit is contained in:
1 parent
7de856fc62
commit
bef94d3bc5
30 files changed
+2829
-1721
No files matched your search
@@ -42,4 +42,4 @@ actual object PerfDefaults {
|
||||
actual val ARG_SMALL_ARITY_12: Boolean = false
|
||||
actual val INDEX_PIC_SIZE_4: Boolean = false
|
||||
actual val RANGE_FAST_ITER: Boolean = false
|
||||
}
|
||||
}
|
||||
+3
-3
@@ -18,12 +18,12 @@ package net.sergeych.lyng.bytecode
|
||||
|
||||
import java.util.IdentityHashMap
|
||||
|
||||
internal actual object BytecodeCallSiteCache {
|
||||
internal actual object CmdCallSiteCache {
|
||||
private val cache = ThreadLocal.withInitial {
|
||||
IdentityHashMap<BytecodeFunction, MutableMap<Int, MethodCallSite>>()
|
||||
IdentityHashMap<CmdFunction, MutableMap<Int, MethodCallSite>>()
|
||||
}
|
||||
|
||||
actual fun methodCallSites(fn: BytecodeFunction): MutableMap<Int, MethodCallSite> {
|
||||
actual fun methodCallSites(fn: CmdFunction): MutableMap<Int, MethodCallSite> {
|
||||
val map = cache.get()
|
||||
return map.getOrPut(fn) { mutableMapOf() }
|
||||
}
|
||||
Reference in new issue
Block a user