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

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

Issue 1377453005: Cleanups and preemptively pass Heap::kOld whenever subtype testing in compiler (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: sync Created 5 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 unified diff | Download patch
« no previous file with comments | « no previous file | runtime/vm/flow_graph_builder.cc » ('j') | 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 743 matching lines...) Expand 10 before | Expand all | Expand 10 after
754 // The representation guarantees the type check to be true. 754 // The representation guarantees the type check to be true.
755 SetValue(instr, instr->negate_result() ? Bool::False() : Bool::True()); 755 SetValue(instr, instr->negate_result() ? Bool::False() : Bool::True());
756 } else { 756 } else {
757 SetValue(instr, non_constant_); 757 SetValue(instr, non_constant_);
758 } 758 }
759 } else if (IsConstant(value)) { 759 } else if (IsConstant(value)) {
760 if (value.IsInstance()) { 760 if (value.IsInstance()) {
761 const Instance& instance = Instance::Cast(value); 761 const Instance& instance = Instance::Cast(value);
762 const AbstractType& checked_type = instr->type(); 762 const AbstractType& checked_type = instr->type();
763 if (instr->instantiator()->BindsToConstantNull() && 763 if (instr->instantiator()->BindsToConstantNull() &&
764 instr->instantiator_type_arguments()->BindsToConstantNull()) { 764 instr->instantiator_type_arguments()->BindsToConstantNull()) {
765 const TypeArguments& checked_type_arguments = TypeArguments::Handle(); 765 const TypeArguments& checked_type_arguments = TypeArguments::Handle();
766 Error& bound_error = Error::Handle(); 766 Error& bound_error = Error::Handle();
767 bool is_instance = instance.IsInstanceOf(checked_type, 767 bool is_instance = instance.IsInstanceOf(checked_type,
768 checked_type_arguments, 768 checked_type_arguments,
769 &bound_error); 769 &bound_error);
770 // Can only have bound error with generics. 770 // Can only have bound error with generics.
771 ASSERT(bound_error.IsNull()); 771 ASSERT(bound_error.IsNull());
772 SetValue(instr, Bool::Get(instr->negate_result() 772 SetValue(instr, Bool::Get(instr->negate_result()
773 ? !is_instance : is_instance)); 773 ? !is_instance : is_instance));
774 return; 774 return;
(...skipping 904 matching lines...) Expand 10 before | Expand all | Expand 10 after
1679 graph_->MergeBlocks(); 1679 graph_->MergeBlocks();
1680 GrowableArray<BitVector*> dominance_frontier; 1680 GrowableArray<BitVector*> dominance_frontier;
1681 graph_->ComputeDominators(&dominance_frontier); 1681 graph_->ComputeDominators(&dominance_frontier);
1682 1682
1683 if (FLAG_trace_constant_propagation) { 1683 if (FLAG_trace_constant_propagation) {
1684 FlowGraphPrinter::PrintGraph("After CP", graph_); 1684 FlowGraphPrinter::PrintGraph("After CP", graph_);
1685 } 1685 }
1686 } 1686 }
1687 1687
1688 } // namespace dart 1688 } // namespace dart
OLDNEW
« no previous file with comments | « no previous file | runtime/vm/flow_graph_builder.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698