@@ -1569,15 +1569,15 @@ impl Bindgen for FunctionBindgen<'_, '_> {
1569
1569
// Note that we can only reliably use `Address.ofData` for elements with alignment <= 4 because as
1570
1570
// of this writing TeaVM does not guarantee 64 bit items are aligned on 8 byte boundaries.
1571
1571
if realloc. is_none ( ) && size <= 4 {
1572
- results. push ( format ! ( "Address.ofData({op}).toInt()" ) ) ;
1572
+ results. push ( format ! ( "org.teavm.interop. Address.ofData({op}).toInt()" ) ) ;
1573
1573
} else {
1574
1574
let address = self . locals . tmp ( "address" ) ;
1575
1575
let ty = ty. to_upper_camel_case ( ) ;
1576
1576
1577
1577
uwrite ! (
1578
1578
self . src,
1579
1579
"
1580
- Address {address} = Memory.malloc({size} * ({op}).length, {size});
1580
+ org.teavm.interop. Address {address} = Memory.malloc({size} * ({op}).length, {size});
1581
1581
Memory.put{ty}s({address}, {op}, 0, ({op}).length);
1582
1582
"
1583
1583
) ;
@@ -1606,7 +1606,7 @@ impl Bindgen for FunctionBindgen<'_, '_> {
1606
1606
self . src,
1607
1607
"
1608
1608
{ty}[] {array} = new {ty}[{length}];
1609
- Memory.get{ty_upper}s(Address.fromInt({address}), {array}, 0, ({array}).length);
1609
+ Memory.get{ty_upper}s(org.teavm.interop. Address.fromInt({address}), {array}, 0, ({array}).length);
1610
1610
"
1611
1611
) ;
1612
1612
@@ -1622,14 +1622,14 @@ impl Bindgen for FunctionBindgen<'_, '_> {
1622
1622
) ;
1623
1623
1624
1624
if realloc. is_none ( ) {
1625
- results. push ( format ! ( "Address.ofData({bytes}).toInt()" ) ) ;
1625
+ results. push ( format ! ( "org.teavm.interop. Address.ofData({bytes}).toInt()" ) ) ;
1626
1626
} else {
1627
1627
let address = self . locals . tmp ( "address" ) ;
1628
1628
1629
1629
uwrite ! (
1630
1630
self . src,
1631
1631
"
1632
- Address {address} = Memory.malloc({bytes}.length, 1);
1632
+ org.teavm.interop. Address {address} = Memory.malloc({bytes}.length, 1);
1633
1633
Memory.putBytes({address}, {bytes}, 0, {bytes}.length);
1634
1634
"
1635
1635
) ;
@@ -1648,7 +1648,7 @@ impl Bindgen for FunctionBindgen<'_, '_> {
1648
1648
self . src,
1649
1649
"
1650
1650
byte[] {bytes} = new byte[{length}];
1651
- Memory.getBytes(Address.fromInt({address}), {bytes}, 0, {length});
1651
+ Memory.getBytes(org.teavm.interop. Address.fromInt({address}), {bytes}, 0, {length});
1652
1652
"
1653
1653
) ;
1654
1654
@@ -1724,7 +1724,7 @@ impl Bindgen for FunctionBindgen<'_, '_> {
1724
1724
{body}
1725
1725
{array}.add({result});
1726
1726
}}
1727
- Memory.free(Address.fromInt({address}), ({length}) * {size}, {align});
1727
+ Memory.free(org.teavm.interop. Address.fromInt({address}), ({length}) * {size}, {align});
1728
1728
"
1729
1729
) ;
1730
1730
@@ -1829,7 +1829,7 @@ impl Bindgen for FunctionBindgen<'_, '_> {
1829
1829
{
1830
1830
uwriteln ! (
1831
1831
self . src,
1832
- "Memory.free(Address.fromInt({address}), {size}, {align});"
1832
+ "Memory.free(org.teavm.interop. Address.fromInt({address}), {size}, {align});"
1833
1833
) ;
1834
1834
}
1835
1835
@@ -1838,7 +1838,7 @@ impl Bindgen for FunctionBindgen<'_, '_> {
1838
1838
self . src,
1839
1839
"
1840
1840
for ({}Cleanup cleanup : cleanupList) {{
1841
- Memory.free(Address.fromInt(cleanup.address), cleanup.size, cleanup.align);
1841
+ Memory.free(org.teavm.interop. Address.fromInt(cleanup.address), cleanup.size, cleanup.align);
1842
1842
}}
1843
1843
" ,
1844
1844
self . gen . gen . qualifier( )
@@ -1862,85 +1862,85 @@ impl Bindgen for FunctionBindgen<'_, '_> {
1862
1862
Instruction :: I32Load { offset }
1863
1863
| Instruction :: PointerLoad { offset }
1864
1864
| Instruction :: LengthLoad { offset } => results. push ( format ! (
1865
- "Address.fromInt(({}) + {offset}).getInt()" ,
1865
+ "org.teavm.interop. Address.fromInt(({}) + {offset}).getInt()" ,
1866
1866
operands[ 0 ]
1867
1867
) ) ,
1868
1868
1869
1869
Instruction :: I32Load8U { offset } => results. push ( format ! (
1870
- "(((int) Address.fromInt(({}) + {offset}).getByte()) & 0xFF)" ,
1870
+ "(((int) org.teavm.interop. Address.fromInt(({}) + {offset}).getByte()) & 0xFF)" ,
1871
1871
operands[ 0 ]
1872
1872
) ) ,
1873
1873
1874
1874
Instruction :: I32Load8S { offset } => results. push ( format ! (
1875
- "((int) Address.fromInt(({}) + {offset}).getByte())" ,
1875
+ "((int) org.teavm.interop. Address.fromInt(({}) + {offset}).getByte())" ,
1876
1876
operands[ 0 ]
1877
1877
) ) ,
1878
1878
1879
1879
Instruction :: I32Load16U { offset } => results. push ( format ! (
1880
- "(((int) Address.fromInt(({}) + {offset}).getShort()) & 0xFFFF)" ,
1880
+ "(((int) org.teavm.interop. Address.fromInt(({}) + {offset}).getShort()) & 0xFFFF)" ,
1881
1881
operands[ 0 ]
1882
1882
) ) ,
1883
1883
1884
1884
Instruction :: I32Load16S { offset } => results. push ( format ! (
1885
- "((int) Address.fromInt(({}) + {offset}).getShort())" ,
1885
+ "((int) org.teavm.interop. Address.fromInt(({}) + {offset}).getShort())" ,
1886
1886
operands[ 0 ]
1887
1887
) ) ,
1888
1888
1889
1889
Instruction :: I64Load { offset } => results. push ( format ! (
1890
- "Address.fromInt(({}) + {offset}).getLong()" ,
1890
+ "org.teavm.interop. Address.fromInt(({}) + {offset}).getLong()" ,
1891
1891
operands[ 0 ]
1892
1892
) ) ,
1893
1893
1894
1894
Instruction :: F32Load { offset } => results. push ( format ! (
1895
- "Address.fromInt(({}) + {offset}).getFloat()" ,
1895
+ "org.teavm.interop. Address.fromInt(({}) + {offset}).getFloat()" ,
1896
1896
operands[ 0 ]
1897
1897
) ) ,
1898
1898
1899
1899
Instruction :: F64Load { offset } => results. push ( format ! (
1900
- "Address.fromInt(({}) + {offset}).getDouble()" ,
1900
+ "org.teavm.interop. Address.fromInt(({}) + {offset}).getDouble()" ,
1901
1901
operands[ 0 ]
1902
1902
) ) ,
1903
1903
1904
1904
Instruction :: I32Store { offset }
1905
1905
| Instruction :: PointerStore { offset }
1906
1906
| Instruction :: LengthStore { offset } => uwriteln ! (
1907
1907
self . src,
1908
- "Address.fromInt(({}) + {offset}).putInt({});" ,
1908
+ "org.teavm.interop. Address.fromInt(({}) + {offset}).putInt({});" ,
1909
1909
operands[ 1 ] ,
1910
1910
operands[ 0 ]
1911
1911
) ,
1912
1912
1913
1913
Instruction :: I32Store8 { offset } => uwriteln ! (
1914
1914
self . src,
1915
- "Address.fromInt(({}) + {offset}).putByte((byte) ({}));" ,
1915
+ "org.teavm.interop. Address.fromInt(({}) + {offset}).putByte((byte) ({}));" ,
1916
1916
operands[ 1 ] ,
1917
1917
operands[ 0 ]
1918
1918
) ,
1919
1919
1920
1920
Instruction :: I32Store16 { offset } => uwriteln ! (
1921
1921
self . src,
1922
- "Address.fromInt(({}) + {offset}).putShort((short) ({}));" ,
1922
+ "org.teavm.interop. Address.fromInt(({}) + {offset}).putShort((short) ({}));" ,
1923
1923
operands[ 1 ] ,
1924
1924
operands[ 0 ]
1925
1925
) ,
1926
1926
1927
1927
Instruction :: I64Store { offset } => uwriteln ! (
1928
1928
self . src,
1929
- "Address.fromInt(({}) + {offset}).putLong({});" ,
1929
+ "org.teavm.interop. Address.fromInt(({}) + {offset}).putLong({});" ,
1930
1930
operands[ 1 ] ,
1931
1931
operands[ 0 ]
1932
1932
) ,
1933
1933
1934
1934
Instruction :: F32Store { offset } => uwriteln ! (
1935
1935
self . src,
1936
- "Address.fromInt(({}) + {offset}).putFloat({});" ,
1936
+ "org.teavm.interop. Address.fromInt(({}) + {offset}).putFloat({});" ,
1937
1937
operands[ 1 ] ,
1938
1938
operands[ 0 ]
1939
1939
) ,
1940
1940
1941
1941
Instruction :: F64Store { offset } => uwriteln ! (
1942
1942
self . src,
1943
- "Address.fromInt(({}) + {offset}).putDouble({});" ,
1943
+ "org.teavm.interop. Address.fromInt(({}) + {offset}).putDouble({});" ,
1944
1944
operands[ 1 ] ,
1945
1945
operands[ 0 ]
1946
1946
) ,
@@ -1950,14 +1950,14 @@ impl Bindgen for FunctionBindgen<'_, '_> {
1950
1950
Instruction :: GuestDeallocate { size, align } => {
1951
1951
uwriteln ! (
1952
1952
self . src,
1953
- "Memory.free(Address.fromInt({}), {size}, {align});" ,
1953
+ "Memory.free(org.teavm.interop. Address.fromInt({}), {size}, {align});" ,
1954
1954
operands[ 0 ]
1955
1955
)
1956
1956
}
1957
1957
1958
1958
Instruction :: GuestDeallocateString => uwriteln ! (
1959
1959
self . src,
1960
- "Memory.free(Address.fromInt({}), {}, 1);" ,
1960
+ "Memory.free(org.teavm.interop. Address.fromInt({}), {}, 1);" ,
1961
1961
operands[ 0 ] ,
1962
1962
operands[ 1 ]
1963
1963
) ,
@@ -2023,7 +2023,7 @@ impl Bindgen for FunctionBindgen<'_, '_> {
2023
2023
2024
2024
uwriteln ! (
2025
2025
self . src,
2026
- "Memory.free(Address.fromInt({address}), ({length}) * {size}, {align});"
2026
+ "Memory.free(org.teavm.interop. Address.fromInt({address}), ({length}) * {size}, {align});"
2027
2027
) ;
2028
2028
}
2029
2029
}
0 commit comments