OLD | NEW |
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 Loading... |
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_.StaticValue() != Object::sentinel().raw()) && |
387 (field_.value() != Object::transition_sentinel().raw()); | 387 (field_.StaticValue() != 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().StaticValue() != Object::sentinel().raw()); |
402 ASSERT(StaticField().value() != Object::transition_sentinel().raw()); | 402 ASSERT(StaticField().StaticValue() != Object::transition_sentinel().raw()); |
403 return StaticField().raw() == other_load->StaticField().raw(); | 403 return StaticField().raw() == other_load->StaticField().raw(); |
404 } | 404 } |
405 | 405 |
406 | 406 |
407 const Field& LoadStaticFieldInstr::StaticField() const { | 407 const Field& LoadStaticFieldInstr::StaticField() const { |
408 Field& field = Field::Handle(); | 408 Field& field = Field::Handle(); |
409 field ^= field_value()->BoundConstant().raw(); | 409 field ^= field_value()->BoundConstant().raw(); |
410 return field; | 410 return field; |
411 } | 411 } |
412 | 412 |
(...skipping 3226 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3639 case Token::kTRUNCDIV: return 0; | 3639 case Token::kTRUNCDIV: return 0; |
3640 case Token::kMOD: return 1; | 3640 case Token::kMOD: return 1; |
3641 default: UNIMPLEMENTED(); return -1; | 3641 default: UNIMPLEMENTED(); return -1; |
3642 } | 3642 } |
3643 } | 3643 } |
3644 | 3644 |
3645 | 3645 |
3646 #undef __ | 3646 #undef __ |
3647 | 3647 |
3648 } // namespace dart | 3648 } // namespace dart |
OLD | NEW |