Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(515)

Unified Diff: runtime/vm/intermediate_language.h

Issue 682993008: Improve precision of range analysis by allowing it to track ranges across all int typed phis. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: runtime/vm/intermediate_language.h
diff --git a/runtime/vm/intermediate_language.h b/runtime/vm/intermediate_language.h
index 7ee32da5ebee6dbcae21f98ca4f9df6fd311b470..f5cb877e7eae6ba3bdb44dc4654fa06e16aa24d9 100644
--- a/runtime/vm/intermediate_language.h
+++ b/runtime/vm/intermediate_language.h
@@ -158,6 +158,13 @@ class CompileType : public ValueObject {
return (cid_ == kIllegalCid) && (type_ == NULL);
}
+ bool IsInt() {
+ return !is_nullable() &&
+ ((ToCid() == kSmiCid) ||
+ (ToCid() == kMintCid) ||
+ ((type_ != NULL) && (type_->Equals(Type::Handle(Type::IntType())))));
+ }
+
void PrintTo(BufferFormatter* f) const;
const char* ToCString() const;
@@ -4679,6 +4686,8 @@ class UnboxUint32Instr : public UnboxInteger32Instr {
&& (value()->Type()->ToCid() != kMintCid);
}
+ virtual void InferRange(RangeAnalysis* analysis, Range* range);
+
DECLARE_INSTRUCTION_NO_BACKEND(UnboxUint32)
private:
@@ -7524,6 +7533,11 @@ class UnboxedIntConverterInstr : public TemplateDefinition<1, NoThrow> {
virtual void PrintOperandsTo(BufferFormatter* f) const;
+ virtual CompileType ComputeType() const {
+ // TODO(vegorov) use range information to improve type.
+ return CompileType::Int();
+ }
+
DECLARE_INSTRUCTION(UnboxedIntConverter);
private:

Powered by Google App Engine
This is Rietveld 408576698