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

Side by Side Diff: runtime/vm/constant_propagator.cc

Issue 1567023002: Fix assertion in ConstantPropagator::VisitInstanceOf. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 11 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 unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 #include "vm/constant_propagator.h" 5 #include "vm/constant_propagator.h"
6 6
7 #include "vm/bit_vector.h" 7 #include "vm/bit_vector.h"
8 #include "vm/flow_graph_builder.h" 8 #include "vm/flow_graph_builder.h"
9 #include "vm/flow_graph_compiler.h" 9 #include "vm/flow_graph_compiler.h"
10 #include "vm/flow_graph_range_analysis.h" 10 #include "vm/flow_graph_range_analysis.h"
(...skipping 725 matching lines...) Expand 10 before | Expand all | Expand 10 after
736 SetValue(instr, Bool::Get(val)); 736 SetValue(instr, Bool::Get(val));
737 } 737 }
738 } 738 }
739 739
740 740
741 void ConstantPropagator::VisitInstanceOf(InstanceOfInstr* instr) { 741 void ConstantPropagator::VisitInstanceOf(InstanceOfInstr* instr) {
742 Definition* def = instr->value()->definition(); 742 Definition* def = instr->value()->definition();
743 const Object& value = def->constant_value(); 743 const Object& value = def->constant_value();
744 if (IsNonConstant(value)) { 744 if (IsNonConstant(value)) {
745 const AbstractType& checked_type = instr->type(); 745 const AbstractType& checked_type = instr->type();
746 intptr_t value_cid = instr->value()->Type()->ToCid(); 746 intptr_t value_cid = instr->value()->definition()->Type()->ToCid();
747 Representation rep = def->representation(); 747 Representation rep = def->representation();
748 if ((checked_type.IsFloat32x4Type() && (rep == kUnboxedFloat32x4)) || 748 if ((checked_type.IsFloat32x4Type() && (rep == kUnboxedFloat32x4)) ||
749 (checked_type.IsInt32x4Type() && (rep == kUnboxedInt32x4)) || 749 (checked_type.IsInt32x4Type() && (rep == kUnboxedInt32x4)) ||
750 (checked_type.IsDoubleType() && (rep == kUnboxedDouble) && 750 (checked_type.IsDoubleType() && (rep == kUnboxedDouble) &&
751 FlowGraphCompiler::SupportsUnboxedDoubles()) || 751 FlowGraphCompiler::SupportsUnboxedDoubles()) ||
752 (checked_type.IsIntType() && (rep == kUnboxedMint))) { 752 (checked_type.IsIntType() && (rep == kUnboxedMint))) {
753 // Ensure that compile time type matches representation. 753 // Ensure that compile time type matches representation.
754 ASSERT(((rep == kUnboxedFloat32x4) && (value_cid == kFloat32x4Cid)) || 754 ASSERT(((rep == kUnboxedFloat32x4) && (value_cid == kFloat32x4Cid)) ||
755 ((rep == kUnboxedInt32x4) && (value_cid == kInt32x4Cid)) || 755 ((rep == kUnboxedInt32x4) && (value_cid == kInt32x4Cid)) ||
756 ((rep == kUnboxedDouble) && (value_cid == kDoubleCid)) || 756 ((rep == kUnboxedDouble) && (value_cid == kDoubleCid)) ||
(...skipping 925 matching lines...) Expand 10 before | Expand all | Expand 10 after
1682 graph_->MergeBlocks(); 1682 graph_->MergeBlocks();
1683 GrowableArray<BitVector*> dominance_frontier; 1683 GrowableArray<BitVector*> dominance_frontier;
1684 graph_->ComputeDominators(&dominance_frontier); 1684 graph_->ComputeDominators(&dominance_frontier);
1685 1685
1686 if (FLAG_trace_constant_propagation) { 1686 if (FLAG_trace_constant_propagation) {
1687 FlowGraphPrinter::PrintGraph("After CP", graph_); 1687 FlowGraphPrinter::PrintGraph("After CP", graph_);
1688 } 1688 }
1689 } 1689 }
1690 1690
1691 } // namespace dart 1691 } // namespace dart
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698