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

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

Issue 1533383003: Remove instantiator argument in generated code for type tests. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: fix typo Created 5 years 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 | « runtime/vm/code_generator.cc ('k') | runtime/vm/flow_graph_builder.h » ('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 746 matching lines...) Expand 10 before | Expand all | Expand 10 after
757 ((rep == kUnboxedMint) && (value_cid == kMintCid))); 757 ((rep == kUnboxedMint) && (value_cid == kMintCid)));
758 // The representation guarantees the type check to be true. 758 // The representation guarantees the type check to be true.
759 SetValue(instr, instr->negate_result() ? Bool::False() : Bool::True()); 759 SetValue(instr, instr->negate_result() ? Bool::False() : Bool::True());
760 } else { 760 } else {
761 SetValue(instr, non_constant_); 761 SetValue(instr, non_constant_);
762 } 762 }
763 } else if (IsConstant(value)) { 763 } else if (IsConstant(value)) {
764 if (value.IsInstance()) { 764 if (value.IsInstance()) {
765 const Instance& instance = Instance::Cast(value); 765 const Instance& instance = Instance::Cast(value);
766 const AbstractType& checked_type = instr->type(); 766 const AbstractType& checked_type = instr->type();
767 if (instr->instantiator()->BindsToConstantNull() && 767 if (instr->instantiator_type_arguments()->BindsToConstantNull()) {
768 instr->instantiator_type_arguments()->BindsToConstantNull()) {
769 const TypeArguments& checked_type_arguments = TypeArguments::Handle(); 768 const TypeArguments& checked_type_arguments = TypeArguments::Handle();
770 Error& bound_error = Error::Handle(); 769 Error& bound_error = Error::Handle();
771 bool is_instance = instance.IsInstanceOf(checked_type, 770 bool is_instance = instance.IsInstanceOf(checked_type,
772 checked_type_arguments, 771 checked_type_arguments,
773 &bound_error); 772 &bound_error);
774 // Can only have bound error with generics. 773 // Can only have bound error with generics.
775 ASSERT(bound_error.IsNull()); 774 ASSERT(bound_error.IsNull());
776 SetValue(instr, Bool::Get(instr->negate_result() 775 SetValue(instr, Bool::Get(instr->negate_result()
777 ? !is_instance : is_instance)); 776 ? !is_instance : is_instance));
778 return; 777 return;
(...skipping 904 matching lines...) Expand 10 before | Expand all | Expand 10 after
1683 graph_->MergeBlocks(); 1682 graph_->MergeBlocks();
1684 GrowableArray<BitVector*> dominance_frontier; 1683 GrowableArray<BitVector*> dominance_frontier;
1685 graph_->ComputeDominators(&dominance_frontier); 1684 graph_->ComputeDominators(&dominance_frontier);
1686 1685
1687 if (FLAG_trace_constant_propagation) { 1686 if (FLAG_trace_constant_propagation) {
1688 FlowGraphPrinter::PrintGraph("After CP", graph_); 1687 FlowGraphPrinter::PrintGraph("After CP", graph_);
1689 } 1688 }
1690 } 1689 }
1691 1690
1692 } // namespace dart 1691 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/code_generator.cc ('k') | runtime/vm/flow_graph_builder.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698