| 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 #ifndef VM_INTERMEDIATE_LANGUAGE_H_ | 5 #ifndef VM_INTERMEDIATE_LANGUAGE_H_ |
| 6 #define VM_INTERMEDIATE_LANGUAGE_H_ | 6 #define VM_INTERMEDIATE_LANGUAGE_H_ |
| 7 | 7 |
| 8 #include "vm/allocation.h" | 8 #include "vm/allocation.h" |
| 9 #include "vm/ast.h" | 9 #include "vm/ast.h" |
| 10 #include "vm/growable_array.h" | 10 #include "vm/growable_array.h" |
| (...skipping 3362 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3373 | 3373 |
| 3374 virtual bool MayThrow() const { return false; } | 3374 virtual bool MayThrow() const { return false; } |
| 3375 | 3375 |
| 3376 private: | 3376 private: |
| 3377 const Field& field_; | 3377 const Field& field_; |
| 3378 | 3378 |
| 3379 DISALLOW_COPY_AND_ASSIGN(GuardFieldInstr); | 3379 DISALLOW_COPY_AND_ASSIGN(GuardFieldInstr); |
| 3380 }; | 3380 }; |
| 3381 | 3381 |
| 3382 | 3382 |
| 3383 class LoadStaticFieldInstr : public TemplateDefinition<0> { | 3383 class LoadStaticFieldInstr : public TemplateDefinition<1> { |
| 3384 public: | 3384 public: |
| 3385 explicit LoadStaticFieldInstr(const Field& field) : field_(field) {} | 3385 explicit LoadStaticFieldInstr(Value* field_value) { |
| 3386 ASSERT(field_value->BindsToConstant()); |
| 3387 SetInputAt(0, field_value); |
| 3388 } |
| 3386 | 3389 |
| 3387 DECLARE_INSTRUCTION(LoadStaticField) | 3390 DECLARE_INSTRUCTION(LoadStaticField) |
| 3388 virtual CompileType ComputeType() const; | 3391 virtual CompileType ComputeType() const; |
| 3389 | 3392 |
| 3390 const Field& field() const { return field_; } | 3393 const Field& StaticField() const; |
| 3394 |
| 3395 Value* field_value() const { return inputs_[0]; } |
| 3391 | 3396 |
| 3392 virtual void PrintOperandsTo(BufferFormatter* f) const; | 3397 virtual void PrintOperandsTo(BufferFormatter* f) const; |
| 3393 | 3398 |
| 3394 virtual bool CanDeoptimize() const { return false; } | 3399 virtual bool CanDeoptimize() const { return false; } |
| 3395 | 3400 |
| 3396 virtual bool AllowsCSE() const { return field_.is_final(); } | 3401 virtual bool AllowsCSE() const { return StaticField().is_final(); } |
| 3397 virtual EffectSet Effects() const { return EffectSet::None(); } | 3402 virtual EffectSet Effects() const { return EffectSet::None(); } |
| 3398 virtual EffectSet Dependencies() const; | 3403 virtual EffectSet Dependencies() const; |
| 3399 virtual bool AttributesEqual(Instruction* other) const; | 3404 virtual bool AttributesEqual(Instruction* other) const; |
| 3400 | 3405 |
| 3401 virtual bool MayThrow() const { return false; } | 3406 virtual bool MayThrow() const { return false; } |
| 3407 |
| 3402 private: | 3408 private: |
| 3403 const Field& field_; | |
| 3404 | |
| 3405 DISALLOW_COPY_AND_ASSIGN(LoadStaticFieldInstr); | 3409 DISALLOW_COPY_AND_ASSIGN(LoadStaticFieldInstr); |
| 3406 }; | 3410 }; |
| 3407 | 3411 |
| 3408 | 3412 |
| 3409 class StoreStaticFieldInstr : public TemplateDefinition<1> { | 3413 class StoreStaticFieldInstr : public TemplateDefinition<1> { |
| 3410 public: | 3414 public: |
| 3411 StoreStaticFieldInstr(const Field& field, Value* value) | 3415 StoreStaticFieldInstr(const Field& field, Value* value) |
| 3412 : field_(field) { | 3416 : field_(field) { |
| 3413 ASSERT(field.IsZoneHandle()); | 3417 ASSERT(field.IsZoneHandle()); |
| 3414 SetInputAt(0, value); | 3418 SetInputAt(0, value); |
| (...skipping 3052 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6467 ForwardInstructionIterator* current_iterator_; | 6471 ForwardInstructionIterator* current_iterator_; |
| 6468 | 6472 |
| 6469 private: | 6473 private: |
| 6470 DISALLOW_COPY_AND_ASSIGN(FlowGraphVisitor); | 6474 DISALLOW_COPY_AND_ASSIGN(FlowGraphVisitor); |
| 6471 }; | 6475 }; |
| 6472 | 6476 |
| 6473 | 6477 |
| 6474 } // namespace dart | 6478 } // namespace dart |
| 6475 | 6479 |
| 6476 #endif // VM_INTERMEDIATE_LANGUAGE_H_ | 6480 #endif // VM_INTERMEDIATE_LANGUAGE_H_ |
| OLD | NEW |