summaryrefslogtreecommitdiff
path: root/runtime/stack.h
diff options
context:
space:
mode:
author Mingyao Yang <mingyao@google.com> 2016-08-02 11:02:54 -0700
committer Mingyao Yang <mingyao@google.com> 2016-12-01 11:15:47 -0800
commit063fc772b5b8aed7d769cd7cccb6ddc7619326ee (patch)
treebc165781989087a998721991504e589a7d5b0926 /runtime/stack.h
parent48d08a4233ee4450b0d5073d41445f9dd1f17191 (diff)
Class Hierarchy Analysis (CHA)
The class linker now tracks whether a method has a single implementation and if so, the JIT compiler will try to devirtualize a virtual call for the method into a direct call. If the single-implementation assumption is violated due to additional class linking, compiled code that makes the assumption is invalidated. Deoptimization is triggered for compiled code live on stack. Instead of patching return pc's on stack, a CHA guard is added which checks a hidden should_deoptimize flag for deoptimization. This approach limits the number of deoptimization points. This CL does not devirtualize abstract/interface method invocation. Slides on CHA: https://docs.google.com/a/google.com/presentation/d/1Ax6cabP1vM44aLOaJU3B26n5fTE9w5YU-1CRevIDsBc/edit?usp=sharing Change-Id: I18bf716a601b6413b46312e925a6ad9e4008efa4 Test: ART_TEST_JIT=true m test-art-host/target-run-test test-art-host-gtest
Diffstat (limited to 'runtime/stack.h')
-rw-r--r--runtime/stack.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/runtime/stack.h b/runtime/stack.h
index e879214c75..d02e4b71d1 100644
--- a/runtime/stack.h
+++ b/runtime/stack.h
@@ -66,6 +66,11 @@ std::ostream& operator<<(std::ostream& os, const VRegKind& rhs);
struct ShadowFrameDeleter;
using ShadowFrameAllocaUniquePtr = std::unique_ptr<ShadowFrame, ShadowFrameDeleter>;
+// Size in bytes of the should_deoptimize flag on stack.
+// We just need 4 bytes for our purpose regardless of the architecture. Frame size
+// calculation will automatically do alignment for the final frame size.
+static constexpr size_t kShouldDeoptimizeFlagSize = 4;
+
// Counting locks by storing object pointers into a vector. Duplicate entries mark recursive locks.
// The vector will be visited with the ShadowFrame during GC (so all the locked-on objects are
// thread roots).