From 736b560f2d2c89b63dc895888c671b5519afa4c8 Mon Sep 17 00:00:00 2001 From: Mathieu Chartier Date: Wed, 2 Sep 2015 14:54:11 -0700 Subject: Reduce how often we call FindDexCache Before host boot.oat -j4 optimizing compile: real 1m17.792s user 3m26.140s sys 0m8.340s After: real 1m12.324s user 3m22.718s sys 0m8.320s Change-Id: If18e9e79e06cdf1676692e5efacb682bf93889c3 --- compiler/optimizing/builder.h | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'compiler/optimizing/builder.h') diff --git a/compiler/optimizing/builder.h b/compiler/optimizing/builder.h index d6b25ee822..560ed86e50 100644 --- a/compiler/optimizing/builder.h +++ b/compiler/optimizing/builder.h @@ -40,7 +40,8 @@ class HGraphBuilder : public ValueObject { const DexFile* dex_file, CompilerDriver* driver, OptimizingCompilerStats* compiler_stats, - const uint8_t* interpreter_metadata) + const uint8_t* interpreter_metadata, + Handle dex_cache) : arena_(graph->GetArena()), branch_targets_(graph->GetArena(), 0), locals_(graph->GetArena(), 0), @@ -57,7 +58,8 @@ class HGraphBuilder : public ValueObject { latest_result_(nullptr), can_use_baseline_for_string_init_(true), compilation_stats_(compiler_stats), - interpreter_metadata_(interpreter_metadata) {} + interpreter_metadata_(interpreter_metadata), + dex_cache_(dex_cache) {} // Only for unit testing. HGraphBuilder(HGraph* graph, Primitive::Type return_type = Primitive::kPrimInt) @@ -77,7 +79,8 @@ class HGraphBuilder : public ValueObject { latest_result_(nullptr), can_use_baseline_for_string_init_(true), compilation_stats_(nullptr), - interpreter_metadata_(nullptr) {} + interpreter_metadata_(nullptr), + dex_cache_(NullHandle()) {} bool BuildGraph(const DexFile::CodeItem& code); @@ -334,6 +337,9 @@ class HGraphBuilder : public ValueObject { const uint8_t* interpreter_metadata_; + // Dex cache for dex_file_. + Handle dex_cache_; + DISALLOW_COPY_AND_ASSIGN(HGraphBuilder); }; -- cgit v1.2.3-59-g8ed1b