summaryrefslogtreecommitdiff
path: root/compiler/optimizing/builder.h
diff options
context:
space:
mode:
author Mathieu Chartier <mathieuc@google.com> 2015-09-02 14:54:11 -0700
committer Mathieu Chartier <mathieuc@google.com> 2015-09-03 13:27:19 -0700
commit736b560f2d2c89b63dc895888c671b5519afa4c8 (patch)
treed5aee7ac36f458a5f6e6d75fceb19f8963a71db5 /compiler/optimizing/builder.h
parentfe3879e6011f629d0dd6b04fab00b9496bd4ea08 (diff)
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
Diffstat (limited to 'compiler/optimizing/builder.h')
-rw-r--r--compiler/optimizing/builder.h12
1 files changed, 9 insertions, 3 deletions
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<mirror::DexCache> 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<mirror::DexCache>()) {}
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<mirror::DexCache> dex_cache_;
+
DISALLOW_COPY_AND_ASSIGN(HGraphBuilder);
};