summaryrefslogtreecommitdiff
path: root/runtime/class_status.h
diff options
context:
space:
mode:
author Igor Murashkin <iam@google.com> 2017-10-27 10:59:04 -0700
committer Igor Murashkin <iam@google.com> 2017-11-07 14:47:51 -0800
commit86083f7cd118f3d6c757191e83b4e4abaabdc5d7 (patch)
tree8e5b81ae0d09d41bfd90284a1b6b16b2332435e5 /runtime/class_status.h
parent495e783c9180c3fc033ce459ee0a783e633f7754 (diff)
runtime: Bitstring implementation for subtype checking (4/4).
Integrate the previous CLs into ART Runtime. Subsequent CLs to add optimizing compiler support. Use spare 24-bits from "Class#status_" field to implement faster subtype checking in the runtime. Does not incur any extra memory overhead, and (when in compiled code) this is always as fast or faster than the original check. The new subtype checking is O(1) of the form: src <: target := (*src).status >> #imm_target_mask == #imm_target_shifted Based on the original prototype CL by Zhengkai Wu: https://android-review.googlesource.com/#/c/platform/art/+/440996/ Test: art/test.py -b -j32 --host Bug: 64692057 Change-Id: Iec3c54af529055a7f6147eebe5611d9ecd46942b
Diffstat (limited to 'runtime/class_status.h')
-rw-r--r--runtime/class_status.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/runtime/class_status.h b/runtime/class_status.h
index 0877e68818..7f2ef6a09d 100644
--- a/runtime/class_status.h
+++ b/runtime/class_status.h
@@ -18,6 +18,7 @@
#define ART_RUNTIME_CLASS_STATUS_H_
#include <iosfwd>
+#include <stdint.h>
namespace art {
@@ -70,7 +71,7 @@ namespace art {
// again at runtime.
//
// TODO: Explain the other states
-enum ClassStatus {
+enum ClassStatus : int8_t {
kStatusRetired = -3, // Retired, should not be used. Use the newly cloned one instead.
kStatusErrorResolved = -2,
kStatusErrorUnresolved = -1,