diff options
author | Fred Shih <ffred@google.com> | 2014-07-16 18:38:08 -0700 |
---|---|---|
committer | Fred Shih <ffred@google.com> | 2014-08-25 11:16:53 -0700 |
commit | 37f05ef45e0393de812d51261dc293240c17294d (patch) | |
tree | 7c7793862efa52e1deb42babbdcb652c245ab941 /runtime/mirror/class.h | |
parent | e25826e28ea65d9c1aa23f84788a091c677b20c7 (diff) | |
download | art-37f05ef45e0393de812d51261dc293240c17294d.zip art-37f05ef45e0393de812d51261dc293240c17294d.tar.gz art-37f05ef45e0393de812d51261dc293240c17294d.tar.bz2 |
Reduced memory usage of primitive fields smaller than 4-bytes
Reduced memory used by byte and boolean fields from 4 bytes down to a
single byte and shorts and chars down to two bytes. Fields are now
arranged as Reference followed by decreasing component sizes, with
fields shuffled forward as needed.
Bug: 8135266
Change-Id: I65eaf31ed27e5bd5ba0c7d4606454b720b074752
Diffstat (limited to 'runtime/mirror/class.h')
-rw-r--r-- | runtime/mirror/class.h | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/runtime/mirror/class.h b/runtime/mirror/class.h index 81fbcab..0d30bc6 100644 --- a/runtime/mirror/class.h +++ b/runtime/mirror/class.h @@ -502,6 +502,8 @@ class MANAGED Class FINAL : public Object { // Compute how many bytes would be used a class with the given elements. static uint32_t ComputeClassSize(bool has_embedded_tables, uint32_t num_vtable_entries, + uint32_t num_8bit_static_fields, + uint32_t num_16bit_static_fields, uint32_t num_32bit_static_fields, uint32_t num_64bit_static_fields, uint32_t num_ref_static_fields); @@ -510,12 +512,12 @@ class MANAGED Class FINAL : public Object { static uint32_t ClassClassSize() { // The number of vtable entries in java.lang.Class. uint32_t vtable_entries = Object::kVTableLength + 64; - return ComputeClassSize(true, vtable_entries, 0, 1, 0); + return ComputeClassSize(true, vtable_entries, 0, 0, 0, 1, 0); } // The size of a java.lang.Class representing a primitive such as int.class. static uint32_t PrimitiveClassSize() { - return ComputeClassSize(false, 0, 0, 0, 0); + return ComputeClassSize(false, 0, 0, 0, 0, 0, 0); } template<VerifyObjectFlags kVerifyFlags = kDefaultVerifyFlags, |