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

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

Issue 11234002: Enable redundancy elimination for array loads. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 2 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 | « runtime/vm/intermediate_language.h ('k') | tests/language/optimize_redundant_array_load.dart » ('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) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, 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/intermediate_language.h" 5 #include "vm/intermediate_language.h"
6 6
7 #include "vm/bit_vector.h" 7 #include "vm/bit_vector.h"
8 #include "vm/dart_entry.h" 8 #include "vm/dart_entry.h"
9 #include "vm/flow_graph_allocator.h" 9 #include "vm/flow_graph_allocator.h"
10 #include "vm/flow_graph_builder.h" 10 #include "vm/flow_graph_builder.h"
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after
125 bool LoadStaticFieldInstr::AttributesEqual(Instruction* other) const { 125 bool LoadStaticFieldInstr::AttributesEqual(Instruction* other) const {
126 LoadStaticFieldInstr* other_load = other->AsLoadStaticField(); 126 LoadStaticFieldInstr* other_load = other->AsLoadStaticField();
127 ASSERT(other_load != NULL); 127 ASSERT(other_load != NULL);
128 // Assert that the field is initialized. 128 // Assert that the field is initialized.
129 ASSERT(field().value() != Object::sentinel()); 129 ASSERT(field().value() != Object::sentinel());
130 ASSERT(field().value() != Object::transition_sentinel()); 130 ASSERT(field().value() != Object::transition_sentinel());
131 return field().raw() == other_load->field().raw(); 131 return field().raw() == other_load->field().raw();
132 } 132 }
133 133
134 134
135 bool LoadIndexedInstr::AttributesEqual(Instruction* other) const {
136 LoadIndexedInstr* other_load = other->AsLoadIndexed();
137 ASSERT(other_load != NULL);
138 return class_id() == other_load->class_id();
139 }
140
141
135 bool ConstantInstr::AttributesEqual(Instruction* other) const { 142 bool ConstantInstr::AttributesEqual(Instruction* other) const {
136 ConstantInstr* other_constant = other->AsConstant(); 143 ConstantInstr* other_constant = other->AsConstant();
137 ASSERT(other_constant != NULL); 144 ASSERT(other_constant != NULL);
138 return (value().raw() == other_constant->value().raw()); 145 return (value().raw() == other_constant->value().raw());
139 } 146 }
140 147
141 148
142 // Returns true if the value represents a constant. 149 // Returns true if the value represents a constant.
143 bool Value::BindsToConstant() const { 150 bool Value::BindsToConstant() const {
144 return definition()->IsConstant(); 151 return definition()->IsConstant();
(...skipping 2058 matching lines...) Expand 10 before | Expand all | Expand 10 after
2203 new_max = new_max.Clamp(); 2210 new_max = new_max.Clamp();
2204 } 2211 }
2205 2212
2206 return Range::Update(&range_, new_min, new_max); 2213 return Range::Update(&range_, new_min, new_max);
2207 } 2214 }
2208 2215
2209 2216
2210 #undef __ 2217 #undef __
2211 2218
2212 } // namespace dart 2219 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/intermediate_language.h ('k') | tests/language/optimize_redundant_array_load.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698