OSDN Git Service

Reuse HUseListNode<>s when replacing instruction or input.
authorVladimir Marko <vmarko@google.com>
Tue, 19 Apr 2016 13:36:35 +0000 (14:36 +0100)
committerVladimir Marko <vmarko@google.com>
Wed, 20 Apr 2016 16:16:26 +0000 (17:16 +0100)
commitfa7f58935491fad5cb8e5af9ee38d1a4f73e872d
tree8f16ba1822861e0ad37047f0bb10e7e60c8710f0
parentd59f3b1b7f5c1ab9f0731ff9dc60611e8d9a6ede
Reuse HUseListNode<>s when replacing instruction or input.

Compiling the Nexus 5 boot image with the 64-bit dex2oat
on host this CL reduces the memory used for compiling the
most hungry method, BatteryStats.dumpLocked(), by ~5.6MiB:

Before:
  MEM: used: 44393040, allocated: 45361248, lost: 968208
  Number of arenas allocated: 319,
  Number of allocations: 815492, avg size: 54
  ...
  UseListNode    10308480
  ...
After:
  MEM: used: 38554536, allocated: 39463008, lost: 908472
  Number of arenas allocated: 274,
  Number of allocations: 572221, avg size: 67
  ...
  UseListNode     4469976
  ...

With 32-bit dex2oat, the UseListNode would be 2/3 of the
values for 64-bit dex2oat (both before and after).

Bug: 28173563
Bug: 27856014

(cherry picked from commit 3c19d3e029a9fcc123d2c6fd1e5e13867d2cfe1f)

Change-Id: Iddd42d7545e4f97a13da63590b33711a5bbdd43b
compiler/optimizing/nodes.cc
compiler/optimizing/ssa_test.cc