OSDN Git Service

ART: Move exception clearing into own instruction
authorDavid Brazdil <dbrazdil@google.com>
Tue, 4 Aug 2015 15:22:25 +0000 (16:22 +0100)
committerDavid Brazdil <dbrazdil@google.com>
Tue, 4 Aug 2015 15:39:38 +0000 (16:39 +0100)
commitcb1c0557033065f2436ee79e7fa6c19d87064801
tree741b623b2e370a133b5cef9feed2542151186db6
parente238414eee3ec933a4ceb1894666c9ef331ace0c
ART: Move exception clearing into own instruction

Runtime delivers exceptions only to catch blocks which begin with a
MOVE_EXCEPTION instruction (in DEX). In that case, the catch block is
expected to clear the thread-local exception storage after having
read the exception reference.

This patch changes Optimizing to represent MOVE_EXCEPTION with two
instructions - HLoadException and HClearException - instead of one.
If the exception reference is not used, HLoadException can be safely
removed, saving a memory load without breaking the runtime behaviour.

Change-Id: Idad8a714467bf9d9d5fccefbc43c0bd8ae13ddba
compiler/optimizing/builder.cc
compiler/optimizing/code_generator_arm.cc
compiler/optimizing/code_generator_arm64.cc
compiler/optimizing/code_generator_mips64.cc
compiler/optimizing/code_generator_x86.cc
compiler/optimizing/code_generator_x86_64.cc
compiler/optimizing/nodes.h