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

Unified Diff: runtime/vm/flow_graph_type_propagator.cc

Issue 670263007: IR refactoring: consolidate all boxing and unboxing instructions. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 2 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
« no previous file with comments | « runtime/vm/flow_graph_range_analysis.cc ('k') | runtime/vm/il_printer.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/flow_graph_type_propagator.cc
diff --git a/runtime/vm/flow_graph_type_propagator.cc b/runtime/vm/flow_graph_type_propagator.cc
index 0501f6a944faa1ea535e2d1ad5a2cee2c6c317cb..78177fa458d0b54e0751ff6e1c9e6969c4e4103d 100644
--- a/runtime/vm/flow_graph_type_propagator.cc
+++ b/runtime/vm/flow_graph_type_propagator.cc
@@ -1042,7 +1042,7 @@ CompileType ConstraintInstr::ComputeType() const {
}
// Note that MintOp may produce Smi-s as result of an
-// appended BoxIntegerInstr node.
+// appended BoxInt64Instr node.
CompileType BinaryMintOpInstr::ComputeType() const {
return CompileType::Int();
}
@@ -1059,29 +1059,11 @@ CompileType UnaryMintOpInstr::ComputeType() const {
CompileType BoxIntegerInstr::ComputeType() const {
- if (is_smi()) {
- return CompileType::FromCid(kSmiCid);
- }
- return CompileType::Int();
-}
-
-
-bool BoxIntegerInstr::RecomputeType() {
- return UpdateType(ComputeType());
-}
-
-
-CompileType BoxIntNInstr::ComputeType() const {
return ValueFitsSmi() ? CompileType::FromCid(kSmiCid) : CompileType::Int();
}
-CompileType UnboxIntNInstr::ComputeType() const {
- return CompileType::Int();
-}
-
-
-bool BoxIntNInstr::RecomputeType() {
+bool BoxIntegerInstr::RecomputeType() {
return UpdateType(ComputeType());
}
@@ -1288,43 +1270,48 @@ CompileType MathMinMaxInstr::ComputeType() const {
}
-CompileType UnboxDoubleInstr::ComputeType() const {
- return CompileType::FromCid(kDoubleCid);
-}
+CompileType UnboxInstr::ComputeType() const {
+ switch (representation()) {
+ case kUnboxedDouble:
+ return CompileType::FromCid(kDoubleCid);
+ case kUnboxedFloat32x4:
+ return CompileType::FromCid(kFloat32x4Cid);
-CompileType BoxDoubleInstr::ComputeType() const {
- return CompileType::FromCid(kDoubleCid);
-}
-
+ case kUnboxedFloat64x2:
+ return CompileType::FromCid(kFloat64x2Cid);
-CompileType UnboxFloat32x4Instr::ComputeType() const {
- return CompileType::FromCid(kFloat32x4Cid);
-}
-
-
-CompileType BoxFloat32x4Instr::ComputeType() const {
- return CompileType::FromCid(kFloat32x4Cid);
-}
+ case kUnboxedInt32x4:
+ return CompileType::FromCid(kInt32x4Cid);
+ case kUnboxedMint:
+ return CompileType::Int();
-CompileType UnboxFloat64x2Instr::ComputeType() const {
- return CompileType::FromCid(kFloat64x2Cid);
+ default:
+ UNREACHABLE();
+ return CompileType::Dynamic();
+ }
}
-CompileType BoxFloat64x2Instr::ComputeType() const {
- return CompileType::FromCid(kFloat64x2Cid);
-}
+CompileType BoxInstr::ComputeType() const {
+ switch (from_representation()) {
+ case kUnboxedDouble:
+ return CompileType::FromCid(kDoubleCid);
+ case kUnboxedFloat32x4:
+ return CompileType::FromCid(kFloat32x4Cid);
-CompileType UnboxInt32x4Instr::ComputeType() const {
- return CompileType::FromCid(kInt32x4Cid);
-}
+ case kUnboxedFloat64x2:
+ return CompileType::FromCid(kFloat64x2Cid);
+ case kUnboxedInt32x4:
+ return CompileType::FromCid(kInt32x4Cid);
-CompileType BoxInt32x4Instr::ComputeType() const {
- return CompileType::FromCid(kInt32x4Cid);
+ default:
+ UNREACHABLE();
+ return CompileType::Dynamic();
+ }
}
« no previous file with comments | « runtime/vm/flow_graph_range_analysis.cc ('k') | runtime/vm/il_printer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698