From af07bc121121d7bd7e8329c55dfe24782207b561 Mon Sep 17 00:00:00 2001 From: Nicolas Geoffray Date: Wed, 12 Nov 2014 18:08:09 +0000 Subject: Minor object store optimizations. - Avoid emitting write barrier when the value is null. - Do not do a typecheck on an arraystore when storing something that was loaded from the same array. Change-Id: I902492928692e4553b5af0fc99cce3c2186c442a --- compiler/optimizing/code_generator.h | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'compiler/optimizing/code_generator.h') diff --git a/compiler/optimizing/code_generator.h b/compiler/optimizing/code_generator.h index ac4fc67c2c..a046ade929 100644 --- a/compiler/optimizing/code_generator.h +++ b/compiler/optimizing/code_generator.h @@ -168,6 +168,15 @@ class CodeGenerator : public ArenaObject { void EmitParallelMoves(Location from1, Location to1, Location from2, Location to2); + static bool StoreNeedsWriteBarrier(Primitive::Type type, HInstruction* value) { + if (kIsDebugBuild) { + if (type == Primitive::kPrimNot && value->IsIntConstant()) { + CHECK(value->AsIntConstant()->GetValue() == 0); + } + } + return type == Primitive::kPrimNot && !value->IsIntConstant(); + } + protected: CodeGenerator(HGraph* graph, size_t number_of_core_registers, -- cgit v1.2.3-59-g8ed1b