Skip card mark when storing known null reference
We don't need to mark the gc card if storing a null reference.
Change-Id: I445db196a097ed92b67b8bf1e6b486c6fac7d08f
diff --git a/src/compiler/codegen/gen_common.cc b/src/compiler/codegen/gen_common.cc
index a4c8d0c..40ec2bf 100644
--- a/src/compiler/codegen/gen_common.cc
+++ b/src/compiler/codegen/gen_common.cc
@@ -425,7 +425,7 @@
if (is_volatile) {
GenMemBarrier(cu, kStoreLoad);
}
- if (is_object) {
+ if (is_object && !IsConstantNullRef(cu, rl_src)) {
MarkGCCard(cu, rl_src.low_reg, rBase);
}
FreeTemp(cu, rBase);
@@ -766,7 +766,7 @@
if (is_volatile) {
GenMemBarrier(cu, kLoadLoad);
}
- if (is_object) {
+ if (is_object && !IsConstantNullRef(cu, rl_src)) {
MarkGCCard(cu, rl_src.low_reg, rl_obj.low_reg);
}
}