Add class flags to class to help GC scanning
Reduces GC time and pauses by reducing the number of loads required
to scan an object.
Average total GC time before on EvaluateAndApplyChanges (EAAC): 7.452s
After: 7.144s
Average GC pause times before on EAAC: 860.67us
After: 722.75us
Adding the class flags field cause a memory increase of ~24k system
wide on low memory devices.
Change-Id: I3f04212d5787bfbf5e55026584d149f55476105e
diff --git a/runtime/modifiers.h b/runtime/modifiers.h
index 0d9ec29..f7ab10b 100644
--- a/runtime/modifiers.h
+++ b/runtime/modifiers.h
@@ -19,6 +19,8 @@
#include <stdint.h>
+namespace art {
+
static constexpr uint32_t kAccPublic = 0x0001; // class, field, method, ic
static constexpr uint32_t kAccPrivate = 0x0002; // field, method, ic
static constexpr uint32_t kAccProtected = 0x0004; // field, method, ic
@@ -49,28 +51,8 @@
static constexpr uint32_t kAccMiranda = 0x00200000; // method (dex only)
// Special runtime-only flags.
-// Note: if only kAccClassIsReference is set, we have a soft reference.
-
-// class is ClassLoader or one of its subclasses
-static constexpr uint32_t kAccClassIsClassLoaderClass = 0x10000000;
-
// class/ancestor overrides finalize()
static constexpr uint32_t kAccClassIsFinalizable = 0x80000000;
-// class is a soft/weak/phantom ref
-static constexpr uint32_t kAccClassIsReference = 0x08000000;
-// class is a weak reference
-static constexpr uint32_t kAccClassIsWeakReference = 0x04000000;
-// class is a finalizer reference
-static constexpr uint32_t kAccClassIsFinalizerReference = 0x02000000;
-// class is a phantom reference
-static constexpr uint32_t kAccClassIsPhantomReference = 0x01000000;
-// class is the string class
-static constexpr uint32_t kAccClassIsStringClass = 0x00800000;
-
-static constexpr uint32_t kAccReferenceFlagsMask = (kAccClassIsReference
- | kAccClassIsWeakReference
- | kAccClassIsFinalizerReference
- | kAccClassIsPhantomReference);
// Valid (meaningful) bits for a field.
static constexpr uint32_t kAccValidFieldFlags = kAccPublic | kAccPrivate | kAccProtected |
@@ -95,5 +77,7 @@
static constexpr uint32_t kAccValidInterfaceFlags = kAccPublic | kAccInterface |
kAccAbstract | kAccSynthetic | kAccAnnotation;
+} // namespace art
+
#endif // ART_RUNTIME_MODIFIERS_H_