summaryrefslogtreecommitdiff
path: root/compiler/optimizing/nodes.cc
diff options
context:
space:
mode:
author Vladimir Marko <vmarko@google.com> 2016-02-25 11:37:38 +0000
committer Vladimir Marko <vmarko@google.com> 2016-02-26 16:01:59 +0000
commita1de9188a05afdecca8cd04ecc4fefbac8b9880f (patch)
treea671c8aef814ccf194e5c3950a551f2711516c53 /compiler/optimizing/nodes.cc
parent950d063395c7cecbbe372fd607468018d661a35c (diff)
Optimizing: Reduce memory usage of HInstructions.
Pack narrow fields and flags into a single 32-bit field. Change-Id: Ib2f7abf987caee0339018d21f0d498f8db63542d
Diffstat (limited to 'compiler/optimizing/nodes.cc')
-rw-r--r--compiler/optimizing/nodes.cc11
1 files changed, 5 insertions, 6 deletions
diff --git a/compiler/optimizing/nodes.cc b/compiler/optimizing/nodes.cc
index f9acb089ee..27a5b97f5f 100644
--- a/compiler/optimizing/nodes.cc
+++ b/compiler/optimizing/nodes.cc
@@ -2206,7 +2206,8 @@ void HInstruction::SetReferenceTypeInfo(ReferenceTypeInfo rti) {
CheckAgainstUpperBound(rti, AsBoundType()->GetUpperBound());
}
}
- reference_type_info_ = rti;
+ reference_type_handle_ = rti.GetTypeHandle();
+ SetPackedFlag<kFlagReferenceTypeIsExact>(rti.IsExact());
}
void HBoundType::SetUpperBound(const ReferenceTypeInfo& upper_bound, bool can_be_null) {
@@ -2217,17 +2218,15 @@ void HBoundType::SetUpperBound(const ReferenceTypeInfo& upper_bound, bool can_be
CheckAgainstUpperBound(GetReferenceTypeInfo(), upper_bound);
}
upper_bound_ = upper_bound;
- upper_can_be_null_ = can_be_null;
+ SetPackedFlag<kFlagUpperCanBeNull>(can_be_null);
}
-ReferenceTypeInfo::ReferenceTypeInfo() : type_handle_(TypeHandle()), is_exact_(false) {}
-
-ReferenceTypeInfo::ReferenceTypeInfo(TypeHandle type_handle, bool is_exact)
- : type_handle_(type_handle), is_exact_(is_exact) {
+ReferenceTypeInfo ReferenceTypeInfo::Create(TypeHandle type_handle, bool is_exact) {
if (kIsDebugBuild) {
ScopedObjectAccess soa(Thread::Current());
DCHECK(IsValidHandle(type_handle));
}
+ return ReferenceTypeInfo(type_handle, is_exact);
}
std::ostream& operator<<(std::ostream& os, const ReferenceTypeInfo& rhs) {