summaryrefslogtreecommitdiff
path: root/compiler/optimizing/code_generator.h
diff options
context:
space:
mode:
author Nicolas Geoffray <ngeoffray@google.com> 2014-11-12 18:08:09 +0000
committer Nicolas Geoffray <ngeoffray@google.com> 2014-11-14 13:45:02 +0000
commitaf07bc121121d7bd7e8329c55dfe24782207b561 (patch)
tree51e93225aa77c3949a63104f8d48e4b6f6fb2b5b /compiler/optimizing/code_generator.h
parentd0d805bad888857fe974142cbf3292b9747daae3 (diff)
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
Diffstat (limited to 'compiler/optimizing/code_generator.h')
-rw-r--r--compiler/optimizing/code_generator.h9
1 files changed, 9 insertions, 0 deletions
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<kArenaAllocMisc> {
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,