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

Unified Diff: runtime/vm/intermediate_language.h

Issue 938783003: Don't constant fold operation if result is incompatible with it. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Work-around quasi-missing deopt environments Created 5 years, 10 months 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 4fad8502940b9adcf985a8361bffaf5bfae3f1c7..de14197f9bddcb1b004abea3fd6c9553fe5a3ee8 100644
--- a/runtime/vm/intermediate_language.h
+++ b/runtime/vm/intermediate_language.h
@@ -292,7 +292,12 @@ class Value : public ZoneAllocated {
reaching_type_(NULL) { }
Definition* definition() const { return definition_; }
- void set_definition(Definition* definition) { definition_ = definition; }
+ void set_definition(Definition* definition) {
+ if ((definition_ != NULL) && (reaching_type_ != NULL)) {
+ UpdateReachingType(definition);
+ }
+ definition_ = definition;
+ }
Value* previous_use() const { return previous_use_; }
void set_previous_use(Value* previous) { previous_use_ = previous; }
@@ -329,6 +334,8 @@ class Value : public ZoneAllocated {
CompileType* Type();
+ void UpdateReachingType(Definition* new_definition);
+
void SetReachingType(CompileType* type) {
reaching_type_ = type;
}

Powered by Google App Engine
This is Rietveld 408576698