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

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

Issue 15973010: Split LoadStatic into two instructions: load static filed, load value. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 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 | « runtime/vm/intermediate_language.h ('k') | runtime/vm/intermediate_language_arm.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/intermediate_language.h" 5 #include "vm/intermediate_language.h"
6 6
7 #include "vm/bigint_operations.h" 7 #include "vm/bigint_operations.h"
8 #include "vm/bit_vector.h" 8 #include "vm/bit_vector.h"
9 #include "vm/dart_entry.h" 9 #include "vm/dart_entry.h"
10 #include "vm/flow_graph_allocator.h" 10 #include "vm/flow_graph_allocator.h"
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after
166 if (field() != NULL) { 166 if (field() != NULL) {
167 return (other_load->field() != NULL) && 167 return (other_load->field() != NULL) &&
168 (field()->raw() == other_load->field()->raw()); 168 (field()->raw() == other_load->field()->raw());
169 } 169 }
170 return (other_load->field() == NULL) && 170 return (other_load->field() == NULL) &&
171 (offset_in_bytes() == other_load->offset_in_bytes()); 171 (offset_in_bytes() == other_load->offset_in_bytes());
172 } 172 }
173 173
174 174
175 EffectSet LoadStaticFieldInstr::Dependencies() const { 175 EffectSet LoadStaticFieldInstr::Dependencies() const {
176 return field().is_final() ? EffectSet::None() : EffectSet::All(); 176 return StaticField().is_final() ? EffectSet::None() : EffectSet::All();
177 } 177 }
178 178
179 179
180 bool LoadStaticFieldInstr::AttributesEqual(Instruction* other) const { 180 bool LoadStaticFieldInstr::AttributesEqual(Instruction* other) const {
181 LoadStaticFieldInstr* other_load = other->AsLoadStaticField(); 181 LoadStaticFieldInstr* other_load = other->AsLoadStaticField();
182 ASSERT(other_load != NULL); 182 ASSERT(other_load != NULL);
183 // Assert that the field is initialized. 183 // Assert that the field is initialized.
184 ASSERT(field().value() != Object::sentinel().raw()); 184 ASSERT(StaticField().value() != Object::sentinel().raw());
185 ASSERT(field().value() != Object::transition_sentinel().raw()); 185 ASSERT(StaticField().value() != Object::transition_sentinel().raw());
186 return field().raw() == other_load->field().raw(); 186 return StaticField().raw() == other_load->StaticField().raw();
187 }
188
189
190 const Field& LoadStaticFieldInstr::StaticField() const {
191 Field& field = Field::Handle();
192 field ^= field_value()->BoundConstant().raw();
193 return field;
187 } 194 }
188 195
189 196
190 EffectSet LoadIndexedInstr::Dependencies() const { 197 EffectSet LoadIndexedInstr::Dependencies() const {
191 return EffectSet::All(); 198 return EffectSet::All();
192 } 199 }
193 200
194 201
195 bool LoadIndexedInstr::AttributesEqual(Instruction* other) const { 202 bool LoadIndexedInstr::AttributesEqual(Instruction* other) const {
196 LoadIndexedInstr* other_load = other->AsLoadIndexed(); 203 LoadIndexedInstr* other_load = other->AsLoadIndexed();
(...skipping 2296 matching lines...) Expand 10 before | Expand all | Expand 10 after
2493 default: 2500 default:
2494 UNREACHABLE(); 2501 UNREACHABLE();
2495 } 2502 }
2496 return kPowRuntimeEntry; 2503 return kPowRuntimeEntry;
2497 } 2504 }
2498 2505
2499 2506
2500 #undef __ 2507 #undef __
2501 2508
2502 } // namespace dart 2509 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/intermediate_language.h ('k') | runtime/vm/intermediate_language_arm.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698