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.h54
1 files changed, 37 insertions, 17 deletions
diff --git a/compiler/optimizing/builder.h b/compiler/optimizing/builder.h
index ad5d92345b..b0238dc5f8 100644
--- a/compiler/optimizing/builder.h
+++ b/compiler/optimizing/builder.h
@@ -40,7 +40,8 @@ class HGraphBuilder : public ValueObject {
const DexFile* dex_file,
CompilerDriver* driver,
OptimizingCompilerStats* compiler_stats,
- const uint8_t* interpreter_metadata)
+ const uint8_t* interpreter_metadata,
+ Handle<mirror::DexCache> dex_cache)
: arena_(graph->GetArena()),
branch_targets_(graph->GetArena(), 0),
locals_(graph->GetArena(), 0),
@@ -57,7 +58,8 @@ class HGraphBuilder : public ValueObject {
latest_result_(nullptr),
can_use_baseline_for_string_init_(true),
compilation_stats_(compiler_stats),
- interpreter_metadata_(interpreter_metadata) {}
+ interpreter_metadata_(interpreter_metadata),
+ dex_cache_(dex_cache) {}
// Only for unit testing.
HGraphBuilder(HGraph* graph, Primitive::Type return_type = Primitive::kPrimInt)
@@ -76,7 +78,9 @@ class HGraphBuilder : public ValueObject {
code_start_(nullptr),
latest_result_(nullptr),
can_use_baseline_for_string_init_(true),
- compilation_stats_(nullptr) {}
+ compilation_stats_(nullptr),
+ interpreter_metadata_(nullptr),
+ dex_cache_(NullHandle<mirror::DexCache>()) {}
bool BuildGraph(const DexFile::CodeItem& code);
@@ -127,23 +131,20 @@ class HGraphBuilder : public ValueObject {
void InitializeLocals(uint16_t count);
HLocal* GetLocalAt(int register_index) const;
- void UpdateLocal(int register_index, HInstruction* instruction) const;
- HInstruction* LoadLocal(int register_index, Primitive::Type type) 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;
void PotentiallyAddSuspendCheck(HBasicBlock* target, uint32_t dex_pc);
void InitializeParameters(uint16_t number_of_parameters);
bool NeedsAccessCheck(uint32_t type_index) const;
template<typename T>
- void Unop_12x(const Instruction& instruction, Primitive::Type type);
-
- template<typename T>
- void Binop_23x(const Instruction& instruction, Primitive::Type type);
+ void Unop_12x(const Instruction& instruction, Primitive::Type type, uint32_t dex_pc);
template<typename T>
void Binop_23x(const Instruction& instruction, Primitive::Type type, uint32_t dex_pc);
template<typename T>
- void Binop_23x_shift(const Instruction& instruction, Primitive::Type type);
+ void Binop_23x_shift(const Instruction& instruction, Primitive::Type type, uint32_t dex_pc);
void Binop_23x_cmp(const Instruction& instruction,
Primitive::Type type,
@@ -151,19 +152,16 @@ class HGraphBuilder : public ValueObject {
uint32_t dex_pc);
template<typename T>
- void Binop_12x(const Instruction& instruction, Primitive::Type type);
-
- template<typename T>
void Binop_12x(const Instruction& instruction, Primitive::Type type, uint32_t dex_pc);
template<typename T>
- void Binop_12x_shift(const Instruction& instruction, Primitive::Type type);
+ void Binop_12x_shift(const Instruction& instruction, Primitive::Type type, uint32_t dex_pc);
template<typename T>
- void Binop_22b(const Instruction& instruction, bool reverse);
+ void Binop_22b(const Instruction& instruction, bool reverse, uint32_t dex_pc);
template<typename T>
- void Binop_22s(const Instruction& instruction, bool reverse);
+ void Binop_22s(const Instruction& instruction, bool reverse, uint32_t dex_pc);
template<typename T> void If_21t(const Instruction& instruction, uint32_t dex_pc);
template<typename T> void If_22t(const Instruction& instruction, uint32_t dex_pc);
@@ -181,7 +179,7 @@ class HGraphBuilder : public ValueObject {
bool second_is_lit,
bool is_div);
- void BuildReturn(const Instruction& instruction, Primitive::Type type);
+ void BuildReturn(const Instruction& instruction, Primitive::Type type, uint32_t dex_pc);
// Builds an instance field access node and returns whether the instruction is supported.
bool BuildInstanceFieldAccess(const Instruction& instruction, uint32_t dex_pc, bool is_put);
@@ -266,6 +264,25 @@ class HGraphBuilder : public ValueObject {
uint32_t dex_pc,
HInvoke* invoke);
+ HInvokeStaticOrDirect::DispatchInfo ComputeDispatchInfo(bool is_string_init,
+ int32_t string_init_offset,
+ MethodReference target_method,
+ uintptr_t direct_method,
+ uintptr_t direct_code);
+
+ bool SetupArgumentsAndAddInvoke(HInvoke* invoke,
+ uint32_t number_of_vreg_arguments,
+ uint32_t* args,
+ uint32_t register_index,
+ bool is_range,
+ const char* descriptor,
+ HClinitCheck* clinit_check);
+
+ HClinitCheck* ProcessClinitCheckForInvoke(
+ uint32_t dex_pc,
+ uint32_t method_idx,
+ HInvokeStaticOrDirect::ClinitCheckRequirement* clinit_check_requirement);
+
ArenaAllocator* const arena_;
// A list of the size of the dex code holding block information for
@@ -314,6 +331,9 @@ class HGraphBuilder : public ValueObject {
const uint8_t* interpreter_metadata_;
+ // Dex cache for dex_file_.
+ Handle<mirror::DexCache> dex_cache_;
+
DISALLOW_COPY_AND_ASSIGN(HGraphBuilder);
};