Supported cycles during object subgraph freezing
This commit is contained in:
+1
-1
@@ -259,7 +259,7 @@ internal class KonanSymbols(context: Context, val symbolTable: SymbolTable): Sym
|
||||
context.getInternalFunctions("initInstance").single())
|
||||
|
||||
val freeze = symbolTable.referenceSimpleFunction(
|
||||
builtInsPackage("konan", "worker").getContributedFunctions(Name.identifier("freezeAllowCycles"), NoLookupLocation.FROM_BACKEND).single())
|
||||
builtInsPackage("konan", "worker").getContributedFunctions(Name.identifier("freeze"), NoLookupLocation.FROM_BACKEND).single())
|
||||
|
||||
val getContinuation = symbolTable.referenceSimpleFunction(
|
||||
context.getInternalFunctions("getContinuation").single())
|
||||
|
||||
+1
@@ -42,6 +42,7 @@ class Runtime(bitcodeFile: String) {
|
||||
val objHeaderType = getStructType("ObjHeader")
|
||||
val objHeaderPtrType = pointerType(objHeaderType)
|
||||
val arrayHeaderType = getStructType("ArrayHeader")
|
||||
val containerHeaderType = getStructType("ContainerHeader")
|
||||
|
||||
val frameOverlayType = getStructType("FrameOverlay")
|
||||
|
||||
|
||||
+4
-4
@@ -32,14 +32,14 @@ import org.jetbrains.kotlin.types.TypeProjection
|
||||
import org.jetbrains.kotlin.types.replace
|
||||
|
||||
private fun StaticData.objHeader(typeInfo: ConstPointer): Struct {
|
||||
val containerOffsetNegative = 0 // Static object mark.
|
||||
return Struct(runtime.objHeaderType, typeInfo, Int32(containerOffsetNegative))
|
||||
val container = NullPointer(runtime.containerHeaderType) // Static object mark.
|
||||
return Struct(runtime.objHeaderType, typeInfo, container)
|
||||
}
|
||||
|
||||
private fun StaticData.arrayHeader(typeInfo: ConstPointer, length: Int): Struct {
|
||||
assert (length >= 0)
|
||||
val containerOffsetNegative = 0 // Static object mark.
|
||||
return Struct(runtime.arrayHeaderType, typeInfo, Int32(containerOffsetNegative), Int32(length))
|
||||
val container = NullPointer(runtime.containerHeaderType) // Static object mark.
|
||||
return Struct(runtime.arrayHeaderType, typeInfo, container, Int32(length))
|
||||
}
|
||||
|
||||
internal fun StaticData.createKotlinStringLiteral(value: String): ConstPointer {
|
||||
|
||||
Reference in New Issue
Block a user