summaryrefslogtreecommitdiffstats
path: root/compiler/dex/mir_graph.h
diff options
context:
space:
mode:
authorRazvan A Lupusoru <razvan.a.lupusoru@intel.com>2014-08-04 12:30:20 -0700
committerRazvan A Lupusoru <razvan.a.lupusoru@intel.com>2014-08-22 15:18:01 -0700
commitd04d309276a6d35b34ff9805de3754299bbde4a9 (patch)
tree8723bce0d565ed9f4f16a3bb41166712264a7b9a /compiler/dex/mir_graph.h
parent64d9da0ae817eaeb50e9fd8dd253fac32b3aaec9 (diff)
downloadart-d04d309276a6d35b34ff9805de3754299bbde4a9.tar.gz
art-d04d309276a6d35b34ff9805de3754299bbde4a9.tar.bz2
art-d04d309276a6d35b34ff9805de3754299bbde4a9.zip
ART: Support MIRGraph constant interface
-Adds a helper to be able to ask for a wide constant. -Allows MIRGraph to provide interface to set constants. Change-Id: Id282ee1604a0bd0bce6f495176d6bca35dcd5a00 Signed-off-by: Razvan A Lupusoru <razvan.a.lupusoru@intel.com>
Diffstat (limited to 'compiler/dex/mir_graph.h')
-rw-r--r--compiler/dex/mir_graph.h29
1 files changed, 27 insertions, 2 deletions
diff --git a/compiler/dex/mir_graph.h b/compiler/dex/mir_graph.h
index 491d72e9e8..3de4e3d0f9 100644
--- a/compiler/dex/mir_graph.h
+++ b/compiler/dex/mir_graph.h
@@ -724,12 +724,39 @@ class MIRGraph {
return constant_values_[s_reg];
}
+ /**
+ * @brief Used to obtain 64-bit value of a pair of ssa registers.
+ * @param s_reg_low The ssa register representing the low bits.
+ * @param s_reg_high The ssa register representing the high bits.
+ * @return Retusn the 64-bit constant value.
+ */
+ int64_t ConstantValueWide(int32_t s_reg_low, int32_t s_reg_high) const {
+ DCHECK(IsConst(s_reg_low));
+ DCHECK(IsConst(s_reg_high));
+ return (static_cast<int64_t>(constant_values_[s_reg_high]) << 32) |
+ Low32Bits(static_cast<int64_t>(constant_values_[s_reg_low]));
+ }
+
int64_t ConstantValueWide(RegLocation loc) const {
DCHECK(IsConst(loc));
return (static_cast<int64_t>(constant_values_[loc.orig_sreg + 1]) << 32) |
Low32Bits(static_cast<int64_t>(constant_values_[loc.orig_sreg]));
}
+ /**
+ * @brief Used to mark ssa register as being constant.
+ * @param ssa_reg The ssa register.
+ * @param value The constant value of ssa register.
+ */
+ void SetConstant(int32_t ssa_reg, int32_t value);
+
+ /**
+ * @brief Used to mark ssa register and its wide counter-part as being constant.
+ * @param ssa_reg The ssa register.
+ * @param value The 64-bit constant value of ssa register and its pair.
+ */
+ void SetConstantWide(int32_t ssa_reg, int64_t value);
+
bool IsConstantNullRef(RegLocation loc) const {
return loc.ref && loc.is_const && (ConstantValue(loc) == 0);
}
@@ -1114,8 +1141,6 @@ class MIRGraph {
void MarkPreOrder(BasicBlock* bb);
void RecordDFSOrders(BasicBlock* bb);
void ComputeDomPostOrderTraversal(BasicBlock* bb);
- void SetConstant(int32_t ssa_reg, int value);
- void SetConstantWide(int ssa_reg, int64_t value);
int GetSSAUseCount(int s_reg);
bool BasicBlockOpt(BasicBlock* bb);
bool BuildExtendedBBList(struct BasicBlock* bb);