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

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

Issue 2891713002: Cleanup: Make CheckClassId instruction more general so it (Closed)
Patch Set: Feedback from Martin Created 3 years, 7 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 | « runtime/vm/flow_graph_inliner.cc ('k') | runtime/vm/il_printer.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/flow_graph_type_propagator.h" 5 #include "vm/flow_graph_type_propagator.h"
6 6
7 #include "vm/cha.h" 7 #include "vm/cha.h"
8 #include "vm/bit_vector.h" 8 #include "vm/bit_vector.h"
9 #include "vm/il_printer.h" 9 #include "vm/il_printer.h"
10 #include "vm/object_store.h" 10 #include "vm/object_store.h"
(...skipping 231 matching lines...) Expand 10 before | Expand all | Expand 10 after
242 242
243 void FlowGraphTypePropagator::VisitCheckClassId(CheckClassIdInstr* check) { 243 void FlowGraphTypePropagator::VisitCheckClassId(CheckClassIdInstr* check) {
244 if (!check->Dependencies().IsNone()) { 244 if (!check->Dependencies().IsNone()) {
245 // TODO(vegorov): If check is affected by side-effect we can still propagate 245 // TODO(vegorov): If check is affected by side-effect we can still propagate
246 // the type further but not the cid. 246 // the type further but not the cid.
247 return; 247 return;
248 } 248 }
249 249
250 LoadClassIdInstr* load_cid = 250 LoadClassIdInstr* load_cid =
251 check->value()->definition()->OriginalDefinition()->AsLoadClassId(); 251 check->value()->definition()->OriginalDefinition()->AsLoadClassId();
252 if (load_cid != NULL) { 252 if (load_cid != NULL && check->cids().IsSingleCid()) {
253 SetCid(load_cid->object()->definition(), check->cid()); 253 SetCid(load_cid->object()->definition(), check->cids().cid_start);
254 } 254 }
255 } 255 }
256 256
257 257
258 void FlowGraphTypePropagator::CheckNonNullSelector( 258 void FlowGraphTypePropagator::CheckNonNullSelector(
259 Instruction* call, 259 Instruction* call,
260 Definition* receiver, 260 Definition* receiver,
261 const String& function_name) { 261 const String& function_name) {
262 if (!receiver->Type()->is_nullable()) { 262 if (!receiver->Type()->is_nullable()) {
263 // Nothing to do if type is already non-nullable. 263 // Nothing to do if type is already non-nullable.
(...skipping 1257 matching lines...) Expand 10 before | Expand all | Expand 10 after
1521 CompileType MergedMathInstr::ComputeType() const { 1521 CompileType MergedMathInstr::ComputeType() const {
1522 return CompileType::Dynamic(); 1522 return CompileType::Dynamic();
1523 } 1523 }
1524 1524
1525 1525
1526 CompileType ExtractNthOutputInstr::ComputeType() const { 1526 CompileType ExtractNthOutputInstr::ComputeType() const {
1527 return CompileType::FromCid(definition_cid_); 1527 return CompileType::FromCid(definition_cid_);
1528 } 1528 }
1529 1529
1530 } // namespace dart 1530 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/flow_graph_inliner.cc ('k') | runtime/vm/il_printer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698