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

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

Issue 2487873003: Speculate on bitwise operators. (Closed)
Patch Set: git cl format Created 4 years, 1 month 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/intermediate_language_x64.cc ('k') | runtime/vm/token.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) 2016, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2016, 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/redundancy_elimination.h" 5 #include "vm/redundancy_elimination.h"
6 6
7 #include "vm/bit_vector.h" 7 #include "vm/bit_vector.h"
8 #include "vm/flow_graph.h" 8 #include "vm/flow_graph.h"
9 #include "vm/hash_map.h" 9 #include "vm/hash_map.h"
10 #include "vm/il_printer.h" 10 #include "vm/il_printer.h"
(...skipping 985 matching lines...) Expand 10 before | Expand all | Expand 10 after
996 996
997 return false; 997 return false;
998 } 998 }
999 999
1000 // Check if any use of the definition can create an alias. 1000 // Check if any use of the definition can create an alias.
1001 // Can add more objects into aliasing_worklist_. 1001 // Can add more objects into aliasing_worklist_.
1002 bool AnyUseCreatesAlias(Definition* defn) { 1002 bool AnyUseCreatesAlias(Definition* defn) {
1003 for (Value* use = defn->input_use_list(); use != NULL; 1003 for (Value* use = defn->input_use_list(); use != NULL;
1004 use = use->next_use()) { 1004 use = use->next_use()) {
1005 Instruction* instr = use->instruction(); 1005 Instruction* instr = use->instruction();
1006 if (instr->IsPushArgument() || 1006 if (instr->IsPushArgument() || instr->IsCheckedSmiOp() ||
1007 instr->IsCheckedSmiComparison() ||
Vyacheslav Egorov (Google) 2016/11/15 21:58:34 We should consider making this a flag / function o
1007 (instr->IsStoreIndexed() && 1008 (instr->IsStoreIndexed() &&
1008 (use->use_index() == StoreIndexedInstr::kValuePos)) || 1009 (use->use_index() == StoreIndexedInstr::kValuePos)) ||
1009 instr->IsStoreStaticField() || instr->IsPhi()) { 1010 instr->IsStoreStaticField() || instr->IsPhi()) {
1010 return true; 1011 return true;
1011 } else if ((instr->IsAssertAssignable() || instr->IsRedefinition()) && 1012 } else if ((instr->IsAssertAssignable() || instr->IsRedefinition()) &&
1012 AnyUseCreatesAlias(instr->AsDefinition())) { 1013 AnyUseCreatesAlias(instr->AsDefinition())) {
1013 return true; 1014 return true;
1014 } else if ((instr->IsStoreInstanceField() && 1015 } else if ((instr->IsStoreInstanceField() &&
1015 (use->use_index() != 1016 (use->use_index() !=
1016 StoreInstanceFieldInstr::kInstancePos))) { 1017 StoreInstanceFieldInstr::kInstancePos))) {
(...skipping 2356 matching lines...) Expand 10 before | Expand all | Expand 10 after
3373 join->phis_ = NULL; 3374 join->phis_ = NULL;
3374 } else { 3375 } else {
3375 join->phis_->TruncateTo(to_index); 3376 join->phis_->TruncateTo(to_index);
3376 } 3377 }
3377 } 3378 }
3378 } 3379 }
3379 } 3380 }
3380 3381
3381 3382
3382 } // namespace dart 3383 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/intermediate_language_x64.cc ('k') | runtime/vm/token.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698