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

Unified Diff: src/compiler/typer.cc

Issue 712623002: [turbofan] Weakening of types must handle ranges inside unions. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Make Win32 compiler happy 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
« no previous file with comments | « no previous file | src/types.h » ('j') | src/types.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler/typer.cc
diff --git a/src/compiler/typer.cc b/src/compiler/typer.cc
index 0fa2b95ebd3460350def99acdd14b2341d7b1b00..081634c0f4c0f5e9e169b0fdcce9631e1293950e 100644
--- a/src/compiler/typer.cc
+++ b/src/compiler/typer.cc
@@ -1120,10 +1120,9 @@ Bounds Typer::Visitor::TypeJSLoadNamed(Node* node) {
// in the graph. In the current implementation, we are
// increasing the limits to the closest power of two.
Type* Typer::Visitor::Weaken(Type* current_type, Type* previous_type) {
- if (current_type->IsRange() && previous_type->IsRange()) {
- Type::RangeType* previous = previous_type->AsRange();
- Type::RangeType* current = current_type->AsRange();
-
+ Type::RangeType* previous = previous_type->GetRange();
+ Type::RangeType* current = current_type->GetRange();
+ if (previous != NULL && current != NULL) {
double current_min = current->Min()->Number();
Handle<Object> new_min = current->Min();
@@ -1153,7 +1152,9 @@ Type* Typer::Visitor::Weaken(Type* current_type, Type* previous_type) {
}
}
- return Type::Range(new_min, new_max, typer_->zone());
+ return Type::Union(current_type,
+ Type::Range(new_min, new_max, typer_->zone()),
+ typer_->zone());
}
return current_type;
}
« no previous file with comments | « no previous file | src/types.h » ('j') | src/types.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698