7ac10da795
If a NumberConstant can be represented as a Smi, then lower it to a IntPtrConstant node during simplified lowering. Thanks to this, all backends can match Smi values that can also be encoded as immediates in the instruction selector. Additionally, we can apply the same lowering to the CodeAssembler for the snapshot. As a result, we can remove `mov` instructions generated because Int32Matcher and Int64Matcher didn't not recognize Smis: For 32-bit target, it's common for Smis also be immediates: "if (a < 100) {}" ~~~ mov r1, #200 -> cmp r0, #200 cmp r0, r1 -> blt <> blt <> -> ~~~ On Arm64 particularly, we lose opportunites to use `cbz`: "if (a == 0) {}" ~~~ movz x0, #0x0 -> cbz x1 <> cmp x1, x0 -> b.eq <> -> ~~~ Overall, we do not see an impact on benchmarks such as webtooling. However, we do see noteworthy code size reduction, from 0.5% to 1.5%. Bug: Change-Id: I7fbb718ad51b9036c3514fa31c1326bdd6f2b0e6 Reviewed-on: https://chromium-review.googlesource.com/848814 Reviewed-by: Jaroslav Sevcik <jarin@chromium.org> Reviewed-by: Benedikt Meurer <bmeurer@chromium.org> Commit-Queue: Pierre Langlois <pierre.langlois@arm.com> Cr-Commit-Position: refs/heads/master@{#50569} |
||
---|---|---|
.. | ||
benchmarks | ||
cctest | ||
common | ||
debugger | ||
fuzzer | ||
inspector | ||
intl | ||
js-perf-test | ||
memory | ||
message | ||
mjsunit | ||
mkgrokdump | ||
mozilla | ||
preparser | ||
test262 | ||
unittests | ||
wasm-spec-tests | ||
webkit | ||
bot_default.gyp | ||
bot_default.isolate | ||
BUILD.gn | ||
d8_default.gyp | ||
d8_default.isolate | ||
default.gyp | ||
default.isolate | ||
optimize_for_size.gyp | ||
optimize_for_size.isolate | ||
perf.gyp | ||
perf.isolate |