summaryrefslogtreecommitdiffstats
path: root/runtime/transaction.h
diff options
context:
space:
mode:
authorFred Shih <ffred@google.com>2014-07-16 18:38:08 -0700
committerFred Shih <ffred@google.com>2014-08-25 11:16:53 -0700
commit37f05ef45e0393de812d51261dc293240c17294d (patch)
tree7c7793862efa52e1deb42babbdcb652c245ab941 /runtime/transaction.h
parente25826e28ea65d9c1aa23f84788a091c677b20c7 (diff)
downloadart-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/transaction.h')
-rw-r--r--runtime/transaction.h21
1 files changed, 21 insertions, 0 deletions
diff --git a/runtime/transaction.h b/runtime/transaction.h
index 7859126..6390049 100644
--- a/runtime/transaction.h
+++ b/runtime/transaction.h
@@ -41,6 +41,18 @@ class Transaction {
~Transaction();
// Record object field changes.
+ void RecordWriteFieldBoolean(mirror::Object* obj, MemberOffset field_offset, uint8_t value,
+ bool is_volatile)
+ LOCKS_EXCLUDED(log_lock_);
+ void RecordWriteFieldByte(mirror::Object* obj, MemberOffset field_offset, int8_t value,
+ bool is_volatile)
+ LOCKS_EXCLUDED(log_lock_);
+ void RecordWriteFieldChar(mirror::Object* obj, MemberOffset field_offset, uint16_t value,
+ bool is_volatile)
+ LOCKS_EXCLUDED(log_lock_);
+ void RecordWriteFieldShort(mirror::Object* obj, MemberOffset field_offset, int16_t value,
+ bool is_volatile)
+ LOCKS_EXCLUDED(log_lock_);
void RecordWriteField32(mirror::Object* obj, MemberOffset field_offset, uint32_t value,
bool is_volatile)
LOCKS_EXCLUDED(log_lock_);
@@ -82,6 +94,10 @@ class Transaction {
private:
class ObjectLog {
public:
+ void LogBooleanValue(MemberOffset offset, uint8_t value, bool is_volatile);
+ void LogByteValue(MemberOffset offset, int8_t value, bool is_volatile);
+ void LogCharValue(MemberOffset offset, uint16_t value, bool is_volatile);
+ void LogShortValue(MemberOffset offset, int16_t value, bool is_volatile);
void Log32BitsValue(MemberOffset offset, uint32_t value, bool is_volatile);
void Log64BitsValue(MemberOffset offset, uint64_t value, bool is_volatile);
void LogReferenceValue(MemberOffset offset, mirror::Object* obj, bool is_volatile);
@@ -95,6 +111,10 @@ class Transaction {
private:
enum FieldValueKind {
+ kBoolean,
+ kByte,
+ kChar,
+ kShort,
k32Bits,
k64Bits,
kReference
@@ -106,6 +126,7 @@ class Transaction {
bool is_volatile;
};
+ void LogValue(FieldValueKind kind, MemberOffset offset, uint64_t value, bool is_volatile);
void UndoFieldWrite(mirror::Object* obj, MemberOffset field_offset,
const FieldValue& field_value) SHARED_LOCKS_REQUIRED(Locks::mutator_lock_);