This release contains various bugfixes, performance improvements and new emulated Java class library elements. Among them there are some important improvements worth mentioning.
Java 21 support
Most notable change in this release is support for Java 21 features. This includes support for Java 21 bytecode, switch pattern matching and sequenced collections.
more transparent. This means: JS overlay objects (i.e. those which implement
now behave closer to normal objects. Now it's possible to call their methods, inherited from
getClass and so on.
instanceof JSObject can also be used
TeaVM now can generate imports: you can use new
@JSBodyImport annotation in addition to
to specify calls to routines defined in external modules.
that resolves to Java type. Additionally, some existing JSO APIs were updated to have
JSObject in their signature, which in some cases can break existing code (though, it must be
quite easy to fix).
Now when Java class implements JSO interface, which has methods marked with
they will work as expected.
This long-awaited feature is at last here. There were codebases that relied on this class and did several
efforts to patch TeaVM to solve this issues. New
ConcurrentHashMap implementation is fair implementation,
which works well with TeaVM green threads. In case there are no threads at all,
will prevent turning Java methods into state machine, so no overhead there.
WeakReference and ReferenceQueue
These classes used to be implemented by C and WebAssembly backends, since both have their own heap.
Atomic field updaters
AtomicReferenceFieldUpdater used by Kotlin standard library to implement lazy properties.
Instead of patching Kotlin bytecode, TeaVM comes with fair support of three classes:
These classes have each two implementation: efficient and generic. Efficient implementation
is only used when constants passed to
newUpdater method. Otherwise, generic implementation is used, which
uses reflection under-the-hood, so corresponding fields should be property marked as reflectable.
- Improvements to number-to-string and string-to-number conversions (still some inconsistencies with doubles and floats).
- Improvements to support of floating points operations in
- Improvements to Streams support.
New release provides major improvements to WebAssembly support. Not only stability is improved, but very process has changed. From now on WebAssembly tests run as part of each release and preview build. This was possible to run WebAssembly tests, but some were failing, and when regression occurred, it was hard to find it. The new version allows to ignore tests for separate backends. Failing tests were ignored for WebAssembly and remaining tests are supposed to pass on each build.
Additionally, new release introduces better support for DWARF. It's still far from perfect, but it already works with Google Chrome C++ debugging extension. Line numbers are generated properly in most cases, variables often point to wrong locations.
Some old features were removed from
- It does not support parallel running anymore. Instead, developer should use JUnit built-in feature to run test classes in parallel.
- HtmlUnit was also removed.
@WholeClassCompilationis not deprecated and all test classes compile in single executable by default. To override this behaviour, use
New release allows also to suppress tests for separate backends, use
TeaVM now participates in GitHub sponsors. You can support TeaVM not only by contributing code or documentation, but also send some money to the project.
Special thanks to @Ihromant, who contributed lot to this release! Java 21 support is there mostly because of his efforts.
Also, thanks to: