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

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

Issue 328503003: Extend Range analysis to 64-bit range and mint operations (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 6 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 | runtime/vm/intermediate_language.h » ('j') | runtime/vm/intermediate_language.cc » ('J')
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/cpu.h" 9 #include "vm/cpu.h"
10 #include "vm/dart_entry.h" 10 #include "vm/dart_entry.h"
(...skipping 4952 matching lines...) Expand 10 before | Expand all | Expand 10 after
4963 } 4963 }
4964 } 4964 }
4965 4965
4966 4966
4967 RangeAnalysis::Direction RangeAnalysis::ToDirection(Value* val) { 4967 RangeAnalysis::Direction RangeAnalysis::ToDirection(Value* val) {
4968 if (val->BindsToConstant()) { 4968 if (val->BindsToConstant()) {
4969 return (Smi::Cast(val->BoundConstant()).Value() >= 0) ? kPositive 4969 return (Smi::Cast(val->BoundConstant()).Value() >= 0) ? kPositive
4970 : kNegative; 4970 : kNegative;
4971 } else if (val->definition()->range() != NULL) { 4971 } else if (val->definition()->range() != NULL) {
4972 Range* range = val->definition()->range(); 4972 Range* range = val->definition()->range();
4973 if (Range::ConstantMin(range).value() >= 0) { 4973 if (Range::ConstantMin(range).ConstantValue() >= 0) {
4974 return kPositive; 4974 return kPositive;
4975 } else if (Range::ConstantMax(range).value() <= 0) { 4975 } else if (Range::ConstantMax(range).ConstantValue() <= 0) {
4976 return kNegative; 4976 return kNegative;
4977 } 4977 }
4978 } 4978 }
4979 return kUnknown; 4979 return kUnknown;
4980 } 4980 }
4981 4981
4982 4982
4983 Range* RangeAnalysis::InferInductionVariableRange(JoinEntryInstr* loop_header, 4983 Range* RangeAnalysis::InferInductionVariableRange(JoinEntryInstr* loop_header,
4984 PhiInstr* var) { 4984 PhiInstr* var) {
4985 BitVector* loop_info = loop_header->loop_info(); 4985 BitVector* loop_info = loop_header->loop_info();
(...skipping 4867 matching lines...) Expand 10 before | Expand all | Expand 10 after
9853 } 9853 }
9854 9854
9855 // Insert materializations at environment uses. 9855 // Insert materializations at environment uses.
9856 for (intptr_t i = 0; i < exits.length(); i++) { 9856 for (intptr_t i = 0; i < exits.length(); i++) {
9857 CreateMaterializationAt(exits[i], alloc, alloc->cls(), *slots); 9857 CreateMaterializationAt(exits[i], alloc, alloc->cls(), *slots);
9858 } 9858 }
9859 } 9859 }
9860 9860
9861 9861
9862 } // namespace dart 9862 } // namespace dart
OLDNEW
« no previous file with comments | « no previous file | runtime/vm/intermediate_language.h » ('j') | runtime/vm/intermediate_language.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698