Commit Graph

725 Commits

Author SHA1 Message Date
Alexey Andreev
e4c808c324 Add switch to log devirtualization process 2021-02-26 12:26:13 +03:00
Alexey Andreev
0eca9d95e1 Fix missing virtual call detector 2021-02-26 11:52:10 +03:00
Alexey Andreev
d1fa57210e Copy parameter annotations when renaming a class 2021-02-01 14:41:18 +03:00
Alexey Andreev
969ad17b6a C: workaround for regression in MSVC compiler 2020-11-27 18:54:24 +03:00
Octavia Togami
a8641de39b
Correct problem severity for warning 2020-11-26 14:59:13 +03:00
Alexey Andreev
306c78459c JS: use symbol instead of string property to represent Java exception wrapper 2020-09-09 19:28:32 +03:00
Alexey Andreev
17098495f2 JS: fix compilation of class files that contain methods and field names containing non-identifier characters 2020-07-06 12:11:17 +03:00
Alexey Andreev
9cf21825fc Fix wrong evaluation when optimizer sees array initialization that looks like array initializer expression, but has access to array variable on its elements, i.e. on a case like this:
Object[] array = new Object[1];
array[0] = array;

That can't be optimized to

Object[] array = new Object[] { array };
2020-06-16 19:24:45 +03:00
Alexey Andreev
5ee332c771 Fix crash when lambda is not used. Fix #500 2020-06-01 12:19:37 +03:00
Alexey Andreev
6f7c2dff2b Fix copying source files in simple optimization mode. Fix #501 2020-06-01 12:07:42 +03:00
Alexey Andreev
ecc4be2d25 Fix class initialization optimization 2020-05-19 13:27:26 +03:00
Alexey Andreev
eebe16157b C: further workaround for msvc bug 2020-05-19 09:56:47 +03:00
Alexey Andreev
8f68c64193 Fix bug in repeated field read elimination.
There's a case that was missing in this optimization. We install invalidation
points on a block's dominance frontiers when the block contains som
invalidation instructions. However, if a block is an entry to exception
handler, state is always invalidated. This should be done
since exception handler may recover and proceed with some code that
follows try/catch block. Without this change code after try/catch inherits
state of `try` block, which is invalid, since `catch` is another
source from where we can get there. We can't rely on regular instruction
analysis in `catch` blocks, since we get into `catch` from an unpredictable
point.
2020-05-18 17:24:21 +03:00
Alexey Andreev
333ee95604 C: in addition to deece78dec
Fix generation of heap dump metadata
2020-05-15 18:05:50 +03:00
Alexey Andreev
deece78dec C: workaround msvc C1054 error while compiling virtual table initializers of classes with deep inheritance hierarchy 2020-05-15 17:55:26 +03:00
Alexey Andreev
862e9b846f Exclude all classes from underlying JDK 2020-05-14 16:59:21 +03:00
Alexey Andreev
6a4da94f2e Get rid of irreducible CFGs in input bytecode 2020-05-14 16:18:33 +03:00
Alexey Andreev
4284bb2a6c C: fix naming when bytecode contains method names with special characters 2020-05-14 14:31:48 +03:00
Alexey Andreev
7313b2bb62 Don't fail on environments that miss console object in global scope 2020-04-30 16:06:54 +03:00
Alexey Andreev
1232f20ae4 Add protection against exception fall though one Java machine running another Java machine.
When one TeaVM program calls `eval` and code passed to eval is itself generated
with TeaVM, the inner code can throw uncaught Java exception. The outer code could
try to catch this exception as a native JavaScript exception, but this is not possible,
since the exception is marked as Java exception, and inner scripts's Java class
does not inherit java.lang.Throwable of outer script. The solution for each script
to generate own tag (Symbol) and only treat JS exception as Java exception when
this exception has this tag.
2020-04-30 16:05:24 +03:00
Alexey Andreev
a9e7e51c51 Properly support non-ASCII characters in System.out and System.err 2020-04-30 14:49:33 +03:00
Adam J Ryan
e0fc5d834b Add ability to fine tune transpiler class substitutions. 2020-04-01 19:32:34 +03:00
Alexey Andreev
a152a28a2d C: fix bug in array initializers 2020-03-04 11:37:04 +03:00
Alexey Andreev
37f07b80c3 JS: generate shorter names for Long operations and array creation in minified mode 2020-03-04 13:23:19 +03:00
Alexey Andreev
3ff05d1c5d Eliminate redundant try/catches in generated bytecode for enums 2020-03-04 12:14:25 +03:00
Alexey Andreev
37e6ca3e17 Recognize array initialization pattern in bytecode and translate it to array initializer in target platform 2020-03-03 18:34:48 +03:00
Alexey Andreev
2ad5baaccc JS: don't write single return statement 2020-03-03 15:01:33 +03:00
Alexey Andreev
eb3490dba0 Improve inlining 2020-03-03 14:34:27 +03:00
Alexey Andreev
146776ff55 JS: reduce size of declaration of classes without fields 2020-03-03 12:47:06 +03:00
Alexey Andreev
c1891a1908 Further work on decreasing generated code size 2020-03-03 12:17:39 +03:00
Alexey Andreev
ea1134d66b Trying to reduce number of classes for which name is provided in their metadata 2020-03-02 16:36:09 +03:00
Alexey Andreev
81235ac714 JS: reduce size of wrapped virtual methods 2020-03-02 11:50:45 +03:00
Alexey Andreev
8d1eb3fcc6 Better optimization of <clinit> when reading other's class static final fields 2020-03-02 11:23:58 +03:00
Alexey Andreev
2f95045345 Improve optimization of unused methods that were inlined on every usage 2020-02-28 14:42:51 +03:00
Alexey Andreev
150a613709 C/Wasm: trying to fix GC (again) 2020-02-26 14:51:40 +03:00
Alexey Andreev
84aa50e7eb C/Wasm: trying to fix GC 2020-02-26 14:38:01 +03:00
Alexey Andreev
0e7c1e5ef9 Wasm: don't generate class metadata if it's not used. Don't generate names and call site metadata in minified mode 2020-02-21 17:29:31 +03:00
Alexey Andreev
3f2c52000f Wasm: support null checks and array bound checks 2020-02-21 16:32:45 +03:00
Alexey Andreev
c35861610f Wasm: support null checks and array bound checks 2020-02-21 16:32:00 +03:00
Alexey Andreev
7d95c0fb04 Wasm: fix GC 2020-02-21 16:22:25 +03:00
Alexey Andreev
d76eeb9be3 Improve <clinit> elimination. Improve inlining in ADVANCED optimization mode 2020-02-14 12:46:57 +03:00
Alexey Andreev
fecdd6613a Use tab character to indent stack traces 2020-02-14 10:39:50 +03:00
Alexey Andreev
289bfc9488 C: fix Function.get when getting function from different class 2020-02-10 19:52:17 +03:00
Alexey Andreev
a414a7979c Fix NPE 2020-02-10 17:08:25 +03:00
Alexey Andreev
3b1dae4412 Fix <clinit> elimination in case of native methods 2020-02-10 16:37:32 +03:00
Alexey Andreev
8cba925a89 C: fix bug in deobfuscator 2020-02-04 17:37:00 +03:00
Alexey Andreev
f4ec4872c5 C: fix crash when creating stack trace triggers GC 2020-02-04 14:25:22 +03:00
Alexey Andreev
45d36eac83 C: fix crash on GC when there are queued WeakReference instances in the heap
When performing young GC, we can encounter some WeakReferences which get into
corresponding ReferenceQueue. In this case queue internal state will be updated.
After it defragmentation phase runs which updates references to relocated objects.
For performance reason, defragmentation phase scans only regions either
marked with write barriers or regions that contain surviving objects in
young generation. However, sometimes a queue can be in neither of these sets,
so we additionally mark regions containing all affected queues.
2020-01-31 18:23:50 +03:00
Alexey Andreev
374f7c6634 C: allow to define custom logging functions. Use unified logging function within VM 2020-01-30 18:18:16 +03:00
Alexey Andreev
f13a7e6375 C: fix Strings.fromC/fromC16 methods 2020-01-30 15:41:37 +03:00