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

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

Issue 22465002: When converting from equality to strict equality always note that number check is not needed since … (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 4 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 | Annotate | Revision Log
« 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/flow_graph_optimizer.h" 5 #include "vm/flow_graph_optimizer.h"
6 6
7 #include "vm/bit_vector.h" 7 #include "vm/bit_vector.h"
8 #include "vm/cha.h" 8 #include "vm/cha.h"
9 #include "vm/dart_entry.h" 9 #include "vm/dart_entry.h"
10 #include "vm/flow_graph_builder.h" 10 #include "vm/flow_graph_builder.h"
(...skipping 2862 matching lines...) Expand 10 before | Expand all | Expand 10 after
2873 EqualityCompareInstr* compare, 2873 EqualityCompareInstr* compare,
2874 T current_instruction) const { 2874 T current_instruction) const {
2875 if (CanStrictifyEqualityCompare(compare)) { 2875 if (CanStrictifyEqualityCompare(compare)) {
2876 Token::Kind strict_kind = (compare->kind() == Token::kEQ) ? 2876 Token::Kind strict_kind = (compare->kind() == Token::kEQ) ?
2877 Token::kEQ_STRICT : Token::kNE_STRICT; 2877 Token::kEQ_STRICT : Token::kNE_STRICT;
2878 StrictCompareInstr* strict_comp = 2878 StrictCompareInstr* strict_comp =
2879 new StrictCompareInstr(compare->token_pos(), 2879 new StrictCompareInstr(compare->token_pos(),
2880 strict_kind, 2880 strict_kind,
2881 compare->left()->CopyWithType(), 2881 compare->left()->CopyWithType(),
2882 compare->right()->CopyWithType()); 2882 compare->right()->CopyWithType());
2883 // Numbers override equality and are therefore not part of this conversion.
2884 strict_comp->set_needs_number_check(false);
2883 current_instruction->ReplaceWith(strict_comp, current_iterator()); 2885 current_instruction->ReplaceWith(strict_comp, current_iterator());
2884 return true; 2886 return true;
2885 } 2887 }
2886 return false; 2888 return false;
2887 } 2889 }
2888 2890
2889 2891
2890 // Returns true if we converted EqualityCompare to StrictCompare. 2892 // Returns true if we converted EqualityCompare to StrictCompare.
2891 template <typename T> 2893 template <typename T>
2892 bool FlowGraphOptimizer::StrictifyEqualityCompareWithICData( 2894 bool FlowGraphOptimizer::StrictifyEqualityCompareWithICData(
(...skipping 4518 matching lines...) Expand 10 before | Expand all | Expand 10 after
7411 } 7413 }
7412 7414
7413 // Insert materializations at environment uses. 7415 // Insert materializations at environment uses.
7414 for (intptr_t i = 0; i < exits.length(); i++) { 7416 for (intptr_t i = 0; i < exits.length(); i++) {
7415 CreateMaterializationAt(exits[i], alloc, alloc->cls(), *fields); 7417 CreateMaterializationAt(exits[i], alloc, alloc->cls(), *fields);
7416 } 7418 }
7417 } 7419 }
7418 7420
7419 7421
7420 } // namespace dart 7422 } // 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