diff options
Diffstat (limited to 'compiler/optimizing/block_builder.h')
-rw-r--r-- | compiler/optimizing/block_builder.h | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/compiler/optimizing/block_builder.h b/compiler/optimizing/block_builder.h index 1be0b4ce98..6adce815f4 100644 --- a/compiler/optimizing/block_builder.h +++ b/compiler/optimizing/block_builder.h @@ -37,7 +37,8 @@ class HBasicBlockBuilder : public ValueObject { nullptr, arena_->Adapter(kArenaAllocGraphBuilder)), throwing_blocks_(kDefaultNumberOfThrowingBlocks, arena_->Adapter(kArenaAllocGraphBuilder)), - number_of_branches_(0u) {} + number_of_branches_(0u), + quicken_index_for_dex_pc_(std::less<uint32_t>(), arena_->Adapter()) {} // Creates basic blocks in `graph_` at branch target dex_pc positions of the // `code_item_`. Blocks are connected but left unpopulated with instructions. @@ -48,6 +49,8 @@ class HBasicBlockBuilder : public ValueObject { size_t GetNumberOfBranches() const { return number_of_branches_; } HBasicBlock* GetBlockAt(uint32_t dex_pc) const { return branch_targets_[dex_pc]; } + size_t GetQuickenIndex(uint32_t dex_pc) const; + private: // Creates a basic block starting at given `dex_pc`. HBasicBlock* MaybeCreateBlockAt(uint32_t dex_pc); @@ -78,6 +81,9 @@ class HBasicBlockBuilder : public ValueObject { ArenaVector<HBasicBlock*> throwing_blocks_; size_t number_of_branches_; + // A table to quickly find the quicken index for the first instruction of a basic block. + ArenaSafeMap<uint32_t, uint32_t> quicken_index_for_dex_pc_; + static constexpr size_t kDefaultNumberOfThrowingBlocks = 2u; DISALLOW_COPY_AND_ASSIGN(HBasicBlockBuilder); |