summaryrefslogtreecommitdiff
path: root/compiler/optimizing/builder.h
diff options
context:
space:
mode:
author Nicolas Geoffray <ngeoffray@google.com> 2015-07-10 11:38:52 +0100
committer Nicolas Geoffray <ngeoffray@google.com> 2015-07-10 18:21:13 +0100
commit2e7cd752452d02499a2f5fbd604c5427aa372f00 (patch)
tree505527250317827f56378f4b786534793ccfbb61 /compiler/optimizing/builder.h
parentf16b820fc18ff86e765a14176f05417305d689a0 (diff)
[optimizing] Don't rely on the verifier for String.<init>.
Continue work on cutting the dependency on the verifier. Change-Id: I0f95b1eb2e10fd8f6bf54817f1202bdf6dfdb0fe
Diffstat (limited to 'compiler/optimizing/builder.h')
-rw-r--r--compiler/optimizing/builder.h15
1 files changed, 15 insertions, 0 deletions
diff --git a/compiler/optimizing/builder.h b/compiler/optimizing/builder.h
index 7098eb86a5..76610f5be2 100644
--- a/compiler/optimizing/builder.h
+++ b/compiler/optimizing/builder.h
@@ -54,6 +54,7 @@ class HGraphBuilder : public ValueObject {
return_type_(Primitive::GetType(dex_compilation_unit_->GetShorty()[0])),
code_start_(nullptr),
latest_result_(nullptr),
+ can_use_baseline_for_string_init_(true),
compilation_stats_(compiler_stats) {}
// Only for unit testing.
@@ -72,10 +73,15 @@ class HGraphBuilder : public ValueObject {
return_type_(return_type),
code_start_(nullptr),
latest_result_(nullptr),
+ can_use_baseline_for_string_init_(true),
compilation_stats_(nullptr) {}
bool BuildGraph(const DexFile::CodeItem& code);
+ bool CanUseBaselineForStringInit() const {
+ return can_use_baseline_for_string_init_;
+ }
+
static constexpr const char* kBuilderPassName = "builder";
private:
@@ -251,6 +257,10 @@ class HGraphBuilder : public ValueObject {
// Returns whether `type_index` points to the outer-most compiling method's class.
bool IsOutermostCompilingClass(uint16_t type_index) const;
+ void PotentiallySimplifyFakeString(uint16_t original_dex_register,
+ uint32_t dex_pc,
+ HInvoke* invoke);
+
ArenaAllocator* const arena_;
// A list of the size of the dex code holding block information for
@@ -290,6 +300,11 @@ class HGraphBuilder : public ValueObject {
// used by move-result instructions.
HInstruction* latest_result_;
+ // We need to know whether we have built a graph that has calls to StringFactory
+ // and hasn't gone through the verifier. If the following flag is `false`, then
+ // we cannot compile with baseline.
+ bool can_use_baseline_for_string_init_;
+
OptimizingCompilerStats* compilation_stats_;
DISALLOW_COPY_AND_ASSIGN(HGraphBuilder);