OSDN Git Service

Avoid excessive spill slots for slow paths.
authorVladimir Marko <vmarko@google.com>
Tue, 9 Aug 2016 10:04:26 +0000 (11:04 +0100)
committerVladimir Marko <vmarko@google.com>
Mon, 5 Sep 2016 16:27:41 +0000 (17:27 +0100)
commit70e97462116a47ef2e582ea29a037847debcc029
treeee587e35b9b9483c35875ccc8ddea139978ca823
parent521691ae4dfad47cf6b46858347fa5fa32fd7bcc
Avoid excessive spill slots for slow paths.

Reducing the frame size makes stack maps smaller as we need
fewer bits for stack masks and some dex register locations
may use short location kind rather than long. On Nexus 9,
AOSP ToT, the boot.oat size reduction is
  prebuilt multi-part boot image:
    - 32-bit boot.oat: -416KiB (-0.6%)
    - 64-bit boot.oat: -635KiB (-0.9%)
  prebuilt multi-part boot image with read barrier:
    - 32-bit boot.oat: -483KiB (-0.7%)
    - 64-bit boot.oat: -703KiB (-0.9%)
  on-device built single boot image:
    - 32-bit boot.oat: -380KiB (-0.6%)
    - 64-bit boot.oat: -632KiB (-0.9%)
  on-device built single boot image with read barrier:
    - 32-bit boot.oat: -448KiB (-0.6%)
    - 64-bit boot.oat: -692KiB (-0.9%)

The other benefit is that at runtime, threads may need fewer
pages for their stacks, reducing overall memory usage.

We defer the calculation of the maximum spill size from
the main register allocator (linear scan or graph coloring)
to the RegisterAllocationResolver and do it based on the
live registers at slow path safepoints. The old notion of
an artificial slow path safepoint interval is removed as
it is no longer needed.

Test: Run ART test suite on host and Nexus 9.
Bug: 30212852
Change-Id: I40b3d114e278e2c5807982904fa49bf6642c6275
21 files changed:
compiler/optimizing/code_generator.cc
compiler/optimizing/code_generator.h
compiler/optimizing/code_generator_arm.cc
compiler/optimizing/code_generator_arm64.cc
compiler/optimizing/code_generator_mips.cc
compiler/optimizing/code_generator_mips64.cc
compiler/optimizing/code_generator_x86.cc
compiler/optimizing/code_generator_x86_64.cc
compiler/optimizing/intrinsics_arm.cc
compiler/optimizing/intrinsics_arm64.cc
compiler/optimizing/intrinsics_x86.cc
compiler/optimizing/intrinsics_x86_64.cc
compiler/optimizing/locations.cc
compiler/optimizing/locations.h
compiler/optimizing/register_allocation_resolver.cc
compiler/optimizing/register_allocation_resolver.h
compiler/optimizing/register_allocator_graph_color.cc
compiler/optimizing/register_allocator_graph_color.h
compiler/optimizing/register_allocator_linear_scan.cc
compiler/optimizing/register_allocator_linear_scan.h
compiler/optimizing/ssa_liveness_analysis.h