summaryrefslogtreecommitdiffstats
path: root/compiler/optimizing/builder.h
diff options
context:
space:
mode:
authorCalin Juravle <calin@google.com>2014-12-09 18:11:36 +0000
committerCalin Juravle <calin@google.com>2014-12-10 16:27:08 +0000
commit48c2b03965830c73cdddeae8aea8030f08430137 (patch)
tree56cf034739095c71a175fa97205ed6dc76efbe0d /compiler/optimizing/builder.h
parentd2ec87d84057174d4884ee16f652cbcfd31362e9 (diff)
downloadandroid_art-48c2b03965830c73cdddeae8aea8030f08430137.tar.gz
android_art-48c2b03965830c73cdddeae8aea8030f08430137.tar.bz2
android_art-48c2b03965830c73cdddeae8aea8030f08430137.zip
Add more compilation stats to optimizing
Optimizing is getting closer to have full coverage and this provides a nice overview on why certain methods are not compiled/optimized. Also, clean up some of the builder methods. Change-Id: Id2f31441a788b797b0efea7ec78bee27bb654186
Diffstat (limited to 'compiler/optimizing/builder.h')
-rw-r--r--compiler/optimizing/builder.h22
1 files changed, 17 insertions, 5 deletions
diff --git a/compiler/optimizing/builder.h b/compiler/optimizing/builder.h
index 73c2f50958..75c8634ea3 100644
--- a/compiler/optimizing/builder.h
+++ b/compiler/optimizing/builder.h
@@ -21,6 +21,7 @@
#include "dex_file-inl.h"
#include "driver/compiler_driver.h"
#include "driver/dex_compilation_unit.h"
+#include "optimizing_compiler_stats.h"
#include "primitive.h"
#include "utils/arena_object.h"
#include "utils/growable_array.h"
@@ -36,7 +37,8 @@ class HGraphBuilder : public ValueObject {
HGraphBuilder(ArenaAllocator* arena,
DexCompilationUnit* dex_compilation_unit,
const DexFile* dex_file,
- CompilerDriver* driver)
+ CompilerDriver* driver,
+ OptimizingCompilerStats* compiler_stats)
: arena_(arena),
branch_targets_(arena, 0),
locals_(arena, 0),
@@ -51,7 +53,8 @@ class HGraphBuilder : public ValueObject {
compiler_driver_(driver),
return_type_(Primitive::GetType(dex_compilation_unit_->GetShorty()[0])),
code_start_(nullptr),
- latest_result_(nullptr) {}
+ latest_result_(nullptr),
+ compilation_stats_(compiler_stats) {}
// Only for unit testing.
HGraphBuilder(ArenaAllocator* arena, Primitive::Type return_type = Primitive::kPrimInt)
@@ -69,7 +72,8 @@ class HGraphBuilder : public ValueObject {
compiler_driver_(nullptr),
return_type_(return_type),
code_start_(nullptr),
- latest_result_(nullptr) {}
+ latest_result_(nullptr),
+ compilation_stats_(nullptr) {}
HGraph* BuildGraph(const DexFile::CodeItem& code);
@@ -205,16 +209,22 @@ class HGraphBuilder : public ValueObject {
uint32_t dex_pc);
// Builds an instruction sequence for a packed switch statement.
- bool BuildPackedSwitch(const Instruction& instruction, uint32_t dex_pc);
+ void BuildPackedSwitch(const Instruction& instruction, uint32_t dex_pc);
// Builds an instruction sequence for a sparse switch statement.
- bool BuildSparseSwitch(const Instruction& instruction, uint32_t dex_pc);
+ void BuildSparseSwitch(const Instruction& instruction, uint32_t dex_pc);
void BuildSwitchCaseHelper(const Instruction& instruction, size_t index,
bool is_last_case, const SwitchTable& table,
HInstruction* value, int32_t case_value_int,
int32_t target_offset, uint32_t dex_pc);
+ bool SkipCompilation(size_t number_of_dex_instructions,
+ size_t number_of_blocks,
+ size_t number_of_branches);
+
+ void MaybeRecordStat(MethodCompilationStat compilation_stat);
+
ArenaAllocator* const arena_;
// A list of the size of the dex code holding block information for
@@ -245,6 +255,8 @@ class HGraphBuilder : public ValueObject {
// used by move-result instructions.
HInstruction* latest_result_;
+ OptimizingCompilerStats* compilation_stats_;
+
DISALLOW_COPY_AND_ASSIGN(HGraphBuilder);
};