diff options
| author | 2014-02-26 14:01:05 +0000 | |
|---|---|---|
| committer | 2014-02-26 14:01:06 +0000 | |
| commit | 504e6997501aa19c7e7973e70f187314af95602c (patch) | |
| tree | 7314b38ad594ac1360861a62c574ee8e5d892233 /compiler/optimizing/builder.h | |
| parent | ef2cc5a9c6e508a3e8b24d04ca35f7422f27e112 (diff) | |
| parent | be9a92aa804c0d210f80966b74ef8ed3987f335a (diff) | |
Merge "Add conditional branches, and build dominator tree."
Diffstat (limited to 'compiler/optimizing/builder.h')
| -rw-r--r-- | compiler/optimizing/builder.h | 16 | 
1 files changed, 15 insertions, 1 deletions
diff --git a/compiler/optimizing/builder.h b/compiler/optimizing/builder.h index 3e94fba228..fbeb7a7dab 100644 --- a/compiler/optimizing/builder.h +++ b/compiler/optimizing/builder.h @@ -18,6 +18,7 @@  #define ART_COMPILER_OPTIMIZING_BUILDER_H_  #include "utils/allocation.h" +#include "utils/growable_array.h"  namespace art { @@ -30,6 +31,7 @@ class HGraphBuilder : public ValueObject {   public:    explicit HGraphBuilder(ArenaAllocator* arena)        : arena_(arena), +        branch_targets_(arena, 0),          entry_block_(nullptr),          exit_block_(nullptr),          current_block_(nullptr), @@ -41,9 +43,21 @@ class HGraphBuilder : public ValueObject {    // Analyzes the dex instruction and adds HInstruction to the graph    // to execute that instruction. Returns whether the instruction can    // be handled. -  bool AnalyzeDexInstruction(const Instruction& instruction); +  bool AnalyzeDexInstruction(const Instruction& instruction, int32_t dex_offset); + +  // Finds all instructions that start a new block, and populates branch_targets_ with +  // the newly created blocks. +  void ComputeBranchTargets(const uint16_t* start, const uint16_t* end); +  void MaybeUpdateCurrentBlock(size_t index); +  HBasicBlock* FindBlockStartingAt(int32_t index) const;    ArenaAllocator* const arena_; + +  // A list of the size of the dex code holding block information for +  // the method. If an entry contains a block, then the dex instruction +  // starting at that entry is the first instruction of a new block. +  GrowableArray<HBasicBlock*> branch_targets_; +    HBasicBlock* entry_block_;    HBasicBlock* exit_block_;    HBasicBlock* current_block_;  |