summaryrefslogtreecommitdiff
path: root/compiler/optimizing/builder.h
diff options
context:
space:
mode:
Diffstat (limited to 'compiler/optimizing/builder.h')
-rw-r--r--compiler/optimizing/builder.h34
1 files changed, 17 insertions, 17 deletions
diff --git a/compiler/optimizing/builder.h b/compiler/optimizing/builder.h
index 7f87df6df2..4c8e3d0442 100644
--- a/compiler/optimizing/builder.h
+++ b/compiler/optimizing/builder.h
@@ -17,6 +17,7 @@
#ifndef ART_COMPILER_OPTIMIZING_BUILDER_H_
#define ART_COMPILER_OPTIMIZING_BUILDER_H_
+#include "base/arena_containers.h"
#include "base/arena_object.h"
#include "dex_file.h"
#include "dex_file-inl.h"
@@ -24,7 +25,6 @@
#include "driver/dex_compilation_unit.h"
#include "optimizing_compiler_stats.h"
#include "primitive.h"
-#include "utils/growable_array.h"
#include "nodes.h"
namespace art {
@@ -43,8 +43,8 @@ class HGraphBuilder : public ValueObject {
const uint8_t* interpreter_metadata,
Handle<mirror::DexCache> dex_cache)
: arena_(graph->GetArena()),
- branch_targets_(graph->GetArena(), 0),
- locals_(graph->GetArena(), 0),
+ branch_targets_(graph->GetArena()->Adapter(kArenaAllocGraphBuilder)),
+ locals_(graph->GetArena()->Adapter(kArenaAllocGraphBuilder)),
entry_block_(nullptr),
exit_block_(nullptr),
current_block_(nullptr),
@@ -64,8 +64,8 @@ class HGraphBuilder : public ValueObject {
// Only for unit testing.
HGraphBuilder(HGraph* graph, Primitive::Type return_type = Primitive::kPrimInt)
: arena_(graph->GetArena()),
- branch_targets_(graph->GetArena(), 0),
- locals_(graph->GetArena(), 0),
+ branch_targets_(graph->GetArena()->Adapter(kArenaAllocGraphBuilder)),
+ locals_(graph->GetArena()->Adapter(kArenaAllocGraphBuilder)),
entry_block_(nullptr),
exit_block_(nullptr),
current_block_(nullptr),
@@ -121,21 +121,21 @@ class HGraphBuilder : public ValueObject {
// instructions and links them to the corresponding catch blocks.
void InsertTryBoundaryBlocks(const DexFile::CodeItem& code_item);
- // Splits a single edge, inserting a TryBoundary of given `kind` and linking
- // it to exception handlers of `try_item`.
- void SplitTryBoundaryEdge(HBasicBlock* predecessor,
- HBasicBlock* successor,
- HTryBoundary::BoundaryKind kind,
- const DexFile::CodeItem& code_item,
- const DexFile::TryItem& try_item);
+ // Iterates over the exception handlers of `try_item`, finds the corresponding
+ // catch blocks and makes them successors of `try_boundary`. The order of
+ // successors matches the order in which runtime exception delivery searches
+ // for a handler.
+ void LinkToCatchBlocks(HTryBoundary* try_boundary,
+ const DexFile::CodeItem& code_item,
+ const DexFile::TryItem* try_item);
bool CanDecodeQuickenedInfo() const;
uint16_t LookupQuickenedInfo(uint32_t dex_pc);
void InitializeLocals(uint16_t count);
- HLocal* GetLocalAt(int register_index) const;
- void UpdateLocal(int register_index, HInstruction* instruction, uint32_t dex_pc) const;
- HInstruction* LoadLocal(int register_index, Primitive::Type type, uint32_t dex_pc) const;
+ HLocal* GetLocalAt(uint32_t register_index) const;
+ void UpdateLocal(uint32_t register_index, HInstruction* instruction, uint32_t dex_pc) const;
+ HInstruction* LoadLocal(uint32_t register_index, Primitive::Type type, uint32_t dex_pc) const;
void PotentiallyAddSuspendCheck(HBasicBlock* target, uint32_t dex_pc);
void InitializeParameters(uint16_t number_of_parameters);
bool NeedsAccessCheck(uint32_t type_index) const;
@@ -313,9 +313,9 @@ class HGraphBuilder : public ValueObject {
// 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_;
+ ArenaVector<HBasicBlock*> branch_targets_;
- GrowableArray<HLocal*> locals_;
+ ArenaVector<HLocal*> locals_;
HBasicBlock* entry_block_;
HBasicBlock* exit_block_;