@@ -295,14 +295,14 @@ object HelperFunctions {
295
295
val fctx = WasmFunctionContext (
296
296
genFunctionName.createClassOf,
297
297
List (" typeData" -> typeDataType),
298
- List (WasmRefType (WasmHeapType . ClassType ))
298
+ List (WasmRefType (genTypeName. ClassStruct ))
299
299
)
300
300
301
301
val List (typeDataParam) = fctx.paramIndices
302
302
303
303
import fctx .instrs
304
304
305
- val classInstanceLocal = fctx.addLocal(" classInstance" , WasmRefType (WasmHeapType . ClassType ))
305
+ val classInstanceLocal = fctx.addLocal(" classInstance" , WasmRefType (genTypeName. ClassStruct ))
306
306
307
307
// classInstance := newDefault$java.lang.Class()
308
308
// leave it on the stack for the constructor call
@@ -413,14 +413,14 @@ object HelperFunctions {
413
413
val fctx = WasmFunctionContext (
414
414
genFunctionName.getClassOf,
415
415
List (" typeData" -> typeDataType),
416
- List (WasmRefType (WasmHeapType . ClassType ))
416
+ List (WasmRefType (genTypeName. ClassStruct ))
417
417
)
418
418
419
419
val List (typeDataParam) = fctx.paramIndices
420
420
421
421
import fctx .instrs
422
422
423
- instrs.block(WasmRefType (WasmHeapType . ClassType )) { alreadyInitializedLabel =>
423
+ instrs.block(WasmRefType (genTypeName. ClassStruct )) { alreadyInitializedLabel =>
424
424
// fast path
425
425
instrs += LOCAL_GET (typeDataParam)
426
426
instrs += STRUCT_GET (genTypeName.typeData, genFieldIdx.typeData.classOfIdx)
@@ -976,7 +976,7 @@ object HelperFunctions {
976
976
val fctx = WasmFunctionContext (
977
977
genFunctionName.getComponentType,
978
978
List (" typeData" -> typeDataType),
979
- List (WasmRefType .nullable(WasmHeapType . ClassType ))
979
+ List (WasmRefType .nullable(genTypeName. ClassStruct ))
980
980
)
981
981
982
982
val List (typeDataParam) = fctx.paramIndices
@@ -997,7 +997,7 @@ object HelperFunctions {
997
997
instrs += CALL (genFunctionName.getClassOf)
998
998
instrs += RETURN
999
999
} // end block nullResultLabel
1000
- instrs += REF_NULL (WasmHeapType . ClassType )
1000
+ instrs += REF_NULL (WasmHeapType (genTypeName. ClassStruct ) )
1001
1001
1002
1002
fctx.buildAndAddToContext()
1003
1003
}
@@ -1013,7 +1013,7 @@ object HelperFunctions {
1013
1013
val fctx = WasmFunctionContext (
1014
1014
genFunctionName.newArrayOfThisClass,
1015
1015
List (" typeData" -> typeDataType, " lengths" -> WasmRefType .anyref),
1016
- List (WasmRefType (WasmHeapType . ObjectType ))
1016
+ List (WasmRefType (genTypeName. ObjectStruct ))
1017
1017
)
1018
1018
1019
1019
val List (typeDataParam, lengthsParam) = fctx.paramIndices
@@ -1090,7 +1090,7 @@ object HelperFunctions {
1090
1090
val fctx = WasmFunctionContext (
1091
1091
genFunctionName.anyGetClass,
1092
1092
List (" value" -> WasmRefType .any),
1093
- List (WasmRefType .nullable(WasmHeapType . ClassType ))
1093
+ List (WasmRefType .nullable(genTypeName. ClassStruct ))
1094
1094
)
1095
1095
1096
1096
val List (valueParam) = fctx.paramIndices
@@ -1100,20 +1100,20 @@ object HelperFunctions {
1100
1100
val typeDataLocal = fctx.addLocal(" typeData" , typeDataType)
1101
1101
val doubleValueLocal = fctx.addLocal(" doubleValue" , WasmFloat64 )
1102
1102
val intValueLocal = fctx.addLocal(" intValue" , WasmInt32 )
1103
- val ourObjectLocal = fctx.addLocal(" ourObject" , WasmRefType (WasmHeapType . ObjectType ))
1103
+ val ourObjectLocal = fctx.addLocal(" ourObject" , WasmRefType (genTypeName. ObjectStruct ))
1104
1104
1105
1105
def getHijackedClassTypeDataInstr (className : IRNames .ClassName ): WasmInstr =
1106
1106
GLOBAL_GET (genGlobalName.forVTable(className))
1107
1107
1108
- instrs.block(WasmRefType .nullable(WasmHeapType . ClassType )) { nonNullClassOfLabel =>
1108
+ instrs.block(WasmRefType .nullable(genTypeName. ClassStruct )) { nonNullClassOfLabel =>
1109
1109
instrs.block(typeDataType) { gotTypeDataLabel =>
1110
- instrs.block(WasmRefType (WasmHeapType . ObjectType )) { ourObjectLabel =>
1110
+ instrs.block(WasmRefType (genTypeName. ObjectStruct )) { ourObjectLabel =>
1111
1111
// if value is our object, jump to $ourObject
1112
1112
instrs += LOCAL_GET (valueParam)
1113
1113
instrs += BR_ON_CAST (
1114
1114
ourObjectLabel,
1115
1115
WasmRefType .any,
1116
- WasmRefType (WasmHeapType . ObjectType )
1116
+ WasmRefType (genTypeName. ObjectStruct )
1117
1117
)
1118
1118
1119
1119
// switch(jsValueType(value)) { ... }
@@ -1209,7 +1209,7 @@ object HelperFunctions {
1209
1209
}
1210
1210
) { () =>
1211
1211
// case _ (JSValueTypeOther) => return null
1212
- instrs += REF_NULL (WasmHeapType . ClassType )
1212
+ instrs += REF_NULL (WasmHeapType (genTypeName. ClassStruct ) )
1213
1213
instrs += RETURN
1214
1214
}
1215
1215
@@ -1263,7 +1263,7 @@ object HelperFunctions {
1263
1263
val objectVTableType = WasmRefType (genTypeName.ObjectVTable )
1264
1264
val arrayTypeDataType = objectVTableType
1265
1265
val itablesType = WasmRefType .nullable(genTypeName.itables)
1266
- val nonNullObjectType = WasmRefType (WasmHeapType . ObjectType )
1266
+ val nonNullObjectType = WasmRefType (genTypeName. ObjectStruct )
1267
1267
val anyArrayType = WasmRefType (genTypeName.anyArray)
1268
1268
1269
1269
val fctx = WasmFunctionContext (
@@ -1478,7 +1478,7 @@ object HelperFunctions {
1478
1478
instrs += LOCAL_TEE (objNonNullLocal)
1479
1479
1480
1480
// If `obj` is one of our objects, skip all the jsValueType tests
1481
- instrs += REF_TEST (WasmRefType (WasmHeapType . ObjectType ))
1481
+ instrs += REF_TEST (WasmRefType (genTypeName. ObjectStruct ))
1482
1482
instrs += I32_EQZ
1483
1483
instrs.ifThen() {
1484
1484
instrs.switch() { () =>
@@ -1690,11 +1690,11 @@ object HelperFunctions {
1690
1690
instrs += BR_ON_CAST_FAIL (
1691
1691
testFail,
1692
1692
WasmRefType .anyref,
1693
- WasmRefType (Types . WasmHeapType . ObjectType )
1693
+ WasmRefType (genTypeName. ObjectStruct )
1694
1694
)
1695
1695
1696
1696
// get itables and store
1697
- instrs += STRUCT_GET (Types . WasmHeapType . ObjectType .typ , genFieldIdx.objStruct.itables)
1697
+ instrs += STRUCT_GET (genTypeName. ObjectStruct , genFieldIdx.objStruct.itables)
1698
1698
instrs += LOCAL_SET (itables)
1699
1699
1700
1700
// Dummy return value from the block
@@ -1767,8 +1767,8 @@ object HelperFunctions {
1767
1767
WasmHeapType (genTypeName.forClass(clazz.name.name))
1768
1768
val fctx = WasmFunctionContext (
1769
1769
genFunctionName.clone(clazz.name.name),
1770
- List (" from" -> WasmRefType (WasmHeapType . ObjectType )),
1771
- List (WasmRefType (WasmHeapType . ObjectType ))
1770
+ List (" from" -> WasmRefType (genTypeName. ObjectStruct )),
1771
+ List (WasmRefType (genTypeName. ObjectStruct ))
1772
1772
)
1773
1773
val List (fromParam) = fctx.paramIndices
1774
1774
import fctx .instrs
@@ -1811,8 +1811,8 @@ object HelperFunctions {
1811
1811
1812
1812
val fctx = WasmFunctionContext (
1813
1813
genFunctionName.clone(arrayTypeRef.base),
1814
- List (" from" -> WasmRefType (WasmHeapType . ObjectType )),
1815
- List (WasmRefType (WasmHeapType . ObjectType ))
1814
+ List (" from" -> WasmRefType (genTypeName. ObjectStruct )),
1815
+ List (WasmRefType (genTypeName. ObjectStruct ))
1816
1816
)
1817
1817
val List (fromParam) = fctx.paramIndices
1818
1818
import fctx .instrs
0 commit comments