summaryrefslogtreecommitdiff
path: root/compiler
diff options
context:
space:
mode:
Diffstat (limited to 'compiler')
-rw-r--r--compiler/optimizing/code_generator_x86.cc4
-rw-r--r--compiler/optimizing/instruction_simplifier.cc4
2 files changed, 6 insertions, 2 deletions
diff --git a/compiler/optimizing/code_generator_x86.cc b/compiler/optimizing/code_generator_x86.cc
index 6c82fe99c7..931d751db0 100644
--- a/compiler/optimizing/code_generator_x86.cc
+++ b/compiler/optimizing/code_generator_x86.cc
@@ -3856,7 +3856,7 @@ void InstructionCodeGeneratorX86::VisitArraySet(HArraySet* instruction) {
} else {
DCHECK(value.IsConstant()) << value;
__ movl(Address(obj, offset),
- Immediate(value.GetConstant()->AsIntConstant()->GetValue()));
+ Immediate(CodeGenerator::GetInt32ValueOf(value.GetConstant())));
}
} else {
DCHECK(index.IsRegister()) << index;
@@ -3866,7 +3866,7 @@ void InstructionCodeGeneratorX86::VisitArraySet(HArraySet* instruction) {
} else {
DCHECK(value.IsConstant()) << value;
__ movl(Address(obj, index.AsRegister<Register>(), TIMES_4, data_offset),
- Immediate(value.GetConstant()->AsIntConstant()->GetValue()));
+ Immediate(CodeGenerator::GetInt32ValueOf(value.GetConstant())));
}
}
codegen_->MaybeRecordImplicitNullCheck(instruction);
diff --git a/compiler/optimizing/instruction_simplifier.cc b/compiler/optimizing/instruction_simplifier.cc
index e375f7b1d3..62f90c2f5e 100644
--- a/compiler/optimizing/instruction_simplifier.cc
+++ b/compiler/optimizing/instruction_simplifier.cc
@@ -398,6 +398,10 @@ void InstructionSimplifierVisitor::VisitArraySet(HArraySet* instruction) {
}
}
+ if (value->IsNullConstant()) {
+ instruction->ClearNeedsTypeCheck();
+ }
+
if (!value->CanBeNull()) {
instruction->ClearValueCanBeNull();
}