summaryrefslogtreecommitdiff
path: root/compiler/optimizing/ssa_builder.h
diff options
context:
space:
mode:
authorDavid Brazdil <dbrazdil@google.com>2016-02-16 09:26:07 +0000
committerDavid Brazdil <dbrazdil@google.com>2016-04-04 11:21:20 +0100
commit86ea7eeabe30c98bbe1651a51d03cb89776724e7 (patch)
tree01702f6df5c39925b354a3152dd04289e7d97062 /compiler/optimizing/ssa_builder.h
parent0cb5c86b7021e70cbf584c1455aad1ef383af786 (diff)
Build dominator tree before generating HInstructions
Second CL in the series of merging HGraphBuilder and SsaBuilder. This patch refactors the builders so that dominator tree can be built before any HInstructions are generated. This puts the SsaBuilder removal of HLoadLocals/HStoreLocals straight after HGraphBuilder's HInstruction generation phase. Next CL will therefore be able to merge them. This patch also adds util classes for iterating bytecode and switch tables which allowed to simplify the code. Bug: 27894376 Change-Id: Ic425d298b2e6e7980481ed697230b1a0b7904526
Diffstat (limited to 'compiler/optimizing/ssa_builder.h')
-rw-r--r--compiler/optimizing/ssa_builder.h8
1 files changed, 7 insertions, 1 deletions
diff --git a/compiler/optimizing/ssa_builder.h b/compiler/optimizing/ssa_builder.h
index 2dae9c2de0..83da3781b4 100644
--- a/compiler/optimizing/ssa_builder.h
+++ b/compiler/optimizing/ssa_builder.h
@@ -49,8 +49,9 @@ static constexpr int kDefaultNumberOfLoops = 2;
*/
class SsaBuilder : public HGraphVisitor {
public:
- SsaBuilder(HGraph* graph, StackHandleScopeCollection* handles)
+ SsaBuilder(HGraph* graph, const DexFile::CodeItem& code_item, StackHandleScopeCollection* handles)
: HGraphVisitor(graph),
+ code_item_(code_item),
handles_(handles),
agets_fixed_(false),
current_locals_(nullptr),
@@ -105,6 +106,11 @@ class SsaBuilder : public HGraphVisitor {
void RemoveRedundantUninitializedStrings();
+ // Returns whether `instruction` is the first generated HInstruction for its
+ // dex_pc position.
+ bool IsFirstAtThrowingDexPc(HInstruction* instruction) const;
+
+ const DexFile::CodeItem& code_item_;
StackHandleScopeCollection* const handles_;
// True if types of ambiguous ArrayGets have been resolved.