Commit Graph

25 Commits

Author SHA1 Message Date
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
81cc3c156e Add optimization that eliminates repeated access to fields 2019-10-30 16:09:17 +03:00
Alexey Andreev
3c8184c3b7 Fix bug in nullness analysis when variable graph has irreducible loops 2019-01-14 14:08:12 +03:00
Alexey Andreev
e77997c93f Implement null check in C backend
Although initial purpose of this comment was null check,
it took much time to complete it and it caused many unrelated changes.
Besides just implementing null check in quite naive fashion
(I could not use the trick with memory protection, since I have to
maintain shadow stack, and support WebAssembly), I had to optimize
things. I relied on my existing nullness analysis to eliminate
as much null checks as possible. However, the whole nullness analysis
was wrong. After some thoughts I came up with solution very
close to range analysis, which required me to introduce extension
to IR sometimes called e-SSA form with so called sigma nodes.
Also, I found some bugs in few different places (by the time write this
message I could only remember escape analysis/scalar replacement and
after-inlining devirtualization) and fixed them.
2018-04-17 00:05:46 +03:00
Alexey Andreev
c54b2b9e9e Fix bug in escape analysis 2017-10-29 19:08:25 +03:00
Alexey Andreev
4b6193baca Fix bug in escape analysis. See #271 2017-05-08 18:44:58 +03:00
Alexey Andreev
a94686ddf6 Fix nullness detection on exception variable 2017-02-25 19:52:05 +03:00
Alexey Andreev
d3bed47b1d Add tests for escape analysis/scalar replacement. Fix found bugs 2017-01-21 23:34:33 +03:00
Alexey Andreev
6781dd0abb Fix bug in nullness analysis 2017-01-18 21:30:04 +03:00
Alexey Andreev
ff059919a7 Eliminate exception joint in favour of phi functions with multiple inputs per source basic block 2017-01-08 23:43:12 +03:00
Alexey Andreev
9532f9a32b Refactor phi updater 2017-01-06 21:13:12 +03:00
Alexey Andreev
a5eb9ac800 Add tests for phi updater 2017-01-04 22:09:56 +03:00
Alexey Andreev
aef1e2e206 Fixing bugs in nullness analyzer 2017-01-02 16:55:17 +03:00
Alexey Andreev
5fd95f21cb Refactor nullness tests 2017-01-02 13:28:35 +03:00
Alexey Andreev
9dc4b47253 Add nullness analysis 2016-12-27 00:28:37 +03:00
Alexey Andreev
7ca6a4d64e Add IR parser of catch blocks 2016-12-04 19:47:10 +03:00
Alexey Andreev
6883b59fc3 Add IR parser of field get/set and switch instructions 2016-12-04 19:47:10 +03:00
Alexey Andreev
6084491119 Add IR parser of different simple instructions 2016-12-04 19:47:10 +03:00
Alexey Andreev
2b94a8b05c Add IR parser of cast instructions 2016-12-04 19:47:09 +03:00
Alexey Andreev
825acfc85a Add IR parser of invoke instructions 2016-12-04 19:47:09 +03:00
Alexey Andreev
c16de76b23 Add IR parser of constant instructions 2016-12-04 19:47:09 +03:00
Alexey Andreev
f6308c1782 Add IR parser of binary operations and phi functions 2016-12-04 19:47:09 +03:00
Alexey Andreev
6148d7a943 Add support of branching instructions to listing parser 2016-12-04 19:47:09 +03:00
Alexey Andreev
e5db8d4afc Add support of goto and return instructions to textual IR parser 2016-12-04 19:47:09 +03:00
Alexey Andreev
93f8c2cf39 Creating textual IR parser 2016-12-04 19:47:09 +03:00