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

Unified Diff: runtime/vm/flow_graph_optimizer.cc

Issue 712993005: Infer range for BIT_XOR. (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
« no previous file with comments | « runtime/vm/flow_graph_compiler_x64.cc ('k') | runtime/vm/flow_graph_range_analysis.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/flow_graph_optimizer.cc
diff --git a/runtime/vm/flow_graph_optimizer.cc b/runtime/vm/flow_graph_optimizer.cc
index 9cedab65a54107586eec149848ec03778a56e011..f8d72e90888538e26cf4fa654217641693de0b2b 100644
--- a/runtime/vm/flow_graph_optimizer.cc
+++ b/runtime/vm/flow_graph_optimizer.cc
@@ -750,6 +750,27 @@ static void UnboxPhi(PhiInstr* phi) {
break;
}
+ if ((unboxed == kTagged) &&
+ phi->Type()->IsInt() &&
+ RangeUtils::Fits(phi->range(), RangeBoundary::kRangeBoundaryInt32)) {
+ bool should_unbox = false;
+ for (intptr_t i = 0; i < phi->InputCount(); i++) {
+ Definition* input = phi->InputAt(i)->definition();
+ if (input->IsBox() &&
+ RangeUtils::Fits(input->range(),
+ RangeBoundary::kRangeBoundaryInt32)) {
+ should_unbox = true;
+ } else if (!input->IsConstant()) {
+ should_unbox = false;
+ break;
+ }
+ }
+
+ if (should_unbox) {
+ unboxed = kUnboxedInt32;
+ }
+ }
+
phi->set_representation(unboxed);
}
« no previous file with comments | « runtime/vm/flow_graph_compiler_x64.cc ('k') | runtime/vm/flow_graph_range_analysis.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698