summaryrefslogtreecommitdiff
path: root/compiler/optimizing/nodes_shared.h
diff options
context:
space:
mode:
author Roland Levillain <rpl@google.com> 2016-09-19 16:59:14 +0000
committer Gerrit Code Review <noreply-gerritcodereview@google.com> 2016-09-19 16:59:15 +0000
commitec88abde5944eaa94e1299cc2ec040b51977b1f4 (patch)
treec3692184a4999b97ee36decf88c688786640e598 /compiler/optimizing/nodes_shared.h
parent8cb366a7ba8f02094c7c3bd21e217fff52f6ad17 (diff)
parent91a6516103b8bf8bb75c3a2840cbdec7521e74a7 (diff)
Merge "Remove the `CanTriggerGC` side-effects on a few instructions."
Diffstat (limited to 'compiler/optimizing/nodes_shared.h')
-rw-r--r--compiler/optimizing/nodes_shared.h7
1 files changed, 6 insertions, 1 deletions
diff --git a/compiler/optimizing/nodes_shared.h b/compiler/optimizing/nodes_shared.h
index ff9b5e9cfd..814202e97b 100644
--- a/compiler/optimizing/nodes_shared.h
+++ b/compiler/optimizing/nodes_shared.h
@@ -122,10 +122,15 @@ class HBitwiseNegatedRight FINAL : public HBinaryOperation {
// This instruction computes an intermediate address pointing in the 'middle' of an object. The
// result pointer cannot be handled by GC, so extra care is taken to make sure that this value is
// never used across anything that can trigger GC.
+// The result of this instruction is not a pointer in the sense of `Primitive::kPrimNot`. So we
+// represent it by the type `Primitive::kPrimInt`.
class HIntermediateAddress FINAL : public HExpression<2> {
public:
HIntermediateAddress(HInstruction* base_address, HInstruction* offset, uint32_t dex_pc)
- : HExpression(Primitive::kPrimNot, SideEffects::DependsOnGC(), dex_pc) {
+ : HExpression(Primitive::kPrimInt, SideEffects::DependsOnGC(), dex_pc) {
+ DCHECK_EQ(Primitive::ComponentSize(Primitive::kPrimInt),
+ Primitive::ComponentSize(Primitive::kPrimNot))
+ << "kPrimInt and kPrimNot have different sizes.";
SetRawInputAt(0, base_address);
SetRawInputAt(1, offset);
}