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
diff --git a/compiler/dex/mir_analysis.cc b/compiler/dex/mir_analysis.cc
index 1cff8dc..39f8ee8 100644
--- a/compiler/dex/mir_analysis.cc
+++ b/compiler/dex/mir_analysis.cc
@@ -30,6 +30,7 @@
#include "driver/compiler_driver.h"
#include "driver/compiler_options.h"
#include "driver/dex_compilation_unit.h"
+#include "scoped_thread_state_change.h"
#include "utils.h"
namespace art {
@@ -1283,8 +1284,12 @@
ifield_lowering_infos_.push_back(
MirIFieldLoweringInfo(masked_field_idx, field_types[pos], is_quickened));
}
- MirIFieldLoweringInfo::Resolve(cu_->compiler_driver, GetCurrentDexCompilationUnit(),
- ifield_lowering_infos_.data(), ifield_pos);
+ ScopedObjectAccess soa(Thread::Current());
+ MirIFieldLoweringInfo::Resolve(soa,
+ cu_->compiler_driver,
+ GetCurrentDexCompilationUnit(),
+ ifield_lowering_infos_.data(),
+ ifield_pos);
}
if (sfield_pos != max_refs) {