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

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

Issue 1289643005: Rename accessors of class Field to make it more apparent as to what is being accessed - static fiel… (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: self-code-review Created 5 years, 3 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
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/bit_vector.h" 7 #include "vm/bit_vector.h"
8 #include "vm/constant_propagator.h" 8 #include "vm/constant_propagator.h"
9 #include "vm/cpu.h" 9 #include "vm/cpu.h"
10 #include "vm/dart_entry.h" 10 #include "vm/dart_entry.h"
(...skipping 365 matching lines...) Expand 10 before | Expand all | Expand 10 after
376 return (other_load->field() != NULL) && 376 return (other_load->field() != NULL) &&
377 (field()->raw() == other_load->field()->raw()); 377 (field()->raw() == other_load->field()->raw());
378 } 378 }
379 return (other_load->field() == NULL) && 379 return (other_load->field() == NULL) &&
380 (offset_in_bytes() == other_load->offset_in_bytes()); 380 (offset_in_bytes() == other_load->offset_in_bytes());
381 } 381 }
382 382
383 383
384 Instruction* InitStaticFieldInstr::Canonicalize(FlowGraph* flow_graph) { 384 Instruction* InitStaticFieldInstr::Canonicalize(FlowGraph* flow_graph) {
385 const bool is_initialized = 385 const bool is_initialized =
386 (field_.value() != Object::sentinel().raw()) && 386 (field_.StaticFieldValue() != Object::sentinel().raw()) &&
387 (field_.value() != Object::transition_sentinel().raw()); 387 (field_.StaticFieldValue() != Object::transition_sentinel().raw());
388 return is_initialized ? NULL : this; 388 return is_initialized ? NULL : this;
389 } 389 }
390 390
391 391
392 EffectSet LoadStaticFieldInstr::Dependencies() const { 392 EffectSet LoadStaticFieldInstr::Dependencies() const {
393 return StaticField().is_final() ? EffectSet::None() : EffectSet::All(); 393 return StaticField().is_final() ? EffectSet::None() : EffectSet::All();
394 } 394 }
395 395
396 396
397 bool LoadStaticFieldInstr::AttributesEqual(Instruction* other) const { 397 bool LoadStaticFieldInstr::AttributesEqual(Instruction* other) const {
398 LoadStaticFieldInstr* other_load = other->AsLoadStaticField(); 398 LoadStaticFieldInstr* other_load = other->AsLoadStaticField();
399 ASSERT(other_load != NULL); 399 ASSERT(other_load != NULL);
400 // Assert that the field is initialized. 400 // Assert that the field is initialized.
401 ASSERT(StaticField().value() != Object::sentinel().raw()); 401 ASSERT(StaticField().StaticFieldValue() != Object::sentinel().raw());
402 ASSERT(StaticField().value() != Object::transition_sentinel().raw()); 402 ASSERT(StaticField().StaticFieldValue() !=
403 Object::transition_sentinel().raw());
403 return StaticField().raw() == other_load->StaticField().raw(); 404 return StaticField().raw() == other_load->StaticField().raw();
404 } 405 }
405 406
406 407
407 const Field& LoadStaticFieldInstr::StaticField() const { 408 const Field& LoadStaticFieldInstr::StaticField() const {
408 Field& field = Field::Handle(); 409 Field& field = Field::Handle();
409 field ^= field_value()->BoundConstant().raw(); 410 field ^= field_value()->BoundConstant().raw();
410 return field; 411 return field;
411 } 412 }
412 413
(...skipping 3232 matching lines...) Expand 10 before | Expand all | Expand 10 after
3645 case Token::kTRUNCDIV: return 0; 3646 case Token::kTRUNCDIV: return 0;
3646 case Token::kMOD: return 1; 3647 case Token::kMOD: return 1;
3647 default: UNIMPLEMENTED(); return -1; 3648 default: UNIMPLEMENTED(); return -1;
3648 } 3649 }
3649 } 3650 }
3650 3651
3651 3652
3652 #undef __ 3653 #undef __
3653 3654
3654 } // namespace dart 3655 } // namespace dart
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698