OSDN Git Service

Quick compiler: Fix handling of unused returns
authorbuzbee <buzbee@google.com>
Sun, 7 Sep 2014 18:37:51 +0000 (11:37 -0700)
committerbuzbee <buzbee@google.com>
Mon, 8 Sep 2014 04:21:24 +0000 (21:21 -0700)
commit90a21f8e76028b9f89e91c436fc6fe9e9a354694
tree6772cee165531f6f6d09f8f14e54243694f5c877
parent9b868cbfa6d74387a80ce52a426f9a5bc3ddbbaf
Quick compiler: Fix handling of unused returns

As part of the inlining process, the quick compiler will attempt
to eliminate MOVE_RESULT instructions and deliver the result of
the inlined function directly to the eventual use.

The type of the returned value is determined by the subsequent
use (which had already been typed via the size and type
inference pass).  However, if a method result is never used the code
just defaulted to assigning dummy core sink register[s].  This
caused a DCHECK failure on some 64-bit systems for methods returning
an unused reference (although the generated code was correct).

This CL selects sink registers for the unused return case based
on the type of the inlined method, and adds another DCHECK to
verify that the result of the size & type inference pass matches
with the inlined method's type.

Internal b/17328561

Change-Id: I9803ad604fe1bdcf9ff9a1d310cf022a7b6deae2
compiler/dex/quick/gen_invoke.cc