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/bigint_operations.h" | 7 #include "vm/bigint_operations.h" |
8 #include "vm/bit_vector.h" | 8 #include "vm/bit_vector.h" |
9 #include "vm/cpu.h" | 9 #include "vm/cpu.h" |
10 #include "vm/dart_entry.h" | 10 #include "vm/dart_entry.h" |
(...skipping 308 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
319 ASSERT(other_load != NULL); | 319 ASSERT(other_load != NULL); |
320 if (field() != NULL) { | 320 if (field() != NULL) { |
321 return (other_load->field() != NULL) && | 321 return (other_load->field() != NULL) && |
322 (field()->raw() == other_load->field()->raw()); | 322 (field()->raw() == other_load->field()->raw()); |
323 } | 323 } |
324 return (other_load->field() == NULL) && | 324 return (other_load->field() == NULL) && |
325 (offset_in_bytes() == other_load->offset_in_bytes()); | 325 (offset_in_bytes() == other_load->offset_in_bytes()); |
326 } | 326 } |
327 | 327 |
328 | 328 |
| 329 Instruction* InitStaticFieldInstr::Canonicalize(FlowGraph* flow_graph) { |
| 330 const bool is_initialized = |
| 331 (field_.value() != Object::sentinel().raw()) && |
| 332 (field_.value() != Object::transition_sentinel().raw()); |
| 333 return is_initialized ? NULL : this; |
| 334 } |
| 335 |
| 336 |
329 EffectSet LoadStaticFieldInstr::Dependencies() const { | 337 EffectSet LoadStaticFieldInstr::Dependencies() const { |
330 return StaticField().is_final() ? EffectSet::None() : EffectSet::All(); | 338 return StaticField().is_final() ? EffectSet::None() : EffectSet::All(); |
331 } | 339 } |
332 | 340 |
333 | 341 |
334 bool LoadStaticFieldInstr::AttributesEqual(Instruction* other) const { | 342 bool LoadStaticFieldInstr::AttributesEqual(Instruction* other) const { |
335 LoadStaticFieldInstr* other_load = other->AsLoadStaticField(); | 343 LoadStaticFieldInstr* other_load = other->AsLoadStaticField(); |
336 ASSERT(other_load != NULL); | 344 ASSERT(other_load != NULL); |
337 // Assert that the field is initialized. | 345 // Assert that the field is initialized. |
338 ASSERT(StaticField().value() != Object::sentinel().raw()); | 346 ASSERT(StaticField().value() != Object::sentinel().raw()); |
(...skipping 2623 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2962 case Token::kTRUNCDIV: return 0; | 2970 case Token::kTRUNCDIV: return 0; |
2963 case Token::kMOD: return 1; | 2971 case Token::kMOD: return 1; |
2964 default: UNIMPLEMENTED(); return -1; | 2972 default: UNIMPLEMENTED(); return -1; |
2965 } | 2973 } |
2966 } | 2974 } |
2967 | 2975 |
2968 | 2976 |
2969 #undef __ | 2977 #undef __ |
2970 | 2978 |
2971 } // namespace dart | 2979 } // namespace dart |
OLD | NEW |