diff options
author | 2023-03-31 16:04:22 +0100 | |
---|---|---|
committer | 2023-04-03 16:50:40 +0000 | |
commit | c63bdde13d9d2cd7f82fae590611e2ff7a77bc49 (patch) | |
tree | d905361d626944b5393ccdc6538bda6465576fa7 /compiler/utils/jni_macro_assembler.h | |
parent | 07798c2e898a8c3344cac123f9873a50ad2e075d (diff) |
Optimize String's length/isEmpty for constant strings
If at compile time we know the length of the string, we can insert
that constant into the graph.
As part of this CL, I introduced VisitArrayLength in
ConstantFolding. This is done because:
* We are folding the instrucion into a constant so it makes
logical sense, and
* It plays better with isEmpty since that's an ArrayLength+Equal
which can be dealt with in one ConstantFolding pass.
As a note, there's VisitArrayLength in InstructionSimplifier which
would make sense to also move to ConstantFolding. However, in doing
so we get code size regressions. Added a TODO to see if we can deal
with that in the future.
Locally speed-compiling in a Pixel 5:
* SystemServer: -4.38 KB (-0.01%)
* SystemUIGoogle: -23.92KB (-0.09%)
* AGSA: -217.66KB (-0.07%)
Bug: 276416001
Test: art/test/testrunner/testrunner.py --host --64 --optimizing -b
Change-Id: Ic2081d489482157b016762e0ec103319d3b9a46e
Diffstat (limited to 'compiler/utils/jni_macro_assembler.h')
0 files changed, 0 insertions, 0 deletions