1139 Commits

Author SHA1 Message Date
Alexey Andreev
cb4c48ca29 New algorithm for dependency analysis 2025-03-30 19:15:51 +02:00
Alexey Andreev
b609828bbe wasm gc: support undefined case when converting string from JS to Java 2025-03-21 15:47:24 +01:00
Alexey Andreev
206ec13d53 wasm gc: fix bugs in virtual table generator 2025-03-21 15:31:18 +01:00
Alexey Andreev
e14993f509 Improve performance of test running by running all tests from single class in same iframe without recompilation 2025-03-21 12:20:54 +01:00
Alexey Andreev
15469b94f5 wasm gc: fix function for accessing resources when there are no resources 2025-03-20 15:30:55 +01:00
Alexey Andreev
206a16ceac wasm gc: create array classes lazily at runtime instead of creating them at compile time 2025-03-20 15:20:06 +01:00
Alexey Andreev
a960a9a284 wasm gc: add option to generate compact module
This includes following:

* Generate all instance methods receivers as anyref in order
  to avoid generation of virtual table callers
* Generate virtual table initializers directly in globals section

This helps to avoid generation of too much and/or too large functions
for large codebases in fast pointer-to analysis mode
2025-03-19 15:10:44 +01:00
Alexey Andreev
1c6988bd3b wasm gc: reduce size of virtual table initialization code 2025-03-08 16:51:01 +01:00
Alexey Andreev
cb3bbf56dc wasm gc: use function to fill common virtual table methods 2025-03-07 09:48:22 +01:00
Alexey Andreev
5ee26e5281 wasm gc: improve VT fill size by choosing VT structures closer to root 2025-03-06 19:20:35 +01:00
Alexey Andreev
6bb53fb3a5 wasm gc: merge marker interfaces into corresponding classes to reduce number of merged interfaces in VT 2025-03-06 18:56:07 +01:00
Alexey Andreev
42dcddceb5 wasm gc: (minor) remove unused parameter from function type mapper 2025-03-06 18:21:34 +01:00
Alexey Andreev
e2a55a3438 Improve devirtualization speed in fast dependency analysis mode 2025-03-06 18:07:31 +01:00
Alexey Andreev
df4f11b0f0 wasm gc: further optimizations of virtual tables 2025-03-06 07:43:04 +01:00
Alexey Andreev
3a5ffc98a6 wasm gc: fix usage of type indexes 2025-02-27 19:47:27 +01:00
Alexey Andreev
1424bf8649 wasm gc: split representations of classes and virtual tables 2025-02-27 19:10:01 +01:00
Alexey Andreev
77d95a8881 wasm gc: fix issue in virtual table builder 2025-02-24 20:05:20 +01:00
Alexey Andreev
8cbbb35d9b wasm gc: compiler performance optimization 2025-02-23 20:31:34 +01:00
Alexey Andreev
78282158a9 wasm gc: fix bug with dependency analysis in fast mode 2025-02-23 19:46:07 +01:00
Alexey Andreev
7a21e5547a wasm gc: fix bug in virtual table optimizer 2025-02-23 10:21:00 +01:00
Alexey Andreev
ccfb0b9bc5 wasm gc: optimize virtual table generation
In certain cases assume that interface VT behaves as a class VT, thus don't move it to common superclass
2025-02-22 17:59:52 +01:00
Alexey Andreev
64c3ee81c2 js: more informative exception message when trying to suspend from non-thread context 2025-02-13 19:57:31 +01:00
Alexey Andreev
c083a62740 Fix Object.monitorEnter/monitorExit methods not being transformed into async state machine in some cases
Fix #969
2025-02-13 18:59:36 +01:00
Alexey Andreev
ef52e48187 wasm gc: fix bug in WeakReference implementation 2025-02-12 18:24:33 +01:00
Alexey Andreev
2958e63657 wasm gc: prevent null constant instructions that are used more that once
Rationale: since Wasm GC is statically typed IR, with even nulls having some type, sharing null constants between expressions can cause unsolvable contradictions in types
2025-02-10 20:10:34 +01:00
Alexey Andreev
bdc9fe757a wasm gc: support JSExceptions.getJSException 2025-02-08 16:03:09 +01:00
Alexey Andreev
da848c523b wasm gc: fix issues with type inference 2025-02-08 16:02:48 +01:00
Alexey Andreev
6a2bd3e6bf wasm gc: add classes that are not directly reachable, but are mentioned in method signatures
Rationale: it can be that some function `foo` declares that it takes class C, but class C is never reachable from code (e.g. never get instantiated, and `foo` only takes nulls). In this case it can be that class C has no representation in Wasm module, which can lead to type validation errors.
2025-02-08 09:11:21 +01:00
Alexey Andreev
7fdaf3c0d1 jso: pass primitive arrays to JS as TypedArrays 2025-02-07 18:54:55 +01:00
Alexey Andreev
0b1559cf8d wasm gc: provide import function that returns JS exports container 2025-02-07 13:22:30 +01:00
Alexey Andreev
040b6f7ff6 wasm gc: use async method to instantiate module in order to support large wasm files 2025-02-07 13:05:12 +01:00
Alexey Andreev
196ac85da1 wasm gc: fix support of clone method of non-cloneable classes 2025-02-07 11:56:06 +01:00
Alexey Andreev
d9cac84056 wasm gc: fix bug in dependency analyzer 2025-02-07 11:33:14 +01:00
Alexey Andreev
a40c4a93f1 jso: support passing NIO buffers to JS 2025-02-06 18:45:18 +01:00
Alexey Andreev
aefc9dfedb wasm gc: implement direct NIO buffers over linear memory 2025-02-05 18:41:34 +01:00
Alexey Andreev
a13111efe5 Implement traditional heap (malloc/free) for use in direct NIO buffers implementation 2025-02-04 19:47:09 +01:00
Alexey Andreev
2192b3a846 classlib: add specialized implementation of NIO buffers for native backends 2025-02-01 17:18:59 +01:00
Alexey Andreev
7145ca70d9 js: initialize native exception immediately on construction of Java exception
Fix #1001
2025-01-26 18:36:05 +01:00
Alexey Andreev
5259e18f64 jso: support conversions between Java long and JS BigInt 2025-01-19 19:17:51 +01:00
scf37
a8fb7188d3
js: remove deprecated Long converions from the runtime (#993) 2025-01-08 11:01:57 +01:00
Alexey Andreev
447a16d4ee js: possibly fix issue with parameter/local variable names colliding with JS keywords
See #980
2024-12-07 16:32:25 +01:00
lax1dude
61e8c85d14
WASM: Intrinsify numberOfLeadingZeros, numberOfTrailingZeros, and bitCount (#978) 2024-12-03 21:29:36 +03:00
lax1dude
516602d32d
wasm gc: add support for string pools over 10000 strings (#977)
Due to limit in spec that allows `ref.array_new_fixed` to take up to 10000 arguments
2024-12-02 09:35:28 +01:00
Alexey Andreev
bf15f0e299 js: support writing debugger statement in JSBody
Fix #974
2024-11-30 19:26:11 +01:00
lax1dude
e4c32681b9
wasm gc: fix wrong argument order in System.arraycopy implementation (#975) 2024-11-30 18:53:59 +01:00
Alexey Andreev
f11a5474d0 wasm: use non-trapping conversion instructions when casting floats and doubles to ints and longs
Fix #976
2024-11-30 18:50:43 +01:00
Alexey Andreev
2e0864017b wasm gc: improve exception stack trace when exception is thrown from wasm and rethrown between Java and JS 2024-10-24 20:05:57 +02:00
Alexey Andreev
24d672e820 Fix support for multi-dimensional arrays of degree 3 and more in dependency analyzer 2024-10-24 18:28:28 +02:00
Alexey Andreev
ce862b9eaa wasm gc: support ReferenceQueue 2024-10-18 19:48:48 +02:00
Alexey Andreev
f3e035148d wasm gc: add support for importing modules in more cases 2024-10-17 20:18:56 +02:00