summaryrefslogtreecommitdiffstats
path: root/compiler/dex/quick/codegen_util.cc
diff options
context:
space:
mode:
authorMathieu Chartier <mathieuc@google.com>2013-08-29 18:46:00 -0700
committerMathieu Chartier <mathieuc@google.com>2013-09-03 17:44:20 -0700
commit193bad9b9cfd10642043fa2ebbfc68bd5f9ede4b (patch)
tree0fc125adc74316df802b76889a780decd5b8236b /compiler/dex/quick/codegen_util.cc
parent179486aee731f734207873244542993ed4bcff21 (diff)
downloadandroid_art-193bad9b9cfd10642043fa2ebbfc68bd5f9ede4b.tar.gz
android_art-193bad9b9cfd10642043fa2ebbfc68bd5f9ede4b.tar.bz2
android_art-193bad9b9cfd10642043fa2ebbfc68bd5f9ede4b.zip
Multi threaded hashed deduplication during compilation.
Moved deduplication to be in the compiler driver instead of oat writer. This enables deduplication to be performed on multiple threads. Also added a hash function to avoid excessive comparison of byte arrays. Improvements: Before (alloats host): real 1m6.967s user 4m22.940s sys 1m22.610s Thinkfree.apk (target mako): 0m23.74s real 0m50.95s user 0m9.50s system 0m24.62s real 0m50.61s user 0m10.07s system 0m24.22s real 0m51.44s user 0m10.09s system 0m23.70s real 0m51.05s user 0m9.97s system 0m23.50s real 0m50.74s user 0m10.63s system After (alloats host): real 1m5.705s user 4m44.030s sys 1m29.990s Thinkfree.apk (target mako): 0m23.32s real 0m51.38s user 0m10.00s system 0m23.49s real 0m51.20s user 0m9.80s system 0m23.18s real 0m50.80s user 0m9.77s system 0m23.52s real 0m51.22s user 0m10.02s system 0m23.50s real 0m51.55s user 0m9.46s system Bug: 10552630 Change-Id: Ia6d06a747b86b0bfc4473b3cd68f8ce1a1c7eb22
Diffstat (limited to 'compiler/dex/quick/codegen_util.cc')
-rw-r--r--compiler/dex/quick/codegen_util.cc13
1 files changed, 6 insertions, 7 deletions
diff --git a/compiler/dex/quick/codegen_util.cc b/compiler/dex/quick/codegen_util.cc
index d89f1ed227..e081c16bb5 100644
--- a/compiler/dex/quick/codegen_util.cc
+++ b/compiler/dex/quick/codegen_util.cc
@@ -1004,7 +1004,7 @@ CompiledMethod* Mir2Lir::GetCompiledMethod() {
std::vector<uint16_t> raw_vmap_table;
// Core regs may have been inserted out of order - sort first
std::sort(core_vmap_table_.begin(), core_vmap_table_.end());
- for (size_t i = 0 ; i < core_vmap_table_.size(); i++) {
+ for (size_t i = 0 ; i < core_vmap_table_.size(); ++i) {
// Copy, stripping out the phys register sort key
raw_vmap_table.push_back(~(-1 << VREG_NUM_WIDTH) & core_vmap_table_[i]);
}
@@ -1022,14 +1022,13 @@ CompiledMethod* Mir2Lir::GetCompiledMethod() {
UnsignedLeb128EncodingVector vmap_encoder;
// Prefix the encoded data with its size.
vmap_encoder.PushBack(raw_vmap_table.size());
- typedef std::vector<uint16_t>::const_iterator It;
- for (It cur = raw_vmap_table.begin(), end = raw_vmap_table.end(); cur != end; ++cur) {
- vmap_encoder.PushBack(*cur);
+ for (uint16_t cur : raw_vmap_table) {
+ vmap_encoder.PushBack(cur);
}
CompiledMethod* result =
- new CompiledMethod(cu_->instruction_set, code_buffer_,
- frame_size_, core_spill_mask_, fp_spill_mask_,
- encoded_mapping_table_.GetData(), vmap_encoder.GetData(), native_gc_map_);
+ new CompiledMethod(*cu_->compiler_driver, cu_->instruction_set, code_buffer_, frame_size_,
+ core_spill_mask_, fp_spill_mask_, encoded_mapping_table_.GetData(),
+ vmap_encoder.GetData(), native_gc_map_);
return result;
}