From 3cd4fc8bbb40a57d2ffde85f543c124f53237c1d Mon Sep 17 00:00:00 2001 From: Calin Juravle Date: Thu, 14 May 2015 15:15:42 +0100 Subject: Eliminate redundant constructor barriers when inlining. Bug: 20410297 Change-Id: I2097743d00eb795d050d390b1918e38c7f41d506 --- compiler/optimizing/nodes.h | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'compiler/optimizing/nodes.h') diff --git a/compiler/optimizing/nodes.h b/compiler/optimizing/nodes.h index cb2e5ccab4..0291992cab 100644 --- a/compiler/optimizing/nodes.h +++ b/compiler/optimizing/nodes.h @@ -120,6 +120,7 @@ class HGraph : public ArenaObject { HGraph(ArenaAllocator* arena, const DexFile& dex_file, uint32_t method_idx, + bool should_generate_constructor_barrier, bool debuggable = false, int start_instruction_id = 0) : arena_(arena), @@ -137,6 +138,7 @@ class HGraph : public ArenaObject { current_instruction_id_(start_instruction_id), dex_file_(dex_file), method_idx_(method_idx), + should_generate_constructor_barrier_(should_generate_constructor_barrier), cached_null_constant_(nullptr), cached_int_constants_(std::less(), arena->Adapter()), cached_float_constants_(std::less(), arena->Adapter()), @@ -247,6 +249,10 @@ class HGraph : public ArenaObject { has_bounds_checks_ = value; } + bool ShouldGenerateConstructorBarrier() const { + return should_generate_constructor_barrier_; + } + bool IsDebuggable() const { return debuggable_; } // Returns a constant of the given type and value. If it does not exist @@ -359,6 +365,8 @@ class HGraph : public ArenaObject { // The method index in the dex file. const uint32_t method_idx_; + const bool should_generate_constructor_barrier_; + // Cached constants. HNullConstant* cached_null_constant_; ArenaSafeMap cached_int_constants_; @@ -2902,6 +2910,8 @@ class HParameterValue : public HExpression<0> { bool CanBeNull() const OVERRIDE { return !is_this_; } + bool IsThis() const { return is_this_; } + DECLARE_INSTRUCTION(ParameterValue); private: -- cgit v1.2.3-59-g8ed1b