diff --git a/transpiler/java/com/google/j2cl/transpiler/backend/wasm/ExpressionTranspiler.java b/transpiler/java/com/google/j2cl/transpiler/backend/wasm/ExpressionTranspiler.java index 075635d62d..53f060af9d 100644 --- a/transpiler/java/com/google/j2cl/transpiler/backend/wasm/ExpressionTranspiler.java +++ b/transpiler/java/com/google/j2cl/transpiler/backend/wasm/ExpressionTranspiler.java @@ -339,7 +339,7 @@ public boolean enterArrayLiteral(ArrayLiteral arrayLiteral) { return false; } - sourceBuilder.append(format("(array.init_static %s ", arrayType)); + sourceBuilder.append(format("(array.new_fixed %s ", arrayType)); arrayLiteral.getValueExpressions().forEach(this::render); sourceBuilder.append(")"); return false; diff --git a/transpiler/javatests/com/google/j2cl/readable/java/array/output_wasm/module.wat.txt b/transpiler/javatests/com/google/j2cl/readable/java/array/output_wasm/module.wat.txt index a256d9d2f0..f25774ea66 100644 --- a/transpiler/javatests/com/google/j2cl/readable/java/array/output_wasm/module.wat.txt +++ b/transpiler/javatests/com/google/j2cl/readable/java/array/output_wasm/module.wat.txt @@ -248,15 +248,15 @@ ;;@ array/Arrays.java:28:4 (local.set $objects (call $m_newWithLength__int__javaemul_internal_WasmArray_OfObject@javaemul.internal.WasmArray.OfObject (i32.const 0))) ;;@ array/Arrays.java:29:4 - (local.set $objects (call $$create__arrayOf_java_lang_Object@javaemul.internal.WasmArray.OfObject (array.init_static $java.lang.Object.array (ref.null $java.lang.Object)(ref.null $java.lang.Object)))) + (local.set $objects (call $$create__arrayOf_java_lang_Object@javaemul.internal.WasmArray.OfObject (array.new_fixed $java.lang.Object.array (ref.null $java.lang.Object)(ref.null $java.lang.Object)))) ;;@ array/Arrays.java:30:4 (local.set $objects2d (call $m_createMultiDimensional__arrayOf_int__int__arrayOf_java_lang_Object@javaemul.internal.WasmArray (call $$create__arrayOf_int@javaemul.internal.WasmArray.OfInt (array.new_data $int.array $arrayliteral@array.Arrays-1 (i32.const 0) (i32.const 2)))(i32.const -1))) ;;@ array/Arrays.java:31:4 - (local.set $objects2d (call $$create__arrayOf_java_lang_Object@javaemul.internal.WasmArray.OfObject (array.init_static $java.lang.Object.array (call $$create__arrayOf_java_lang_Object@javaemul.internal.WasmArray.OfObject (array.init_static $java.lang.Object.array (ref.null $java.lang.Object)(ref.null $java.lang.Object)))(ref.null $java.lang.Object)))) + (local.set $objects2d (call $$create__arrayOf_java_lang_Object@javaemul.internal.WasmArray.OfObject (array.new_fixed $java.lang.Object.array (call $$create__arrayOf_java_lang_Object@javaemul.internal.WasmArray.OfObject (array.new_fixed $java.lang.Object.array (ref.null $java.lang.Object)(ref.null $java.lang.Object)))(ref.null $java.lang.Object)))) ;;@ array/Arrays.java:32:4 (local.set $objects2d (call $m_createMultiDimensional__arrayOf_int__int__arrayOf_java_lang_Object@javaemul.internal.WasmArray (call $$create__arrayOf_int@javaemul.internal.WasmArray.OfInt (array.new_data $int.array $arrayliteral@array.Arrays-2 (i32.const 0) (i32.const 2)))(i32.const -1))) ;;@ array/Arrays.java:33:4 - (local.set $arrayLiteral2d (call $$create__arrayOf_java_lang_Object@javaemul.internal.WasmArray.OfObject (array.init_static $java.lang.Object.array (call $$create__arrayOf_java_lang_Object@javaemul.internal.WasmArray.OfObject (array.init_static $java.lang.Object.array (ref.null $java.lang.Object)(ref.null $java.lang.Object)))(ref.null $java.lang.Object)))) + (local.set $arrayLiteral2d (call $$create__arrayOf_java_lang_Object@javaemul.internal.WasmArray.OfObject (array.new_fixed $java.lang.Object.array (call $$create__arrayOf_java_lang_Object@javaemul.internal.WasmArray.OfObject (array.new_fixed $java.lang.Object.array (ref.null $java.lang.Object)(ref.null $java.lang.Object)))(ref.null $java.lang.Object)))) ;;@ array/Arrays.java:36:4 (local.set $object (array.get $java.lang.Object.array (struct.get $javaemul.internal.WasmArray.OfObject $f_elements__javaemul_internal_WasmArray_OfObject (local.get $objects)) (i32.const 0))) ;;@ array/Arrays.java:37:4 @@ -285,11 +285,11 @@ ;;@ array/Arrays.java:49:4 (local.set $objects (call $m_newWithLength__int__javaemul_internal_WasmArray_OfObject@javaemul.internal.WasmArray.OfObject (i32.const 0))) ;;@ array/Arrays.java:50:4 - (local.set $objects (call $$create__arrayOf_java_lang_Object@javaemul.internal.WasmArray.OfObject (array.init_static $java.lang.Object.array (ref.null $java.lang.Object)(ref.null $java.lang.Object)))) + (local.set $objects (call $$create__arrayOf_java_lang_Object@javaemul.internal.WasmArray.OfObject (array.new_fixed $java.lang.Object.array (ref.null $java.lang.Object)(ref.null $java.lang.Object)))) ;;@ array/Arrays.java:51:4 (local.set $objects2d (call $m_createMultiDimensional__arrayOf_int__int__arrayOf_java_lang_Object@javaemul.internal.WasmArray (call $$create__arrayOf_int@javaemul.internal.WasmArray.OfInt (array.new_data $int.array $arrayliteral@array.Arrays-3 (i32.const 0) (i32.const 2)))(i32.const -1))) ;;@ array/Arrays.java:52:4 - (local.set $objects2d (call $$create__arrayOf_java_lang_Object@javaemul.internal.WasmArray.OfObject (array.init_static $java.lang.Object.array (call $$create__arrayOf_java_lang_Object@javaemul.internal.WasmArray.OfObject (array.init_static $java.lang.Object.array (ref.null $java.lang.Object)(ref.null $java.lang.Object)))(ref.null $java.lang.Object)))) + (local.set $objects2d (call $$create__arrayOf_java_lang_Object@javaemul.internal.WasmArray.OfObject (array.new_fixed $java.lang.Object.array (call $$create__arrayOf_java_lang_Object@javaemul.internal.WasmArray.OfObject (array.new_fixed $java.lang.Object.array (ref.null $java.lang.Object)(ref.null $java.lang.Object)))(ref.null $java.lang.Object)))) ;;@ array/Arrays.java:53:4 (local.set $objects2d (call $m_createMultiDimensional__arrayOf_int__int__arrayOf_java_lang_Object@javaemul.internal.WasmArray (call $$create__arrayOf_int@javaemul.internal.WasmArray.OfInt (array.new_data $int.array $arrayliteral@array.Arrays-4 (i32.const 0) (i32.const 2)))(i32.const -1))) ;;@ array/Arrays.java:56:4 @@ -326,7 +326,7 @@ ;;@ array/Arrays.java:69:4 (local.set $ints2d (call $m_createMultiDimensional__arrayOf_int__int__arrayOf_java_lang_Object@javaemul.internal.WasmArray (call $$create__arrayOf_int@javaemul.internal.WasmArray.OfInt (array.new_data $int.array $arrayliteral@array.Arrays-6 (i32.const 0) (i32.const 2)))(i32.const 5))) ;;@ array/Arrays.java:70:4 - (local.set $ints2d (call $$create__arrayOf_java_lang_Object@javaemul.internal.WasmArray.OfObject (array.init_static $java.lang.Object.array (call $$create__arrayOf_int@javaemul.internal.WasmArray.OfInt (array.new_data $int.array $arrayliteral@array.Arrays-7 (i32.const 0) (i32.const 2)))(ref.null $java.lang.Object)))) + (local.set $ints2d (call $$create__arrayOf_java_lang_Object@javaemul.internal.WasmArray.OfObject (array.new_fixed $java.lang.Object.array (call $$create__arrayOf_int@javaemul.internal.WasmArray.OfInt (array.new_data $int.array $arrayliteral@array.Arrays-7 (i32.const 0) (i32.const 2)))(ref.null $java.lang.Object)))) ;;@ array/Arrays.java:71:4 (local.set $ints2d (call $m_createMultiDimensional__arrayOf_int__int__arrayOf_java_lang_Object@javaemul.internal.WasmArray (call $$create__arrayOf_int@javaemul.internal.WasmArray.OfInt (array.new_data $int.array $arrayliteral@array.Arrays-8 (i32.const 0) (i32.const 2)))(i32.const 5))) ;;@ array/Arrays.java:74:4 @@ -350,7 +350,7 @@ ;;@ array/Arrays.java:87:4 (array.set $int.array (struct.get $javaemul.internal.WasmArray.OfInt $f_elements__javaemul_internal_WasmArray_OfInt (local.get $ints)) (local.get $c) (local.get $c)) ;;@ array/Arrays.java:88:4 - (local.set $ints (call $$create__arrayOf_int@javaemul.internal.WasmArray.OfInt (array.init_static $int.array (local.get $b)(local.get $c)))) + (local.set $ints (call $$create__arrayOf_int@javaemul.internal.WasmArray.OfInt (array.new_fixed $int.array (local.get $b)(local.get $c)))) ) ) (elem declare func $m_testIntArrays__void_$pp_array@array.Arrays) @@ -377,7 +377,7 @@ ;;@ array/Arrays.java:96:4 (local.set $longs2d (call $m_createMultiDimensional__arrayOf_int__int__arrayOf_java_lang_Object@javaemul.internal.WasmArray (call $$create__arrayOf_int@javaemul.internal.WasmArray.OfInt (array.new_data $int.array $arrayliteral@array.Arrays-10 (i32.const 0) (i32.const 2)))(i32.const 6))) ;;@ array/Arrays.java:97:4 - (local.set $longs2d (call $$create__arrayOf_java_lang_Object@javaemul.internal.WasmArray.OfObject (array.init_static $java.lang.Object.array (call $$create__arrayOf_long@javaemul.internal.WasmArray.OfLong (array.new_data $long.array $arrayliteral@array.Arrays-11 (i32.const 0) (i32.const 2)))(ref.null $java.lang.Object)))) + (local.set $longs2d (call $$create__arrayOf_java_lang_Object@javaemul.internal.WasmArray.OfObject (array.new_fixed $java.lang.Object.array (call $$create__arrayOf_long@javaemul.internal.WasmArray.OfLong (array.new_data $long.array $arrayliteral@array.Arrays-11 (i32.const 0) (i32.const 2)))(ref.null $java.lang.Object)))) ;;@ array/Arrays.java:98:4 (local.set $longs2d (call $m_createMultiDimensional__arrayOf_int__int__arrayOf_java_lang_Object@javaemul.internal.WasmArray (call $$create__arrayOf_int@javaemul.internal.WasmArray.OfInt (array.new_data $int.array $arrayliteral@array.Arrays-12 (i32.const 0) (i32.const 2)))(i32.const 6))) ;;@ array/Arrays.java:101:4 @@ -401,7 +401,7 @@ ;;@ array/Arrays.java:114:4 (array.set $long.array (struct.get $javaemul.internal.WasmArray.OfLong $f_elements__javaemul_internal_WasmArray_OfLong (local.get $longs)) (local.get $c) (i64.extend_i32_u (local.get $c))) ;;@ array/Arrays.java:115:4 - (local.set $longs (call $$create__arrayOf_long@javaemul.internal.WasmArray.OfLong (array.init_static $long.array (i64.extend_i32_s (local.get $b))(i64.extend_i32_u (local.get $c))))) + (local.set $longs (call $$create__arrayOf_long@javaemul.internal.WasmArray.OfLong (array.new_fixed $long.array (i64.extend_i32_s (local.get $b))(i64.extend_i32_u (local.get $c))))) ) ) (elem declare func $m_testLongArrays__void_$pp_array@array.Arrays) @@ -424,11 +424,11 @@ ;;@ array/Arrays.java:121:4 (local.set $booleans (call $m_newWithLength__int__javaemul_internal_WasmArray_OfObject@javaemul.internal.WasmArray.OfObject (i32.const 0))) ;;@ array/Arrays.java:122:4 - (local.set $booleans (call $$create__arrayOf_java_lang_Object@javaemul.internal.WasmArray.OfObject (array.init_static $java.lang.Object.array (call $m_valueOf__boolean__java_lang_Boolean@java.lang.Boolean (i32.const 1))(call $m_valueOf__boolean__java_lang_Boolean@java.lang.Boolean (i32.const 0))))) + (local.set $booleans (call $$create__arrayOf_java_lang_Object@javaemul.internal.WasmArray.OfObject (array.new_fixed $java.lang.Object.array (call $m_valueOf__boolean__java_lang_Boolean@java.lang.Boolean (i32.const 1))(call $m_valueOf__boolean__java_lang_Boolean@java.lang.Boolean (i32.const 0))))) ;;@ array/Arrays.java:123:4 (local.set $booleans2d (call $m_createMultiDimensional__arrayOf_int__int__arrayOf_java_lang_Object@javaemul.internal.WasmArray (call $$create__arrayOf_int@javaemul.internal.WasmArray.OfInt (array.new_data $int.array $arrayliteral@array.Arrays-13 (i32.const 0) (i32.const 2)))(i32.const -1))) ;;@ array/Arrays.java:124:4 - (local.set $booleans2d (call $$create__arrayOf_java_lang_Object@javaemul.internal.WasmArray.OfObject (array.init_static $java.lang.Object.array (call $$create__arrayOf_java_lang_Object@javaemul.internal.WasmArray.OfObject (array.init_static $java.lang.Object.array (call $m_valueOf__boolean__java_lang_Boolean@java.lang.Boolean (i32.const 1))(call $m_valueOf__boolean__java_lang_Boolean@java.lang.Boolean (i32.const 0))))(ref.null $java.lang.Object)))) + (local.set $booleans2d (call $$create__arrayOf_java_lang_Object@javaemul.internal.WasmArray.OfObject (array.new_fixed $java.lang.Object.array (call $$create__arrayOf_java_lang_Object@javaemul.internal.WasmArray.OfObject (array.new_fixed $java.lang.Object.array (call $m_valueOf__boolean__java_lang_Boolean@java.lang.Boolean (i32.const 1))(call $m_valueOf__boolean__java_lang_Boolean@java.lang.Boolean (i32.const 0))))(ref.null $java.lang.Object)))) ;;@ array/Arrays.java:125:4 (local.set $booleans2d (call $m_createMultiDimensional__arrayOf_int__int__arrayOf_java_lang_Object@javaemul.internal.WasmArray (call $$create__arrayOf_int@javaemul.internal.WasmArray.OfInt (array.new_data $int.array $arrayliteral@array.Arrays-14 (i32.const 0) (i32.const 2)))(i32.const -1))) ;;@ array/Arrays.java:128:4 @@ -465,11 +465,11 @@ ;;@ array/Arrays.java:139:4 (local.set $strings (call $m_newWithLength__int__javaemul_internal_WasmArray_OfObject@javaemul.internal.WasmArray.OfObject (i32.const 0))) ;;@ array/Arrays.java:140:4 - (local.set $strings (call $$create__arrayOf_java_lang_Object@javaemul.internal.WasmArray.OfObject (array.init_static $java.lang.Object.array (ref.null $java.lang.Object)(ref.null $java.lang.Object)))) + (local.set $strings (call $$create__arrayOf_java_lang_Object@javaemul.internal.WasmArray.OfObject (array.new_fixed $java.lang.Object.array (ref.null $java.lang.Object)(ref.null $java.lang.Object)))) ;;@ array/Arrays.java:141:4 (local.set $strings2d (call $m_createMultiDimensional__arrayOf_int__int__arrayOf_java_lang_Object@javaemul.internal.WasmArray (call $$create__arrayOf_int@javaemul.internal.WasmArray.OfInt (array.new_data $int.array $arrayliteral@array.Arrays-15 (i32.const 0) (i32.const 2)))(i32.const -1))) ;;@ array/Arrays.java:142:4 - (local.set $strings2d (call $$create__arrayOf_java_lang_Object@javaemul.internal.WasmArray.OfObject (array.init_static $java.lang.Object.array (call $$create__arrayOf_java_lang_Object@javaemul.internal.WasmArray.OfObject (array.init_static $java.lang.Object.array (ref.null $java.lang.Object)(ref.null $java.lang.Object)))(ref.null $java.lang.Object)))) + (local.set $strings2d (call $$create__arrayOf_java_lang_Object@javaemul.internal.WasmArray.OfObject (array.new_fixed $java.lang.Object.array (call $$create__arrayOf_java_lang_Object@javaemul.internal.WasmArray.OfObject (array.new_fixed $java.lang.Object.array (ref.null $java.lang.Object)(ref.null $java.lang.Object)))(ref.null $java.lang.Object)))) ;;@ array/Arrays.java:143:4 (local.set $strings2d (call $m_createMultiDimensional__arrayOf_int__int__arrayOf_java_lang_Object@javaemul.internal.WasmArray (call $$create__arrayOf_int@javaemul.internal.WasmArray.OfInt (array.new_data $int.array $arrayliteral@array.Arrays-16 (i32.const 0) (i32.const 2)))(i32.const -1))) ;;@ array/Arrays.java:146:4 diff --git a/transpiler/javatests/com/google/j2cl/readable/java/autoboxing/output_wasm/module.wat.txt b/transpiler/javatests/com/google/j2cl/readable/java/autoboxing/output_wasm/module.wat.txt index af7b56c30f..315eedec65 100644 --- a/transpiler/javatests/com/google/j2cl/readable/java/autoboxing/output_wasm/module.wat.txt +++ b/transpiler/javatests/com/google/j2cl/readable/java/autoboxing/output_wasm/module.wat.txt @@ -771,11 +771,11 @@ ;;@ autoboxing/AutoBoxing.java:174:4 (local.set $unusedDouble (call_ref $function.m_takesObjectAndReturnsPrimitiveDouble__java_lang_Object__double (ref.as_non_null (local.get $this))(call $m_valueOf__int__java_lang_Integer@java.lang.Integer (i32.const 4))(struct.get $autoboxing.AutoBoxing.vtable $m_takesObjectAndReturnsPrimitiveDouble__java_lang_Object__double (struct.get $autoboxing.AutoBoxing $vtable(local.get $this))))) ;;@ autoboxing/AutoBoxing.java:175:4 - (local.set $unusedDouble (call_ref $function.m_sumWithoutBoxing__arrayOf_java_lang_Object__double (ref.as_non_null (local.get $this))(call $$create__arrayOf_java_lang_Object@javaemul.internal.WasmArray.OfObject (array.init_static $java.lang.Object.array (call $m_valueOf__int__java_lang_Integer@java.lang.Integer (i32.const 1))(call $m_valueOf__double__java_lang_Double@java.lang.Double (f64.const 2.2))(call $m_valueOf__byte__java_lang_Byte@java.lang.Byte (i32.const 1))(call $m_valueOf__short__java_lang_Short@java.lang.Short (i32.const 1))(call $m_valueOf__float__java_lang_Float@java.lang.Float (f32.const 2.2))))(struct.get $autoboxing.AutoBoxing.vtable $m_sumWithoutBoxing__arrayOf_java_lang_Object__double (struct.get $autoboxing.AutoBoxing $vtable(local.get $this))))) + (local.set $unusedDouble (call_ref $function.m_sumWithoutBoxing__arrayOf_java_lang_Object__double (ref.as_non_null (local.get $this))(call $$create__arrayOf_java_lang_Object@javaemul.internal.WasmArray.OfObject (array.new_fixed $java.lang.Object.array (call $m_valueOf__int__java_lang_Integer@java.lang.Integer (i32.const 1))(call $m_valueOf__double__java_lang_Double@java.lang.Double (f64.const 2.2))(call $m_valueOf__byte__java_lang_Byte@java.lang.Byte (i32.const 1))(call $m_valueOf__short__java_lang_Short@java.lang.Short (i32.const 1))(call $m_valueOf__float__java_lang_Float@java.lang.Float (f32.const 2.2))))(struct.get $autoboxing.AutoBoxing.vtable $m_sumWithoutBoxing__arrayOf_java_lang_Object__double (struct.get $autoboxing.AutoBoxing $vtable(local.get $this))))) ;;@ autoboxing/AutoBoxing.java:176:4 - (local.set $unusedDouble (call_ref $function.m_sumWithoutBoxingJsVarargs__arrayOf_java_lang_Object__double (ref.as_non_null (local.get $this))(call $$create__arrayOf_java_lang_Object@javaemul.internal.WasmArray.OfObject (array.init_static $java.lang.Object.array (call $m_valueOf__int__java_lang_Integer@java.lang.Integer (i32.const 1))(call $m_valueOf__double__java_lang_Double@java.lang.Double (f64.const 2.2))(call $m_valueOf__byte__java_lang_Byte@java.lang.Byte (i32.const 1))(call $m_valueOf__short__java_lang_Short@java.lang.Short (i32.const 1))(call $m_valueOf__float__java_lang_Float@java.lang.Float (f32.const 2.2))))(struct.get $autoboxing.AutoBoxing.vtable $m_sumWithoutBoxingJsVarargs__arrayOf_java_lang_Object__double (struct.get $autoboxing.AutoBoxing $vtable(local.get $this))))) + (local.set $unusedDouble (call_ref $function.m_sumWithoutBoxingJsVarargs__arrayOf_java_lang_Object__double (ref.as_non_null (local.get $this))(call $$create__arrayOf_java_lang_Object@javaemul.internal.WasmArray.OfObject (array.new_fixed $java.lang.Object.array (call $m_valueOf__int__java_lang_Integer@java.lang.Integer (i32.const 1))(call $m_valueOf__double__java_lang_Double@java.lang.Double (f64.const 2.2))(call $m_valueOf__byte__java_lang_Byte@java.lang.Byte (i32.const 1))(call $m_valueOf__short__java_lang_Short@java.lang.Short (i32.const 1))(call $m_valueOf__float__java_lang_Float@java.lang.Float (f32.const 2.2))))(struct.get $autoboxing.AutoBoxing.vtable $m_sumWithoutBoxingJsVarargs__arrayOf_java_lang_Object__double (struct.get $autoboxing.AutoBoxing $vtable(local.get $this))))) ;;@ autoboxing/AutoBoxing.java:177:4 - (call_ref $function.m_takesFloatVarArgs__arrayOf_java_lang_Float__void (ref.as_non_null (local.get $this))(call $$create__arrayOf_java_lang_Object@javaemul.internal.WasmArray.OfObject (array.init_static $java.lang.Object.array (call $m_valueOf__float__java_lang_Float@java.lang.Float (f32.const 1.100000023841858))(call $m_valueOf__float__java_lang_Float@java.lang.Float (f32.const 97.0))(call $m_valueOf__float__java_lang_Float@java.lang.Float (f32.const 2.2))))(struct.get $autoboxing.AutoBoxing.vtable $m_takesFloatVarArgs__arrayOf_java_lang_Float__void (struct.get $autoboxing.AutoBoxing $vtable(local.get $this)))) + (call_ref $function.m_takesFloatVarArgs__arrayOf_java_lang_Float__void (ref.as_non_null (local.get $this))(call $$create__arrayOf_java_lang_Object@javaemul.internal.WasmArray.OfObject (array.new_fixed $java.lang.Object.array (call $m_valueOf__float__java_lang_Float@java.lang.Float (f32.const 1.100000023841858))(call $m_valueOf__float__java_lang_Float@java.lang.Float (f32.const 97.0))(call $m_valueOf__float__java_lang_Float@java.lang.Float (f32.const 2.2))))(struct.get $autoboxing.AutoBoxing.vtable $m_takesFloatVarArgs__arrayOf_java_lang_Float__void (struct.get $autoboxing.AutoBoxing $vtable(local.get $this)))) ;;@ autoboxing/AutoBoxing.java:180:4 ;;@ autoboxing/AutoBoxing.java:181:4 diff --git a/transpiler/javatests/com/google/j2cl/readable/java/castonarrayinit/output_wasm/module.wat.txt b/transpiler/javatests/com/google/j2cl/readable/java/castonarrayinit/output_wasm/module.wat.txt index 13ee96f2f3..6af7f836b4 100644 --- a/transpiler/javatests/com/google/j2cl/readable/java/castonarrayinit/output_wasm/module.wat.txt +++ b/transpiler/javatests/com/google/j2cl/readable/java/castonarrayinit/output_wasm/module.wat.txt @@ -114,7 +114,7 @@ ;;@ castonarrayinit/CastOnArrayInit.java:25:4 (local.set $f2 (call $$create__@castonarrayinit.CastOnArrayInit.Foo )) ;;@ castonarrayinit/CastOnArrayInit.java:26:4 - (call $m_fun__arrayOf_castonarrayinit_CastOnArrayInit_Foo__void@castonarrayinit.CastOnArrayInit (call $$create__arrayOf_java_lang_Object@javaemul.internal.WasmArray.OfObject (array.init_static $java.lang.Object.array (local.get $f1)(local.get $f2)))) + (call $m_fun__arrayOf_castonarrayinit_CastOnArrayInit_Foo__void@castonarrayinit.CastOnArrayInit (call $$create__arrayOf_java_lang_Object@javaemul.internal.WasmArray.OfObject (array.new_fixed $java.lang.Object.array (local.get $f1)(local.get $f2)))) ) ) diff --git a/transpiler/javatests/com/google/j2cl/readable/java/deprecated/output_wasm/module.wat.txt b/transpiler/javatests/com/google/j2cl/readable/java/deprecated/output_wasm/module.wat.txt index 70a2fffc52..548ee162ab 100644 --- a/transpiler/javatests/com/google/j2cl/readable/java/deprecated/output_wasm/module.wat.txt +++ b/transpiler/javatests/com/google/j2cl/readable/java/deprecated/output_wasm/module.wat.txt @@ -480,7 +480,7 @@ ;;@ deprecated/DeprecatedExample.java:55:7 (call $$clinit__void@deprecated.DeprecatedExample.DeprecatedEnum ) ;;@ deprecated/DeprecatedExample.java:55:7 - (return (call $$create__arrayOf_java_lang_Object@javaemul.internal.WasmArray.OfObject (array.init_static $java.lang.Object.array (global.get $f_A_VALUE__deprecated_DeprecatedExample_DeprecatedEnum)))) + (return (call $$create__arrayOf_java_lang_Object@javaemul.internal.WasmArray.OfObject (array.new_fixed $java.lang.Object.array (global.get $f_A_VALUE__deprecated_DeprecatedExample_DeprecatedEnum)))) ) ) @@ -621,7 +621,7 @@ ;;@ deprecated/DeprecatedExample.java:62:7 (call $$clinit__void@deprecated.DeprecatedExample.DeprecatedJsEnum ) ;;@ deprecated/DeprecatedExample.java:62:7 - (return (call $$create__arrayOf_java_lang_Object@javaemul.internal.WasmArray.OfObject (array.init_static $java.lang.Object.array (global.get $f_A_VALUE__deprecated_DeprecatedExample_DeprecatedJsEnum)))) + (return (call $$create__arrayOf_java_lang_Object@javaemul.internal.WasmArray.OfObject (array.new_fixed $java.lang.Object.array (global.get $f_A_VALUE__deprecated_DeprecatedExample_DeprecatedJsEnum)))) ) ) diff --git a/transpiler/javatests/com/google/j2cl/readable/java/enums/output_wasm/module.wat.txt b/transpiler/javatests/com/google/j2cl/readable/java/enums/output_wasm/module.wat.txt index bc7cb54f50..e47d9cc790 100644 --- a/transpiler/javatests/com/google/j2cl/readable/java/enums/output_wasm/module.wat.txt +++ b/transpiler/javatests/com/google/j2cl/readable/java/enums/output_wasm/module.wat.txt @@ -555,7 +555,7 @@ ;;@ enums/Enum1.java:20:12 (call $$clinit__void@enums.Enum1 ) ;;@ enums/Enum1.java:20:12 - (return (call $$create__arrayOf_java_lang_Object@javaemul.internal.WasmArray.OfObject (array.init_static $java.lang.Object.array (global.get $f_V1__enums_Enum1)(global.get $f_V2__enums_Enum1)))) + (return (call $$create__arrayOf_java_lang_Object@javaemul.internal.WasmArray.OfObject (array.new_fixed $java.lang.Object.array (global.get $f_V1__enums_Enum1)(global.get $f_V2__enums_Enum1)))) ) ) @@ -831,7 +831,7 @@ ;;@ enums/Enum1.java:25:5 (call $$clinit__void@enums.Enum2 ) ;;@ enums/Enum1.java:25:5 - (return (call $$create__arrayOf_java_lang_Object@javaemul.internal.WasmArray.OfObject (array.init_static $java.lang.Object.array (global.get $f_VALUE1__enums_Enum2)(global.get $f_VALUE2__enums_Enum2)(global.get $f_VALUE3__enums_Enum2)(global.get $f_VALUE4__enums_Enum2)))) + (return (call $$create__arrayOf_java_lang_Object@javaemul.internal.WasmArray.OfObject (array.new_fixed $java.lang.Object.array (global.get $f_VALUE1__enums_Enum2)(global.get $f_VALUE2__enums_Enum2)(global.get $f_VALUE3__enums_Enum2)(global.get $f_VALUE4__enums_Enum2)))) ) ) @@ -875,7 +875,7 @@ (global.get $f_V1__enums_Enum1) ))) ;;@ enums/Enum1.java:28:2 - (global.set $f_VALUE3__enums_Enum2 (call $$create__java_lang_String__int__arrayOf_java_lang_Object@enums.Enum2 (call $function.no.side.effects.$getString_|VALUE3|__java_lang_String (ref.func $$getString_|VALUE3|__java_lang_String@enums.Enum2) )(i32.const 2)(call $$create__arrayOf_java_lang_Object@javaemul.internal.WasmArray.OfObject (array.init_static $java.lang.Object.array )))) + (global.set $f_VALUE3__enums_Enum2 (call $$create__java_lang_String__int__arrayOf_java_lang_Object@enums.Enum2 (call $function.no.side.effects.$getString_|VALUE3|__java_lang_String (ref.func $$getString_|VALUE3|__java_lang_String@enums.Enum2) )(i32.const 2)(call $$create__arrayOf_java_lang_Object@javaemul.internal.WasmArray.OfObject (array.new_fixed $java.lang.Object.array )))) ;;@ enums/Enum1.java:29:2 (global.set $f_VALUE4__enums_Enum2 (call $$create__java_lang_String__int__int@enums.Enum2.1 (call $function.no.side.effects.$getString_|VALUE4|__java_lang_String (ref.func $$getString_|VALUE4|__java_lang_String@enums.Enum2) )(i32.const 3)(i32.const 5))) ;;@ enums/Enum1.java:49:2 @@ -1041,7 +1041,7 @@ ;;@ enums/Enum1.java:58:5 (call $$clinit__void@enums.Enum3 ) ;;@ enums/Enum1.java:58:5 - (return (call $$create__arrayOf_java_lang_Object@javaemul.internal.WasmArray.OfObject (array.init_static $java.lang.Object.array (global.get $f_VALUE1__enums_Enum3)))) + (return (call $$create__arrayOf_java_lang_Object@javaemul.internal.WasmArray.OfObject (array.new_fixed $java.lang.Object.array (global.get $f_VALUE1__enums_Enum3)))) ) ) diff --git a/transpiler/javatests/com/google/j2cl/readable/java/genericmethod/output_wasm/module.wat.txt b/transpiler/javatests/com/google/j2cl/readable/java/genericmethod/output_wasm/module.wat.txt index f7ba9c34e0..d0bc92400a 100644 --- a/transpiler/javatests/com/google/j2cl/readable/java/genericmethod/output_wasm/module.wat.txt +++ b/transpiler/javatests/com/google/j2cl/readable/java/genericmethod/output_wasm/module.wat.txt @@ -543,7 +543,7 @@ ;;@ genericmethod/GenericMethod.java:68:4 (call_ref $function.m_fun__java_lang_Error__void (ref.as_non_null (local.get $g))(call $$create__@java.lang.Error )(struct.get $genericmethod.GenericMethod.vtable $m_fun__java_lang_Error__void (struct.get $genericmethod.GenericMethod $vtable(local.get $g)))) ;;@ genericmethod/GenericMethod.java:69:4 - (drop (call_ref $function.m_fun__arrayOf_java_lang_Object__arrayOf_java_lang_Object (ref.as_non_null (local.get $g))(call $$create__arrayOf_java_lang_Object@javaemul.internal.WasmArray.OfObject (array.init_static $java.lang.Object.array (call $function.no.side.effects.$getString_|asdf|__java_lang_String (ref.func $$getString_|asdf|__java_lang_String@genericmethod.GenericMethod) )))(struct.get $genericmethod.GenericMethod.vtable $m_fun__arrayOf_java_lang_Object__arrayOf_java_lang_Object (struct.get $genericmethod.GenericMethod $vtable(local.get $g))))) + (drop (call_ref $function.m_fun__arrayOf_java_lang_Object__arrayOf_java_lang_Object (ref.as_non_null (local.get $g))(call $$create__arrayOf_java_lang_Object@javaemul.internal.WasmArray.OfObject (array.new_fixed $java.lang.Object.array (call $function.no.side.effects.$getString_|asdf|__java_lang_String (ref.func $$getString_|asdf|__java_lang_String@genericmethod.GenericMethod) )))(struct.get $genericmethod.GenericMethod.vtable $m_fun__arrayOf_java_lang_Object__arrayOf_java_lang_Object (struct.get $genericmethod.GenericMethod $vtable(local.get $g))))) ;;@ genericmethod/GenericMethod.java:71:4 (local.set $s (ref.cast (ref null $java.lang.String) (call_ref $function.m_checked__java_lang_Object (ref.as_non_null (local.get $this))(struct.get $genericmethod.GenericMethod.vtable $m_checked__java_lang_Object (struct.get $genericmethod.GenericMethod $vtable(local.get $this)))))) ;;@ genericmethod/GenericMethod.java:72:4 diff --git a/transpiler/javatests/com/google/j2cl/readable/java/gwtincompatible/output_wasm/module.wat.txt b/transpiler/javatests/com/google/j2cl/readable/java/gwtincompatible/output_wasm/module.wat.txt index eed9f83fc4..3fbafaf91a 100644 --- a/transpiler/javatests/com/google/j2cl/readable/java/gwtincompatible/output_wasm/module.wat.txt +++ b/transpiler/javatests/com/google/j2cl/readable/java/gwtincompatible/output_wasm/module.wat.txt @@ -556,7 +556,7 @@ ;;@ gwtincompatible/Implementor.java:36:7 (call $$clinit__void@gwtincompatible.Implementor.SomeEnum ) ;;@ gwtincompatible/Implementor.java:36:7 - (return (call $$create__arrayOf_java_lang_Object@javaemul.internal.WasmArray.OfObject (array.init_static $java.lang.Object.array (global.get $f_COMPATIBLE__gwtincompatible_Implementor_SomeEnum)))) + (return (call $$create__arrayOf_java_lang_Object@javaemul.internal.WasmArray.OfObject (array.new_fixed $java.lang.Object.array (global.get $f_COMPATIBLE__gwtincompatible_Implementor_SomeEnum)))) ) ) diff --git a/transpiler/javatests/com/google/j2cl/readable/java/jsconstructor/output_wasm/module.wat.txt b/transpiler/javatests/com/google/j2cl/readable/java/jsconstructor/output_wasm/module.wat.txt index a8f95fac78..d9b7c4c8a8 100644 --- a/transpiler/javatests/com/google/j2cl/readable/java/jsconstructor/output_wasm/module.wat.txt +++ b/transpiler/javatests/com/google/j2cl/readable/java/jsconstructor/output_wasm/module.wat.txt @@ -1725,7 +1725,7 @@ ;;@ jsconstructor/JsConstructorClass.java:165:29 (call $$clinit__void@jsconstructor.JsConstructorClass.SubVarargs ) ;;@ jsconstructor/JsConstructorClass.java:166:6 - (call $$ctor__java_lang_Object__arrayOf_int__void_$p_jsconstructor_JsConstructorClass_SubVarargs@jsconstructor.JsConstructorClass.SubVarargs (ref.as_non_null (local.get $this))(call $$create__@java.lang.Object )(call $$create__arrayOf_int@javaemul.internal.WasmArray.OfInt (array.init_static $int.array (local.get $j)))) + (call $$ctor__java_lang_Object__arrayOf_int__void_$p_jsconstructor_JsConstructorClass_SubVarargs@jsconstructor.JsConstructorClass.SubVarargs (ref.as_non_null (local.get $this))(call $$create__@java.lang.Object )(call $$create__arrayOf_int@javaemul.internal.WasmArray.OfInt (array.new_fixed $int.array (local.get $j)))) ) ) diff --git a/transpiler/javatests/com/google/j2cl/readable/java/jsnonnull/output_wasm/module.wat.txt b/transpiler/javatests/com/google/j2cl/readable/java/jsnonnull/output_wasm/module.wat.txt index 28c072c10a..60be291371 100644 --- a/transpiler/javatests/com/google/j2cl/readable/java/jsnonnull/output_wasm/module.wat.txt +++ b/transpiler/javatests/com/google/j2cl/readable/java/jsnonnull/output_wasm/module.wat.txt @@ -466,7 +466,7 @@ (local $$instance (ref null $jsnonnull.Main)) (block ;;@ jsnonnull/Main.java:42:9 - (local.set $$instance (struct.new $jsnonnull.Main (ref.as_non_null (global.get $jsnonnull.Main.vtable)) (ref.as_non_null (global.get $itable.empty)) (i32.const 0) (call $function.no.side.effects.$getString_|Hello|__java_lang_String (ref.func $$getString_|Hello|__java_lang_String@jsnonnull.Main) ) (ref.null $java.lang.String) (ref.null $java.lang.Object) (ref.null $java.lang.Object) (ref.null $java.lang.Object) (ref.null $java.lang.Object) (call $$create__arrayOf_java_lang_Object@javaemul.internal.WasmArray.OfObject (array.init_static $java.lang.Object.array )) (call $$create__arrayOf_java_lang_Object@javaemul.internal.WasmArray.OfObject (array.init_static $java.lang.Object.array )) (call $$create__arrayOf_java_lang_Object@javaemul.internal.WasmArray.OfObject (array.init_static $java.lang.Object.array )) (ref.null $java.lang.Object))) + (local.set $$instance (struct.new $jsnonnull.Main (ref.as_non_null (global.get $jsnonnull.Main.vtable)) (ref.as_non_null (global.get $itable.empty)) (i32.const 0) (call $function.no.side.effects.$getString_|Hello|__java_lang_String (ref.func $$getString_|Hello|__java_lang_String@jsnonnull.Main) ) (ref.null $java.lang.String) (ref.null $java.lang.Object) (ref.null $java.lang.Object) (ref.null $java.lang.Object) (ref.null $java.lang.Object) (call $$create__arrayOf_java_lang_Object@javaemul.internal.WasmArray.OfObject (array.new_fixed $java.lang.Object.array )) (call $$create__arrayOf_java_lang_Object@javaemul.internal.WasmArray.OfObject (array.new_fixed $java.lang.Object.array )) (call $$create__arrayOf_java_lang_Object@javaemul.internal.WasmArray.OfObject (array.new_fixed $java.lang.Object.array )) (ref.null $java.lang.Object))) ;;@ jsnonnull/Main.java:42:9 (call $$ctor__java_lang_String__void_$p_jsnonnull_Main@jsnonnull.Main (ref.as_non_null (local.get $$instance))(local.get $a)) ;;@ jsnonnull/Main.java:42:9 diff --git a/transpiler/javatests/com/google/j2cl/readable/java/jsnullable/output_wasm/module.wat.txt b/transpiler/javatests/com/google/j2cl/readable/java/jsnullable/output_wasm/module.wat.txt index 39e1d0b5da..9656c5621e 100644 --- a/transpiler/javatests/com/google/j2cl/readable/java/jsnullable/output_wasm/module.wat.txt +++ b/transpiler/javatests/com/google/j2cl/readable/java/jsnullable/output_wasm/module.wat.txt @@ -47,7 +47,7 @@ (local $$instance (ref null $jsnullable.Main)) (block ;;@ jsnullable/Main.java:24:13 - (local.set $$instance (struct.new $jsnullable.Main (ref.as_non_null (global.get $jsnullable.Main.vtable)) (ref.as_non_null (global.get $itable.empty)) (i32.const 0) (call $function.no.side.effects.$getString_|Hello|__java_lang_String (ref.func $$getString_|Hello|__java_lang_String@jsnullable.Main) ) (ref.null $java.lang.String) (ref.null $java.lang.Object) (ref.null $java.lang.Object) (ref.null $java.lang.Object) (call $$create__arrayOf_java_lang_Object@javaemul.internal.WasmArray.OfObject (array.init_static $java.lang.Object.array )) (call $$create__arrayOf_java_lang_Object@javaemul.internal.WasmArray.OfObject (array.init_static $java.lang.Object.array )))) + (local.set $$instance (struct.new $jsnullable.Main (ref.as_non_null (global.get $jsnullable.Main.vtable)) (ref.as_non_null (global.get $itable.empty)) (i32.const 0) (call $function.no.side.effects.$getString_|Hello|__java_lang_String (ref.func $$getString_|Hello|__java_lang_String@jsnullable.Main) ) (ref.null $java.lang.String) (ref.null $java.lang.Object) (ref.null $java.lang.Object) (ref.null $java.lang.Object) (call $$create__arrayOf_java_lang_Object@javaemul.internal.WasmArray.OfObject (array.new_fixed $java.lang.Object.array )) (call $$create__arrayOf_java_lang_Object@javaemul.internal.WasmArray.OfObject (array.new_fixed $java.lang.Object.array )))) ;;@ jsnullable/Main.java:24:13 (call $$ctor__void_$p_jsnullable_Main@jsnullable.Main (ref.as_non_null (local.get $$instance))) ;;@ jsnullable/Main.java:24:13 diff --git a/transpiler/javatests/com/google/j2cl/readable/java/jstypeenum/output_wasm/module.wat.txt b/transpiler/javatests/com/google/j2cl/readable/java/jstypeenum/output_wasm/module.wat.txt index 40a3eea8e5..2bc219d8c8 100644 --- a/transpiler/javatests/com/google/j2cl/readable/java/jstypeenum/output_wasm/module.wat.txt +++ b/transpiler/javatests/com/google/j2cl/readable/java/jstypeenum/output_wasm/module.wat.txt @@ -137,7 +137,7 @@ ;;@ jstypeenum/Color.java:21:12 (call $$clinit__void@jstypeenum.Color ) ;;@ jstypeenum/Color.java:21:12 - (return (call $$create__arrayOf_java_lang_Object@javaemul.internal.WasmArray.OfObject (array.init_static $java.lang.Object.array (global.get $f_RED__jstypeenum_Color)(global.get $f_GREEN__jstypeenum_Color)(global.get $f_BLUE__jstypeenum_Color)))) + (return (call $$create__arrayOf_java_lang_Object@javaemul.internal.WasmArray.OfObject (array.new_fixed $java.lang.Object.array (global.get $f_RED__jstypeenum_Color)(global.get $f_GREEN__jstypeenum_Color)(global.get $f_BLUE__jstypeenum_Color)))) ) ) diff --git a/transpiler/javatests/com/google/j2cl/readable/java/libraryinfo/output_wasm/module.wat.txt b/transpiler/javatests/com/google/j2cl/readable/java/libraryinfo/output_wasm/module.wat.txt index 4c92db0def..7feedd18ea 100644 --- a/transpiler/javatests/com/google/j2cl/readable/java/libraryinfo/output_wasm/module.wat.txt +++ b/transpiler/javatests/com/google/j2cl/readable/java/libraryinfo/output_wasm/module.wat.txt @@ -1346,7 +1346,7 @@ ;;@ libraryinfo/Main.java:59:7 (call $$clinit__void@libraryinfo.Main.MyJsEnum ) ;;@ libraryinfo/Main.java:59:7 - (return (call $$create__arrayOf_java_lang_Object@javaemul.internal.WasmArray.OfObject (array.init_static $java.lang.Object.array (global.get $f_A__libraryinfo_Main_MyJsEnum)(global.get $f_B__libraryinfo_Main_MyJsEnum)(global.get $f_C__libraryinfo_Main_MyJsEnum)))) + (return (call $$create__arrayOf_java_lang_Object@javaemul.internal.WasmArray.OfObject (array.new_fixed $java.lang.Object.array (global.get $f_A__libraryinfo_Main_MyJsEnum)(global.get $f_B__libraryinfo_Main_MyJsEnum)(global.get $f_C__libraryinfo_Main_MyJsEnum)))) ) ) @@ -1491,7 +1491,7 @@ ;;@ libraryinfo/Main.java:65:7 (call $$clinit__void@libraryinfo.Main.MyEnum ) ;;@ libraryinfo/Main.java:65:7 - (return (call $$create__arrayOf_java_lang_Object@javaemul.internal.WasmArray.OfObject (array.init_static $java.lang.Object.array (global.get $f_FOO__libraryinfo_Main_MyEnum)(global.get $f_BAR__libraryinfo_Main_MyEnum)))) + (return (call $$create__arrayOf_java_lang_Object@javaemul.internal.WasmArray.OfObject (array.new_fixed $java.lang.Object.array (global.get $f_FOO__libraryinfo_Main_MyEnum)(global.get $f_BAR__libraryinfo_Main_MyEnum)))) ) ) diff --git a/transpiler/javatests/com/google/j2cl/readable/java/nullability/output_wasm/module.wat.txt b/transpiler/javatests/com/google/j2cl/readable/java/nullability/output_wasm/module.wat.txt index a7d8ece4e8..92ed175f3a 100644 --- a/transpiler/javatests/com/google/j2cl/readable/java/nullability/output_wasm/module.wat.txt +++ b/transpiler/javatests/com/google/j2cl/readable/java/nullability/output_wasm/module.wat.txt @@ -3900,7 +3900,7 @@ (local $$instance (ref null $nullability.Nullability)) (block ;;@ nullability/Nullability.java:47:9 - (local.set $$instance (struct.new $nullability.Nullability (ref.as_non_null (global.get $nullability.Nullability.vtable)) (ref.as_non_null (global.get $itable.empty)) (i32.const 0) (call $function.no.side.effects.$getString_|Hello|__java_lang_String (ref.func $$getString_|Hello|__java_lang_String@nullability.Nullability) ) (ref.null $java.lang.String) (ref.null $java.lang.String) (ref.null $java.lang.Object) (ref.null $java.lang.Object) (ref.null $java.lang.Object) (ref.null $java.lang.Object) (call $$create__arrayOf_java_lang_Object@javaemul.internal.WasmArray.OfObject (array.init_static $java.lang.Object.array )) (call $$create__arrayOf_java_lang_Object@javaemul.internal.WasmArray.OfObject (array.init_static $java.lang.Object.array )) (call $$create__arrayOf_java_lang_Object@javaemul.internal.WasmArray.OfObject (array.init_static $java.lang.Object.array )) (ref.null $java.lang.Object) (ref.null $java.lang.Object) (ref.null $java.lang.Object))) + (local.set $$instance (struct.new $nullability.Nullability (ref.as_non_null (global.get $nullability.Nullability.vtable)) (ref.as_non_null (global.get $itable.empty)) (i32.const 0) (call $function.no.side.effects.$getString_|Hello|__java_lang_String (ref.func $$getString_|Hello|__java_lang_String@nullability.Nullability) ) (ref.null $java.lang.String) (ref.null $java.lang.String) (ref.null $java.lang.Object) (ref.null $java.lang.Object) (ref.null $java.lang.Object) (ref.null $java.lang.Object) (call $$create__arrayOf_java_lang_Object@javaemul.internal.WasmArray.OfObject (array.new_fixed $java.lang.Object.array )) (call $$create__arrayOf_java_lang_Object@javaemul.internal.WasmArray.OfObject (array.new_fixed $java.lang.Object.array )) (call $$create__arrayOf_java_lang_Object@javaemul.internal.WasmArray.OfObject (array.new_fixed $java.lang.Object.array )) (ref.null $java.lang.Object) (ref.null $java.lang.Object) (ref.null $java.lang.Object))) ;;@ nullability/Nullability.java:47:9 (call $$ctor__java_lang_String__void_$p_nullability_Nullability@nullability.Nullability (ref.as_non_null (local.get $$instance))(local.get $a)) ;;@ nullability/Nullability.java:47:9 @@ -6003,7 +6003,7 @@ (local $$instance (ref null $nullability.defaultnotnullable.DefaultNotNullable)) (block ;;@ nullability/defaultnotnullable/DefaultNotNullable.java:43:9 - (local.set $$instance (struct.new $nullability.defaultnotnullable.DefaultNotNullable (ref.as_non_null (global.get $nullability.defaultnotnullable.DefaultNotNullable.vtable)) (ref.as_non_null (global.get $itable.empty)) (i32.const 0) (call $function.no.side.effects.$getString_|Hello|__java_lang_String (ref.func $$getString_|Hello|__java_lang_String@nullability.Nullability) ) (ref.null $java.lang.String) (ref.null $java.lang.String) (ref.null $java.lang.Object) (ref.null $java.lang.Object) (ref.null $java.lang.Object) (ref.null $java.lang.Object) (call $$create__arrayOf_java_lang_Object@javaemul.internal.WasmArray.OfObject (array.init_static $java.lang.Object.array )) (call $$create__arrayOf_java_lang_Object@javaemul.internal.WasmArray.OfObject (array.init_static $java.lang.Object.array )) (call $$create__arrayOf_java_lang_Object@javaemul.internal.WasmArray.OfObject (array.init_static $java.lang.Object.array )) (ref.null $java.lang.Void) (ref.null $java.lang.Object) (ref.null $java.lang.Object) (ref.null $java.lang.Object))) + (local.set $$instance (struct.new $nullability.defaultnotnullable.DefaultNotNullable (ref.as_non_null (global.get $nullability.defaultnotnullable.DefaultNotNullable.vtable)) (ref.as_non_null (global.get $itable.empty)) (i32.const 0) (call $function.no.side.effects.$getString_|Hello|__java_lang_String (ref.func $$getString_|Hello|__java_lang_String@nullability.Nullability) ) (ref.null $java.lang.String) (ref.null $java.lang.String) (ref.null $java.lang.Object) (ref.null $java.lang.Object) (ref.null $java.lang.Object) (ref.null $java.lang.Object) (call $$create__arrayOf_java_lang_Object@javaemul.internal.WasmArray.OfObject (array.new_fixed $java.lang.Object.array )) (call $$create__arrayOf_java_lang_Object@javaemul.internal.WasmArray.OfObject (array.new_fixed $java.lang.Object.array )) (call $$create__arrayOf_java_lang_Object@javaemul.internal.WasmArray.OfObject (array.new_fixed $java.lang.Object.array )) (ref.null $java.lang.Void) (ref.null $java.lang.Object) (ref.null $java.lang.Object) (ref.null $java.lang.Object))) ;;@ nullability/defaultnotnullable/DefaultNotNullable.java:43:9 (call $$ctor__void_$p_nullability_defaultnotnullable_DefaultNotNullable@nullability.defaultnotnullable.DefaultNotNullable (ref.as_non_null (local.get $$instance))) ;;@ nullability/defaultnotnullable/DefaultNotNullable.java:43:9 @@ -6782,7 +6782,7 @@ ;;@ nullability/defaultnotnullable/DefaultNotNullable.java:400:4 (local.set $c (if (result (ref null $java.lang.Object)) (local.get $b) (then (ref.null $java.lang.Object)) (else (ref.null $java.lang.Object)))) ;;@ nullability/defaultnotnullable/DefaultNotNullable.java:403:4 - (local.set $s (call $$create__arrayOf_java_lang_Object@javaemul.internal.WasmArray.OfObject (array.init_static $java.lang.Object.array (call $function.no.side.effects.$getString_|1|__java_lang_String (ref.func $$getString_|1|__java_lang_String@nullability.defaultnotnullable.DefaultNotNullable) )(call $function.no.side.effects.$getString_|2|__java_lang_String (ref.func $$getString_|2|__java_lang_String@nullability.defaultnotnullable.DefaultNotNullable) )))) + (local.set $s (call $$create__arrayOf_java_lang_Object@javaemul.internal.WasmArray.OfObject (array.new_fixed $java.lang.Object.array (call $function.no.side.effects.$getString_|1|__java_lang_String (ref.func $$getString_|1|__java_lang_String@nullability.defaultnotnullable.DefaultNotNullable) )(call $function.no.side.effects.$getString_|2|__java_lang_String (ref.func $$getString_|2|__java_lang_String@nullability.defaultnotnullable.DefaultNotNullable) )))) ) ) @@ -7816,7 +7816,7 @@ (local $$instance (ref null $nullability.defaultnullable.DefaultNullable)) (block ;;@ nullability/defaultnullable/DefaultNullable.java:48:9 - (local.set $$instance (struct.new $nullability.defaultnullable.DefaultNullable (ref.as_non_null (global.get $nullability.defaultnullable.DefaultNullable.vtable)) (ref.as_non_null (global.get $itable.empty)) (i32.const 0) (call $function.no.side.effects.$getString_|Hello|__java_lang_String (ref.func $$getString_|Hello|__java_lang_String@nullability.Nullability) ) (ref.null $java.lang.String) (ref.null $java.lang.String) (ref.null $java.lang.Object) (ref.null $java.lang.Object) (ref.null $java.lang.Object) (ref.null $java.lang.Object) (call $$create__arrayOf_java_lang_Object@javaemul.internal.WasmArray.OfObject (array.init_static $java.lang.Object.array )) (call $$create__arrayOf_java_lang_Object@javaemul.internal.WasmArray.OfObject (array.init_static $java.lang.Object.array )) (call $$create__arrayOf_java_lang_Object@javaemul.internal.WasmArray.OfObject (array.init_static $java.lang.Object.array )) (ref.null $java.lang.Void) (ref.null $java.lang.Object) (ref.null $java.lang.Object) (ref.null $java.lang.Object))) + (local.set $$instance (struct.new $nullability.defaultnullable.DefaultNullable (ref.as_non_null (global.get $nullability.defaultnullable.DefaultNullable.vtable)) (ref.as_non_null (global.get $itable.empty)) (i32.const 0) (call $function.no.side.effects.$getString_|Hello|__java_lang_String (ref.func $$getString_|Hello|__java_lang_String@nullability.Nullability) ) (ref.null $java.lang.String) (ref.null $java.lang.String) (ref.null $java.lang.Object) (ref.null $java.lang.Object) (ref.null $java.lang.Object) (ref.null $java.lang.Object) (call $$create__arrayOf_java_lang_Object@javaemul.internal.WasmArray.OfObject (array.new_fixed $java.lang.Object.array )) (call $$create__arrayOf_java_lang_Object@javaemul.internal.WasmArray.OfObject (array.new_fixed $java.lang.Object.array )) (call $$create__arrayOf_java_lang_Object@javaemul.internal.WasmArray.OfObject (array.new_fixed $java.lang.Object.array )) (ref.null $java.lang.Void) (ref.null $java.lang.Object) (ref.null $java.lang.Object) (ref.null $java.lang.Object))) ;;@ nullability/defaultnullable/DefaultNullable.java:48:9 (call $$ctor__void_$p_nullability_defaultnullable_DefaultNullable@nullability.defaultnullable.DefaultNullable (ref.as_non_null (local.get $$instance))) ;;@ nullability/defaultnullable/DefaultNullable.java:48:9 @@ -10271,39 +10271,39 @@ ;;@ nullability/explicitnotnullable/ExplicitNotNullable.java:34:2 (struct.set $nullability.explicitnotnullable.ExplicitNotNullable $f_f7__nullability_explicitnotnullable_ExplicitNotNullable_ (local.get $this) (ref.null $java.lang.Object)) ;;@ nullability/explicitnotnullable/ExplicitNotNullable.java:35:2 - (struct.set $nullability.explicitnotnullable.ExplicitNotNullable $f_f8__nullability_explicitnotnullable_ExplicitNotNullable_ (local.get $this) (call $$create__arrayOf_java_lang_Object@javaemul.internal.WasmArray.OfObject (array.init_static $java.lang.Object.array ))) + (struct.set $nullability.explicitnotnullable.ExplicitNotNullable $f_f8__nullability_explicitnotnullable_ExplicitNotNullable_ (local.get $this) (call $$create__arrayOf_java_lang_Object@javaemul.internal.WasmArray.OfObject (array.new_fixed $java.lang.Object.array ))) ;;@ nullability/explicitnotnullable/ExplicitNotNullable.java:37:2 - (struct.set $nullability.explicitnotnullable.ExplicitNotNullable $f_f9__nullability_explicitnotnullable_ExplicitNotNullable_ (local.get $this) (call $$create__arrayOf_java_lang_Object@javaemul.internal.WasmArray.OfObject (array.init_static $java.lang.Object.array ))) + (struct.set $nullability.explicitnotnullable.ExplicitNotNullable $f_f9__nullability_explicitnotnullable_ExplicitNotNullable_ (local.get $this) (call $$create__arrayOf_java_lang_Object@javaemul.internal.WasmArray.OfObject (array.new_fixed $java.lang.Object.array ))) ;;@ nullability/explicitnotnullable/ExplicitNotNullable.java:39:2 - (struct.set $nullability.explicitnotnullable.ExplicitNotNullable $f_f10__nullability_explicitnotnullable_ExplicitNotNullable_ (local.get $this) (call $$create__arrayOf_java_lang_Object@javaemul.internal.WasmArray.OfObject (array.init_static $java.lang.Object.array ))) + (struct.set $nullability.explicitnotnullable.ExplicitNotNullable $f_f10__nullability_explicitnotnullable_ExplicitNotNullable_ (local.get $this) (call $$create__arrayOf_java_lang_Object@javaemul.internal.WasmArray.OfObject (array.new_fixed $java.lang.Object.array ))) ;;@ nullability/explicitnotnullable/ExplicitNotNullable.java:40:2 (struct.set $nullability.explicitnotnullable.ExplicitNotNullable $f_f11__nullability_explicitnotnullable_ExplicitNotNullable_ (local.get $this) (ref.null $java.lang.Void)) ;;@ nullability/explicitnotnullable/ExplicitNotNullable.java:41:2 (struct.set $nullability.explicitnotnullable.ExplicitNotNullable $f_f12__nullability_explicitnotnullable_ExplicitNotNullable_ (local.get $this) (call $$create__@java.lang.Object )) ;;@ nullability/explicitnotnullable/ExplicitNotNullable.java:45:2 - (struct.set $nullability.explicitnotnullable.ExplicitNotNullable $f_f15__nullability_explicitnotnullable_ExplicitNotNullable_ (local.get $this) (call $$create__arrayOf_java_lang_Object@javaemul.internal.WasmArray.OfObject (array.init_static $java.lang.Object.array ))) + (struct.set $nullability.explicitnotnullable.ExplicitNotNullable $f_f15__nullability_explicitnotnullable_ExplicitNotNullable_ (local.get $this) (call $$create__arrayOf_java_lang_Object@javaemul.internal.WasmArray.OfObject (array.new_fixed $java.lang.Object.array ))) ;;@ nullability/explicitnotnullable/ExplicitNotNullable.java:46:2 - (struct.set $nullability.explicitnotnullable.ExplicitNotNullable $f_f16__nullability_explicitnotnullable_ExplicitNotNullable_ (local.get $this) (call $$create__arrayOf_java_lang_Object@javaemul.internal.WasmArray.OfObject (array.init_static $java.lang.Object.array ))) + (struct.set $nullability.explicitnotnullable.ExplicitNotNullable $f_f16__nullability_explicitnotnullable_ExplicitNotNullable_ (local.get $this) (call $$create__arrayOf_java_lang_Object@javaemul.internal.WasmArray.OfObject (array.new_fixed $java.lang.Object.array ))) ;;@ nullability/explicitnotnullable/ExplicitNotNullable.java:47:2 - (struct.set $nullability.explicitnotnullable.ExplicitNotNullable $f_f17__nullability_explicitnotnullable_ExplicitNotNullable_ (local.get $this) (call $$create__arrayOf_java_lang_Object@javaemul.internal.WasmArray.OfObject (array.init_static $java.lang.Object.array ))) + (struct.set $nullability.explicitnotnullable.ExplicitNotNullable $f_f17__nullability_explicitnotnullable_ExplicitNotNullable_ (local.get $this) (call $$create__arrayOf_java_lang_Object@javaemul.internal.WasmArray.OfObject (array.new_fixed $java.lang.Object.array ))) ;;@ nullability/explicitnotnullable/ExplicitNotNullable.java:48:2 - (struct.set $nullability.explicitnotnullable.ExplicitNotNullable $f_f18__nullability_explicitnotnullable_ExplicitNotNullable_ (local.get $this) (call $$create__arrayOf_java_lang_Object@javaemul.internal.WasmArray.OfObject (array.init_static $java.lang.Object.array ))) + (struct.set $nullability.explicitnotnullable.ExplicitNotNullable $f_f18__nullability_explicitnotnullable_ExplicitNotNullable_ (local.get $this) (call $$create__arrayOf_java_lang_Object@javaemul.internal.WasmArray.OfObject (array.new_fixed $java.lang.Object.array ))) ;;@ nullability/explicitnotnullable/ExplicitNotNullable.java:49:2 - (struct.set $nullability.explicitnotnullable.ExplicitNotNullable $f_f19__nullability_explicitnotnullable_ExplicitNotNullable_ (local.get $this) (call $$create__arrayOf_java_lang_Object@javaemul.internal.WasmArray.OfObject (array.init_static $java.lang.Object.array ))) + (struct.set $nullability.explicitnotnullable.ExplicitNotNullable $f_f19__nullability_explicitnotnullable_ExplicitNotNullable_ (local.get $this) (call $$create__arrayOf_java_lang_Object@javaemul.internal.WasmArray.OfObject (array.new_fixed $java.lang.Object.array ))) ;;@ nullability/explicitnotnullable/ExplicitNotNullable.java:50:2 - (struct.set $nullability.explicitnotnullable.ExplicitNotNullable $f_f20__nullability_explicitnotnullable_ExplicitNotNullable_ (local.get $this) (call $$create__arrayOf_java_lang_Object@javaemul.internal.WasmArray.OfObject (array.init_static $java.lang.Object.array ))) + (struct.set $nullability.explicitnotnullable.ExplicitNotNullable $f_f20__nullability_explicitnotnullable_ExplicitNotNullable_ (local.get $this) (call $$create__arrayOf_java_lang_Object@javaemul.internal.WasmArray.OfObject (array.new_fixed $java.lang.Object.array ))) ;;@ nullability/explicitnotnullable/ExplicitNotNullable.java:51:2 - (struct.set $nullability.explicitnotnullable.ExplicitNotNullable $f_f21__nullability_explicitnotnullable_ExplicitNotNullable_ (local.get $this) (call $$create__arrayOf_java_lang_Object@javaemul.internal.WasmArray.OfObject (array.init_static $java.lang.Object.array ))) + (struct.set $nullability.explicitnotnullable.ExplicitNotNullable $f_f21__nullability_explicitnotnullable_ExplicitNotNullable_ (local.get $this) (call $$create__arrayOf_java_lang_Object@javaemul.internal.WasmArray.OfObject (array.new_fixed $java.lang.Object.array ))) ;;@ nullability/explicitnotnullable/ExplicitNotNullable.java:52:2 - (struct.set $nullability.explicitnotnullable.ExplicitNotNullable $f_f22__nullability_explicitnotnullable_ExplicitNotNullable_ (local.get $this) (call $$create__arrayOf_java_lang_Object@javaemul.internal.WasmArray.OfObject (array.init_static $java.lang.Object.array ))) + (struct.set $nullability.explicitnotnullable.ExplicitNotNullable $f_f22__nullability_explicitnotnullable_ExplicitNotNullable_ (local.get $this) (call $$create__arrayOf_java_lang_Object@javaemul.internal.WasmArray.OfObject (array.new_fixed $java.lang.Object.array ))) ;;@ nullability/explicitnotnullable/ExplicitNotNullable.java:54:2 - (struct.set $nullability.explicitnotnullable.ExplicitNotNullable $f_f23__nullability_explicitnotnullable_ExplicitNotNullable_ (local.get $this) (call $$create__arrayOf_java_lang_Object@javaemul.internal.WasmArray.OfObject (array.init_static $java.lang.Object.array ))) + (struct.set $nullability.explicitnotnullable.ExplicitNotNullable $f_f23__nullability_explicitnotnullable_ExplicitNotNullable_ (local.get $this) (call $$create__arrayOf_java_lang_Object@javaemul.internal.WasmArray.OfObject (array.new_fixed $java.lang.Object.array ))) ;;@ nullability/explicitnotnullable/ExplicitNotNullable.java:55:2 - (struct.set $nullability.explicitnotnullable.ExplicitNotNullable $f_f24__nullability_explicitnotnullable_ExplicitNotNullable_ (local.get $this) (call $$create__arrayOf_java_lang_Object@javaemul.internal.WasmArray.OfObject (array.init_static $java.lang.Object.array ))) + (struct.set $nullability.explicitnotnullable.ExplicitNotNullable $f_f24__nullability_explicitnotnullable_ExplicitNotNullable_ (local.get $this) (call $$create__arrayOf_java_lang_Object@javaemul.internal.WasmArray.OfObject (array.new_fixed $java.lang.Object.array ))) ;;@ nullability/explicitnotnullable/ExplicitNotNullable.java:56:2 - (struct.set $nullability.explicitnotnullable.ExplicitNotNullable $f_f25__nullability_explicitnotnullable_ExplicitNotNullable_ (local.get $this) (call $$create__arrayOf_java_lang_Object@javaemul.internal.WasmArray.OfObject (array.init_static $java.lang.Object.array ))) + (struct.set $nullability.explicitnotnullable.ExplicitNotNullable $f_f25__nullability_explicitnotnullable_ExplicitNotNullable_ (local.get $this) (call $$create__arrayOf_java_lang_Object@javaemul.internal.WasmArray.OfObject (array.new_fixed $java.lang.Object.array ))) ;;@ nullability/explicitnotnullable/ExplicitNotNullable.java:57:2 - (struct.set $nullability.explicitnotnullable.ExplicitNotNullable $f_f26__nullability_explicitnotnullable_ExplicitNotNullable_ (local.get $this) (call $$create__arrayOf_java_lang_Object@javaemul.internal.WasmArray.OfObject (array.init_static $java.lang.Object.array ))) + (struct.set $nullability.explicitnotnullable.ExplicitNotNullable $f_f26__nullability_explicitnotnullable_ExplicitNotNullable_ (local.get $this) (call $$create__arrayOf_java_lang_Object@javaemul.internal.WasmArray.OfObject (array.new_fixed $java.lang.Object.array ))) ;;@ nullability/explicitnotnullable/ExplicitNotNullable.java:59:2 (struct.set $nullability.explicitnotnullable.ExplicitNotNullable $f_f27__nullability_explicitnotnullable_ExplicitNotNullable_ (local.get $this) (call $m_newWithLength__int__javaemul_internal_WasmArray_OfObject@javaemul.internal.WasmArray.OfObject (i32.const 1))) ;;@ nullability/explicitnotnullable/ExplicitNotNullable.java:60:2 diff --git a/transpiler/javatests/com/google/j2cl/readable/java/parameterassignments/output_wasm/module.wat.txt b/transpiler/javatests/com/google/j2cl/readable/java/parameterassignments/output_wasm/module.wat.txt index 067eb7b652..9468cb3b1f 100644 --- a/transpiler/javatests/com/google/j2cl/readable/java/parameterassignments/output_wasm/module.wat.txt +++ b/transpiler/javatests/com/google/j2cl/readable/java/parameterassignments/output_wasm/module.wat.txt @@ -520,7 +520,7 @@ (local.set $this (ref.cast (ref $parameterassignments.Main) (local.get $this.untyped))) (block ;;@ parameterassignments/Main.java:34:4 - (local.set $oa (call $$create__arrayOf_java_lang_Object@javaemul.internal.WasmArray.OfObject (array.init_static $java.lang.Object.array (local.get $o)(array.get $java.lang.Object.array (struct.get $javaemul.internal.WasmArray.OfObject $f_elements__javaemul_internal_WasmArray_OfObject (local.get $oa)) (i32.const 0))))) + (local.set $oa (call $$create__arrayOf_java_lang_Object@javaemul.internal.WasmArray.OfObject (array.new_fixed $java.lang.Object.array (local.get $o)(array.get $java.lang.Object.array (struct.get $javaemul.internal.WasmArray.OfObject $f_elements__javaemul_internal_WasmArray_OfObject (local.get $oa)) (i32.const 0))))) ) ) (elem declare func $m_testObjectVarargs__java_lang_Object__arrayOf_java_lang_Object__void_$pp_parameterassignments@parameterassignments.Main) @@ -536,7 +536,7 @@ (local.set $this (ref.cast (ref $parameterassignments.Main) (local.get $this.untyped))) (block ;;@ parameterassignments/Main.java:38:4 - (local.set $ia (call $$create__arrayOf_int@javaemul.internal.WasmArray.OfInt (array.init_static $int.array (local.get $i)(array.get $int.array (struct.get $javaemul.internal.WasmArray.OfInt $f_elements__javaemul_internal_WasmArray_OfInt (local.get $ia)) (i32.const 0))))) + (local.set $ia (call $$create__arrayOf_int@javaemul.internal.WasmArray.OfInt (array.new_fixed $int.array (local.get $i)(array.get $int.array (struct.get $javaemul.internal.WasmArray.OfInt $f_elements__javaemul_internal_WasmArray_OfInt (local.get $ia)) (i32.const 0))))) ) ) (elem declare func $m_testPrimitiveVarargs__int__arrayOf_int__void_$pp_parameterassignments@parameterassignments.Main) diff --git a/transpiler/javatests/com/google/j2cl/readable/java/switchstatement/output_wasm/module.wat.txt b/transpiler/javatests/com/google/j2cl/readable/java/switchstatement/output_wasm/module.wat.txt index 525cccb26f..ef5e2afffc 100644 --- a/transpiler/javatests/com/google/j2cl/readable/java/switchstatement/output_wasm/module.wat.txt +++ b/transpiler/javatests/com/google/j2cl/readable/java/switchstatement/output_wasm/module.wat.txt @@ -1391,7 +1391,7 @@ ;;@ switchstatement/SwitchStatement.java:18:5 (call $$clinit__void@switchstatement.Numbers ) ;;@ switchstatement/SwitchStatement.java:18:5 - (return (call $$create__arrayOf_java_lang_Object@javaemul.internal.WasmArray.OfObject (array.init_static $java.lang.Object.array (global.get $f_ONE__switchstatement_Numbers)(global.get $f_TWO__switchstatement_Numbers)(global.get $f_THREE__switchstatement_Numbers)))) + (return (call $$create__arrayOf_java_lang_Object@javaemul.internal.WasmArray.OfObject (array.new_fixed $java.lang.Object.array (global.get $f_ONE__switchstatement_Numbers)(global.get $f_TWO__switchstatement_Numbers)(global.get $f_THREE__switchstatement_Numbers)))) ) ) diff --git a/transpiler/javatests/com/google/j2cl/readable/java/varargs/output_wasm/module.wat.txt b/transpiler/javatests/com/google/j2cl/readable/java/varargs/output_wasm/module.wat.txt index 4031a1c606..cb095bdf90 100644 --- a/transpiler/javatests/com/google/j2cl/readable/java/varargs/output_wasm/module.wat.txt +++ b/transpiler/javatests/com/google/j2cl/readable/java/varargs/output_wasm/module.wat.txt @@ -345,7 +345,7 @@ ;;@ varargs/Varargs.java:47:39 (call $$clinit__void@varargs.Varargs ) ;;@ varargs/Varargs.java:48:4 - (call $m_fun__arrayOf_java_lang_Object__void@varargs.Varargs (call $$create__arrayOf_java_lang_Object@javaemul.internal.WasmArray.OfObject (array.init_static $java.lang.Object.array (local.get $a)(local.get $b)))) + (call $m_fun__arrayOf_java_lang_Object__void@varargs.Varargs (call $$create__arrayOf_java_lang_Object@javaemul.internal.WasmArray.OfObject (array.new_fixed $java.lang.Object.array (local.get $a)(local.get $b)))) ) ) @@ -361,19 +361,19 @@ ;;@ varargs/Varargs.java:52:4 (local.set $v (call $$create__@varargs.Varargs )) ;;@ varargs/Varargs.java:53:4 - (call_ref $function.m_test__int__arrayOf_java_lang_Object__void (ref.as_non_null (local.get $v))(i32.const 1)(call $$create__arrayOf_java_lang_Object@javaemul.internal.WasmArray.OfObject (array.init_static $java.lang.Object.array ))(struct.get $varargs.Varargs.vtable $m_test__int__arrayOf_java_lang_Object__void (struct.get $varargs.Varargs $vtable(local.get $v)))) + (call_ref $function.m_test__int__arrayOf_java_lang_Object__void (ref.as_non_null (local.get $v))(i32.const 1)(call $$create__arrayOf_java_lang_Object@javaemul.internal.WasmArray.OfObject (array.new_fixed $java.lang.Object.array ))(struct.get $varargs.Varargs.vtable $m_test__int__arrayOf_java_lang_Object__void (struct.get $varargs.Varargs $vtable(local.get $v)))) ;;@ varargs/Varargs.java:54:4 - (call_ref $function.m_test__int__arrayOf_java_lang_Object__void (ref.as_non_null (local.get $v))(i32.const 1)(call $$create__arrayOf_java_lang_Object@javaemul.internal.WasmArray.OfObject (array.init_static $java.lang.Object.array (call $$create__@java.lang.Object )))(struct.get $varargs.Varargs.vtable $m_test__int__arrayOf_java_lang_Object__void (struct.get $varargs.Varargs $vtable(local.get $v)))) + (call_ref $function.m_test__int__arrayOf_java_lang_Object__void (ref.as_non_null (local.get $v))(i32.const 1)(call $$create__arrayOf_java_lang_Object@javaemul.internal.WasmArray.OfObject (array.new_fixed $java.lang.Object.array (call $$create__@java.lang.Object )))(struct.get $varargs.Varargs.vtable $m_test__int__arrayOf_java_lang_Object__void (struct.get $varargs.Varargs $vtable(local.get $v)))) ;;@ varargs/Varargs.java:55:4 - (call_ref $function.m_test__int__arrayOf_java_lang_Object__void (ref.as_non_null (local.get $v))(i32.const 1)(call $$create__arrayOf_java_lang_Object@javaemul.internal.WasmArray.OfObject (array.init_static $java.lang.Object.array (call $$create__@java.lang.Object )))(struct.get $varargs.Varargs.vtable $m_test__int__arrayOf_java_lang_Object__void (struct.get $varargs.Varargs $vtable(local.get $v)))) + (call_ref $function.m_test__int__arrayOf_java_lang_Object__void (ref.as_non_null (local.get $v))(i32.const 1)(call $$create__arrayOf_java_lang_Object@javaemul.internal.WasmArray.OfObject (array.new_fixed $java.lang.Object.array (call $$create__@java.lang.Object )))(struct.get $varargs.Varargs.vtable $m_test__int__arrayOf_java_lang_Object__void (struct.get $varargs.Varargs $vtable(local.get $v)))) ;;@ varargs/Varargs.java:56:4 - (call_ref $function.m_test__int__arrayOf_java_lang_Object__void (ref.as_non_null (local.get $v))(i32.const 1)(call $$create__arrayOf_java_lang_Object@javaemul.internal.WasmArray.OfObject (array.init_static $java.lang.Object.array ))(struct.get $varargs.Varargs.vtable $m_test__int__arrayOf_java_lang_Object__void (struct.get $varargs.Varargs $vtable(local.get $v)))) + (call_ref $function.m_test__int__arrayOf_java_lang_Object__void (ref.as_non_null (local.get $v))(i32.const 1)(call $$create__arrayOf_java_lang_Object@javaemul.internal.WasmArray.OfObject (array.new_fixed $java.lang.Object.array ))(struct.get $varargs.Varargs.vtable $m_test__int__arrayOf_java_lang_Object__void (struct.get $varargs.Varargs $vtable(local.get $v)))) ;;@ varargs/Varargs.java:57:4 - (call_ref $function.m_test__int__arrayOf_java_lang_Object__void (ref.as_non_null (local.get $v))(i32.const 1)(call $$create__arrayOf_java_lang_Object@javaemul.internal.WasmArray.OfObject (array.init_static $java.lang.Object.array ))(struct.get $varargs.Varargs.vtable $m_test__int__arrayOf_java_lang_Object__void (struct.get $varargs.Varargs $vtable(local.get $v)))) + (call_ref $function.m_test__int__arrayOf_java_lang_Object__void (ref.as_non_null (local.get $v))(i32.const 1)(call $$create__arrayOf_java_lang_Object@javaemul.internal.WasmArray.OfObject (array.new_fixed $java.lang.Object.array ))(struct.get $varargs.Varargs.vtable $m_test__int__arrayOf_java_lang_Object__void (struct.get $varargs.Varargs $vtable(local.get $v)))) ;;@ varargs/Varargs.java:58:4 - (call_ref $function.m_testCloneable__arrayOf_java_lang_Cloneable__void (ref.as_non_null (local.get $v))(call $$create__arrayOf_java_lang_Object@javaemul.internal.WasmArray.OfObject (array.init_static $java.lang.Object.array ))(struct.get $varargs.Varargs.vtable $m_testCloneable__arrayOf_java_lang_Cloneable__void (struct.get $varargs.Varargs $vtable(local.get $v)))) + (call_ref $function.m_testCloneable__arrayOf_java_lang_Cloneable__void (ref.as_non_null (local.get $v))(call $$create__arrayOf_java_lang_Object@javaemul.internal.WasmArray.OfObject (array.new_fixed $java.lang.Object.array ))(struct.get $varargs.Varargs.vtable $m_testCloneable__arrayOf_java_lang_Cloneable__void (struct.get $varargs.Varargs $vtable(local.get $v)))) ;;@ varargs/Varargs.java:59:4 - (call_ref $function.m_testSerializable__arrayOf_java_io_Serializable__void (ref.as_non_null (local.get $v))(call $$create__arrayOf_java_lang_Object@javaemul.internal.WasmArray.OfObject (array.init_static $java.lang.Object.array ))(struct.get $varargs.Varargs.vtable $m_testSerializable__arrayOf_java_io_Serializable__void (struct.get $varargs.Varargs $vtable(local.get $v)))) + (call_ref $function.m_testSerializable__arrayOf_java_io_Serializable__void (ref.as_non_null (local.get $v))(call $$create__arrayOf_java_lang_Object@javaemul.internal.WasmArray.OfObject (array.new_fixed $java.lang.Object.array ))(struct.get $varargs.Varargs.vtable $m_testSerializable__arrayOf_java_io_Serializable__void (struct.get $varargs.Varargs $vtable(local.get $v)))) ;;@ varargs/Varargs.java:60:4 (call_ref $function.m_testLambda__varargs_Varargs_FunctionalInterface__void (ref.as_non_null (local.get $v))(call $$create__varargs_Varargs@varargs.Varargs.$LambdaImplementor$1 (local.get $this))(struct.get $varargs.Varargs.vtable $m_testLambda__varargs_Varargs_FunctionalInterface__void (struct.get $varargs.Varargs $vtable(local.get $v)))) ) diff --git a/transpiler/javatests/com/google/j2cl/readable/java/wasmimmutablefields/output_wasm/module.wat.txt b/transpiler/javatests/com/google/j2cl/readable/java/wasmimmutablefields/output_wasm/module.wat.txt index a1e65d1449..02bd72cc24 100644 --- a/transpiler/javatests/com/google/j2cl/readable/java/wasmimmutablefields/output_wasm/module.wat.txt +++ b/transpiler/javatests/com/google/j2cl/readable/java/wasmimmutablefields/output_wasm/module.wat.txt @@ -359,7 +359,7 @@ (local $$instance (ref null $wasmimmutablefields.AssignmentsInDeclaration)) (block ;;@ wasmimmutablefields/WasmImmutableFields.java:20:6 - (local.set $$instance (struct.new $wasmimmutablefields.AssignmentsInDeclaration (ref.as_non_null (global.get $wasmimmutablefields.AssignmentsInDeclaration.vtable)) (ref.as_non_null (global.get $itable.empty)) (i32.const 0) (i32.const 12) (call $function.no.side.effects.$getString_|Hello_World|__java_lang_String (ref.func $$getString_|Hello_World|__java_lang_String@wasmimmutablefields.AssignmentsInDeclaration) ) (ref.null $javaemul.internal.WasmArray.OfObject) (call $m_createMultiDimensional__arrayOf_int__int__arrayOf_java_lang_Object@javaemul.internal.WasmArray (call $$create__arrayOf_int@javaemul.internal.WasmArray.OfInt (array.new_data $int.array $arrayliteral@wasmimmutablefields.AssignmentsInDeclaration-1 (i32.const 0) (i32.const 3)))(i32.const -1)) (call $$create__arrayOf_int@javaemul.internal.WasmArray.OfInt (array.new_data $int.array $arrayliteral@wasmimmutablefields.AssignmentsInDeclaration-2 (i32.const 0) (i32.const 4))) (call $$create__arrayOf_java_lang_Object@javaemul.internal.WasmArray.OfObject (array.init_static $java.lang.Object.array (call $$create__arrayOf_int@javaemul.internal.WasmArray.OfInt (array.new_data $int.array $arrayliteral@wasmimmutablefields.AssignmentsInDeclaration-3 (i32.const 0) (i32.const 2)))(call $$create__arrayOf_int@javaemul.internal.WasmArray.OfInt (array.new_data $int.array $arrayliteral@wasmimmutablefields.AssignmentsInDeclaration-4 (i32.const 0) (i32.const 2))))) (call $function.no.side.effects.$getClassMetadata__java_lang_Class (ref.func $$getClassMetadata__java_lang_Class@wasmimmutablefields.WasmImmutableFields) ) (ref.null $javaemul.internal.WasmArray.OfObject))) + (local.set $$instance (struct.new $wasmimmutablefields.AssignmentsInDeclaration (ref.as_non_null (global.get $wasmimmutablefields.AssignmentsInDeclaration.vtable)) (ref.as_non_null (global.get $itable.empty)) (i32.const 0) (i32.const 12) (call $function.no.side.effects.$getString_|Hello_World|__java_lang_String (ref.func $$getString_|Hello_World|__java_lang_String@wasmimmutablefields.AssignmentsInDeclaration) ) (ref.null $javaemul.internal.WasmArray.OfObject) (call $m_createMultiDimensional__arrayOf_int__int__arrayOf_java_lang_Object@javaemul.internal.WasmArray (call $$create__arrayOf_int@javaemul.internal.WasmArray.OfInt (array.new_data $int.array $arrayliteral@wasmimmutablefields.AssignmentsInDeclaration-1 (i32.const 0) (i32.const 3)))(i32.const -1)) (call $$create__arrayOf_int@javaemul.internal.WasmArray.OfInt (array.new_data $int.array $arrayliteral@wasmimmutablefields.AssignmentsInDeclaration-2 (i32.const 0) (i32.const 4))) (call $$create__arrayOf_java_lang_Object@javaemul.internal.WasmArray.OfObject (array.new_fixed $java.lang.Object.array (call $$create__arrayOf_int@javaemul.internal.WasmArray.OfInt (array.new_data $int.array $arrayliteral@wasmimmutablefields.AssignmentsInDeclaration-3 (i32.const 0) (i32.const 2)))(call $$create__arrayOf_int@javaemul.internal.WasmArray.OfInt (array.new_data $int.array $arrayliteral@wasmimmutablefields.AssignmentsInDeclaration-4 (i32.const 0) (i32.const 2))))) (call $function.no.side.effects.$getClassMetadata__java_lang_Class (ref.func $$getClassMetadata__java_lang_Class@wasmimmutablefields.WasmImmutableFields) ) (ref.null $javaemul.internal.WasmArray.OfObject))) ;;@ wasmimmutablefields/WasmImmutableFields.java:20:6 (call $$ctor__void_$p_wasmimmutablefields_AssignmentsInDeclaration@wasmimmutablefields.AssignmentsInDeclaration (ref.as_non_null (local.get $$instance))) ;;@ wasmimmutablefields/WasmImmutableFields.java:20:6 @@ -472,7 +472,7 @@ (local $$instance (ref null $wasmimmutablefields.AssignmentsInInitializer)) (block ;;@ wasmimmutablefields/WasmImmutableFields.java:31:6 - (local.set $$instance (struct.new $wasmimmutablefields.AssignmentsInInitializer (ref.as_non_null (global.get $wasmimmutablefields.AssignmentsInInitializer.vtable)) (ref.as_non_null (global.get $itable.empty)) (i32.const 0) (i32.const 12) (call $function.no.side.effects.$getString_|Hello_World|__java_lang_String (ref.func $$getString_|Hello_World|__java_lang_String@wasmimmutablefields.AssignmentsInDeclaration) ) (ref.null $javaemul.internal.WasmArray.OfObject) (call $m_createMultiDimensional__arrayOf_int__int__arrayOf_java_lang_Object@javaemul.internal.WasmArray (call $$create__arrayOf_int@javaemul.internal.WasmArray.OfInt (array.new_data $int.array $arrayliteral@wasmimmutablefields.AssignmentsInInitializer-1 (i32.const 0) (i32.const 3)))(i32.const -1)) (call $$create__arrayOf_int@javaemul.internal.WasmArray.OfInt (array.new_data $int.array $arrayliteral@wasmimmutablefields.AssignmentsInInitializer-2 (i32.const 0) (i32.const 4))) (call $$create__arrayOf_java_lang_Object@javaemul.internal.WasmArray.OfObject (array.init_static $java.lang.Object.array (call $$create__arrayOf_int@javaemul.internal.WasmArray.OfInt (array.new_data $int.array $arrayliteral@wasmimmutablefields.AssignmentsInInitializer-3 (i32.const 0) (i32.const 2)))(call $$create__arrayOf_int@javaemul.internal.WasmArray.OfInt (array.new_data $int.array $arrayliteral@wasmimmutablefields.AssignmentsInInitializer-4 (i32.const 0) (i32.const 2))))) (call $function.no.side.effects.$getClassMetadata__java_lang_Class (ref.func $$getClassMetadata__java_lang_Class@wasmimmutablefields.WasmImmutableFields) ) (ref.null $javaemul.internal.WasmArray.OfObject))) + (local.set $$instance (struct.new $wasmimmutablefields.AssignmentsInInitializer (ref.as_non_null (global.get $wasmimmutablefields.AssignmentsInInitializer.vtable)) (ref.as_non_null (global.get $itable.empty)) (i32.const 0) (i32.const 12) (call $function.no.side.effects.$getString_|Hello_World|__java_lang_String (ref.func $$getString_|Hello_World|__java_lang_String@wasmimmutablefields.AssignmentsInDeclaration) ) (ref.null $javaemul.internal.WasmArray.OfObject) (call $m_createMultiDimensional__arrayOf_int__int__arrayOf_java_lang_Object@javaemul.internal.WasmArray (call $$create__arrayOf_int@javaemul.internal.WasmArray.OfInt (array.new_data $int.array $arrayliteral@wasmimmutablefields.AssignmentsInInitializer-1 (i32.const 0) (i32.const 3)))(i32.const -1)) (call $$create__arrayOf_int@javaemul.internal.WasmArray.OfInt (array.new_data $int.array $arrayliteral@wasmimmutablefields.AssignmentsInInitializer-2 (i32.const 0) (i32.const 4))) (call $$create__arrayOf_java_lang_Object@javaemul.internal.WasmArray.OfObject (array.new_fixed $java.lang.Object.array (call $$create__arrayOf_int@javaemul.internal.WasmArray.OfInt (array.new_data $int.array $arrayliteral@wasmimmutablefields.AssignmentsInInitializer-3 (i32.const 0) (i32.const 2)))(call $$create__arrayOf_int@javaemul.internal.WasmArray.OfInt (array.new_data $int.array $arrayliteral@wasmimmutablefields.AssignmentsInInitializer-4 (i32.const 0) (i32.const 2))))) (call $function.no.side.effects.$getClassMetadata__java_lang_Class (ref.func $$getClassMetadata__java_lang_Class@wasmimmutablefields.WasmImmutableFields) ) (ref.null $javaemul.internal.WasmArray.OfObject))) ;;@ wasmimmutablefields/WasmImmutableFields.java:31:6 (call $$ctor__void_$p_wasmimmutablefields_AssignmentsInInitializer@wasmimmutablefields.AssignmentsInInitializer (ref.as_non_null (local.get $$instance))) ;;@ wasmimmutablefields/WasmImmutableFields.java:31:6 @@ -575,7 +575,7 @@ (local $$instance (ref null $wasmimmutablefields.AssignmentsInConstructor)) (block ;;@ wasmimmutablefields/WasmImmutableFields.java:65:2 - (local.set $$instance (struct.new $wasmimmutablefields.AssignmentsInConstructor (ref.as_non_null (global.get $wasmimmutablefields.AssignmentsInConstructor.vtable)) (ref.as_non_null (global.get $itable.empty)) (i32.const 0) (i32.const 12) (call $function.no.side.effects.$getString_|Hello_World|__java_lang_String (ref.func $$getString_|Hello_World|__java_lang_String@wasmimmutablefields.AssignmentsInDeclaration) ) (ref.null $javaemul.internal.WasmArray.OfObject) (call $m_createMultiDimensional__arrayOf_int__int__arrayOf_java_lang_Object@javaemul.internal.WasmArray (call $$create__arrayOf_int@javaemul.internal.WasmArray.OfInt (array.init_static $int.array (local.get $intParameter)(i32.const 4)(i32.const -1)))(i32.const -1)) (call $$create__arrayOf_int@javaemul.internal.WasmArray.OfInt (array.init_static $int.array (i32.const 1)(i32.const 2)(local.get $intParameter)(i32.const 4))) (call $$create__arrayOf_java_lang_Object@javaemul.internal.WasmArray.OfObject (array.init_static $java.lang.Object.array (call $$create__arrayOf_int@javaemul.internal.WasmArray.OfInt (array.init_static $int.array (i32.const 1)(local.get $intParameter)))(call $$create__arrayOf_int@javaemul.internal.WasmArray.OfInt (array.new_data $int.array $arrayliteral@wasmimmutablefields.AssignmentsInConstructor-1 (i32.const 0) (i32.const 2))))) (call $function.no.side.effects.$getClassMetadata__java_lang_Class (ref.func $$getClassMetadata__java_lang_Class@wasmimmutablefields.WasmImmutableFields) ) (ref.null $javaemul.internal.WasmArray.OfObject) (local.get $parameter) (struct.get $wasmimmutablefields.AssignmentsInConstructor $f_stringLiteral__wasmimmutablefields_AssignmentsInConstructor (local.get $par)))) + (local.set $$instance (struct.new $wasmimmutablefields.AssignmentsInConstructor (ref.as_non_null (global.get $wasmimmutablefields.AssignmentsInConstructor.vtable)) (ref.as_non_null (global.get $itable.empty)) (i32.const 0) (i32.const 12) (call $function.no.side.effects.$getString_|Hello_World|__java_lang_String (ref.func $$getString_|Hello_World|__java_lang_String@wasmimmutablefields.AssignmentsInDeclaration) ) (ref.null $javaemul.internal.WasmArray.OfObject) (call $m_createMultiDimensional__arrayOf_int__int__arrayOf_java_lang_Object@javaemul.internal.WasmArray (call $$create__arrayOf_int@javaemul.internal.WasmArray.OfInt (array.new_fixed $int.array (local.get $intParameter)(i32.const 4)(i32.const -1)))(i32.const -1)) (call $$create__arrayOf_int@javaemul.internal.WasmArray.OfInt (array.new_fixed $int.array (i32.const 1)(i32.const 2)(local.get $intParameter)(i32.const 4))) (call $$create__arrayOf_java_lang_Object@javaemul.internal.WasmArray.OfObject (array.new_fixed $java.lang.Object.array (call $$create__arrayOf_int@javaemul.internal.WasmArray.OfInt (array.new_fixed $int.array (i32.const 1)(local.get $intParameter)))(call $$create__arrayOf_int@javaemul.internal.WasmArray.OfInt (array.new_data $int.array $arrayliteral@wasmimmutablefields.AssignmentsInConstructor-1 (i32.const 0) (i32.const 2))))) (call $function.no.side.effects.$getClassMetadata__java_lang_Class (ref.func $$getClassMetadata__java_lang_Class@wasmimmutablefields.WasmImmutableFields) ) (ref.null $javaemul.internal.WasmArray.OfObject) (local.get $parameter) (struct.get $wasmimmutablefields.AssignmentsInConstructor $f_stringLiteral__wasmimmutablefields_AssignmentsInConstructor (local.get $par)))) ;;@ wasmimmutablefields/WasmImmutableFields.java:65:2 (call $$ctor__java_lang_Object__int__wasmimmutablefields_AssignmentsInConstructor__void_$p_wasmimmutablefields_AssignmentsInConstructor@wasmimmutablefields.AssignmentsInConstructor (ref.as_non_null (local.get $$instance))(local.get $parameter)(local.get $intParameter)(local.get $par)) ;;@ wasmimmutablefields/WasmImmutableFields.java:65:2