Skip to content

Commit

Permalink
[WASM] Use array.new_fixed instead of deprecated array.init_static.
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 560755908
  • Loading branch information
rluble authored and copybara-github committed Aug 28, 2023
1 parent 3825b39 commit fd6dfa7
Show file tree
Hide file tree
Showing 18 changed files with 65 additions and 65 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 [email protected] (array.new_data $int.array [email protected] (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 [email protected] (array.new_data $int.array [email protected] (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
Expand Down Expand Up @@ -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 [email protected] (array.new_data $int.array [email protected] (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 [email protected] (array.new_data $int.array [email protected] (i32.const 0) (i32.const 2)))(i32.const -1)))
;;@ array/Arrays.java:56:4
Expand Down Expand Up @@ -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 [email protected] (array.new_data $int.array [email protected] (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 [email protected] (array.new_data $int.array [email protected] (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 [email protected] (array.new_data $int.array [email protected] (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 [email protected] (array.new_data $int.array [email protected] (i32.const 0) (i32.const 2)))(i32.const 5)))
;;@ array/Arrays.java:74:4
Expand All @@ -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 [email protected] (array.init_static $int.array (local.get $b)(local.get $c))))
(local.set $ints (call [email protected] (array.new_fixed $int.array (local.get $b)(local.get $c))))
)
)
(elem declare func [email protected])
Expand All @@ -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 [email protected] (array.new_data $int.array [email protected] (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 [email protected] (array.new_data $long.array [email protected] (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 [email protected] (array.new_data $long.array [email protected] (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 [email protected] (array.new_data $int.array [email protected] (i32.const 0) (i32.const 2)))(i32.const 6)))
;;@ array/Arrays.java:101:4
Expand All @@ -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 [email protected] (array.init_static $long.array (i64.extend_i32_s (local.get $b))(i64.extend_i32_u (local.get $c)))))
(local.set $longs (call [email protected] (array.new_fixed $long.array (i64.extend_i32_s (local.get $b))(i64.extend_i32_u (local.get $c)))))
)
)
(elem declare func [email protected])
Expand All @@ -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 [email protected] (i32.const 1))(call [email protected] (i32.const 0)))))
(local.set $booleans (call $$create__arrayOf_java_lang_Object@javaemul.internal.WasmArray.OfObject (array.new_fixed $java.lang.Object.array (call [email protected] (i32.const 1))(call [email protected] (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 [email protected] (array.new_data $int.array [email protected] (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 [email protected] (i32.const 1))(call [email protected] (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 [email protected] (i32.const 1))(call [email protected] (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 [email protected] (array.new_data $int.array [email protected] (i32.const 0) (i32.const 2)))(i32.const -1)))
;;@ array/Arrays.java:128:4
Expand Down Expand Up @@ -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 [email protected] (array.new_data $int.array [email protected] (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 [email protected] (array.new_data $int.array [email protected] (i32.const 0) (i32.const 2)))(i32.const -1)))
;;@ array/Arrays.java:146:4
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 [email protected] (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 [email protected] (i32.const 1))(call [email protected] (f64.const 2.2))(call [email protected] (i32.const 1))(call [email protected] (i32.const 1))(call [email protected] (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 [email protected] (i32.const 1))(call [email protected] (f64.const 2.2))(call [email protected] (i32.const 1))(call [email protected] (i32.const 1))(call [email protected] (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 [email protected] (i32.const 1))(call [email protected] (f64.const 2.2))(call [email protected] (i32.const 1))(call [email protected] (i32.const 1))(call [email protected] (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 [email protected] (i32.const 1))(call [email protected] (f64.const 2.2))(call [email protected] (i32.const 1))(call [email protected] (i32.const 1))(call [email protected] (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 [email protected] (f32.const 1.100000023841858))(call [email protected] (f32.const 97.0))(call [email protected] (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 [email protected] (f32.const 1.100000023841858))(call [email protected] (f32.const 97.0))(call [email protected] (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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@
;;@ castonarrayinit/CastOnArrayInit.java:25:4
(local.set $f2 (call [email protected] ))
;;@ 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))))
)
)

Expand Down
Loading

0 comments on commit fd6dfa7

Please sign in to comment.