| 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 2630 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2641 | 2641 |
| 2642 // 'True' for recognized list constructors. | 2642 // 'True' for recognized list constructors. |
| 2643 bool is_known_list_constructor_; | 2643 bool is_known_list_constructor_; |
| 2644 | 2644 |
| 2645 DISALLOW_COPY_AND_ASSIGN(StaticCallInstr); | 2645 DISALLOW_COPY_AND_ASSIGN(StaticCallInstr); |
| 2646 }; | 2646 }; |
| 2647 | 2647 |
| 2648 | 2648 |
| 2649 class LoadLocalInstr : public TemplateDefinition<0> { | 2649 class LoadLocalInstr : public TemplateDefinition<0> { |
| 2650 public: | 2650 public: |
| 2651 LoadLocalInstr(const LocalVariable& local, intptr_t context_level) | 2651 explicit LoadLocalInstr(const LocalVariable& local) : local_(local) { } |
| 2652 : local_(local), | |
| 2653 context_level_(context_level) { } | |
| 2654 | 2652 |
| 2655 DECLARE_INSTRUCTION(LoadLocal) | 2653 DECLARE_INSTRUCTION(LoadLocal) |
| 2656 virtual CompileType ComputeType() const; | 2654 virtual CompileType ComputeType() const; |
| 2657 | 2655 |
| 2658 const LocalVariable& local() const { return local_; } | 2656 const LocalVariable& local() const { return local_; } |
| 2659 intptr_t context_level() const { return context_level_; } | |
| 2660 | 2657 |
| 2661 virtual void PrintOperandsTo(BufferFormatter* f) const; | 2658 virtual void PrintOperandsTo(BufferFormatter* f) const; |
| 2662 | 2659 |
| 2663 virtual bool CanDeoptimize() const { return false; } | 2660 virtual bool CanDeoptimize() const { return false; } |
| 2664 | 2661 |
| 2665 virtual bool HasSideEffect() const { | 2662 virtual bool HasSideEffect() const { |
| 2666 UNREACHABLE(); | 2663 UNREACHABLE(); |
| 2667 return false; | 2664 return false; |
| 2668 } | 2665 } |
| 2669 | 2666 |
| 2670 private: | 2667 private: |
| 2671 const LocalVariable& local_; | 2668 const LocalVariable& local_; |
| 2672 const intptr_t context_level_; | |
| 2673 | 2669 |
| 2674 DISALLOW_COPY_AND_ASSIGN(LoadLocalInstr); | 2670 DISALLOW_COPY_AND_ASSIGN(LoadLocalInstr); |
| 2675 }; | 2671 }; |
| 2676 | 2672 |
| 2677 | 2673 |
| 2678 class StoreLocalInstr : public TemplateDefinition<1> { | 2674 class StoreLocalInstr : public TemplateDefinition<1> { |
| 2679 public: | 2675 public: |
| 2680 StoreLocalInstr(const LocalVariable& local, | 2676 StoreLocalInstr(const LocalVariable& local, Value* value) : local_(local) { |
| 2681 Value* value, | |
| 2682 intptr_t context_level) | |
| 2683 : local_(local), | |
| 2684 context_level_(context_level) { | |
| 2685 SetInputAt(0, value); | 2677 SetInputAt(0, value); |
| 2686 } | 2678 } |
| 2687 | 2679 |
| 2688 DECLARE_INSTRUCTION(StoreLocal) | 2680 DECLARE_INSTRUCTION(StoreLocal) |
| 2689 virtual CompileType* ComputeInitialType() const; | 2681 virtual CompileType* ComputeInitialType() const; |
| 2690 | 2682 |
| 2691 const LocalVariable& local() const { return local_; } | 2683 const LocalVariable& local() const { return local_; } |
| 2692 Value* value() const { return inputs_[0]; } | 2684 Value* value() const { return inputs_[0]; } |
| 2693 intptr_t context_level() const { return context_level_; } | |
| 2694 | 2685 |
| 2695 virtual void RecordAssignedVars(BitVector* assigned_vars, | 2686 virtual void RecordAssignedVars(BitVector* assigned_vars, |
| 2696 intptr_t fixed_parameter_count); | 2687 intptr_t fixed_parameter_count); |
| 2697 | 2688 |
| 2698 virtual void PrintOperandsTo(BufferFormatter* f) const; | 2689 virtual void PrintOperandsTo(BufferFormatter* f) const; |
| 2699 | 2690 |
| 2700 virtual bool CanDeoptimize() const { return false; } | 2691 virtual bool CanDeoptimize() const { return false; } |
| 2701 | 2692 |
| 2702 virtual bool HasSideEffect() const { | 2693 virtual bool HasSideEffect() const { |
| 2703 UNREACHABLE(); | 2694 UNREACHABLE(); |
| 2704 return false; | 2695 return false; |
| 2705 } | 2696 } |
| 2706 | 2697 |
| 2707 private: | 2698 private: |
| 2708 const LocalVariable& local_; | 2699 const LocalVariable& local_; |
| 2709 const intptr_t context_level_; | |
| 2710 | 2700 |
| 2711 DISALLOW_COPY_AND_ASSIGN(StoreLocalInstr); | 2701 DISALLOW_COPY_AND_ASSIGN(StoreLocalInstr); |
| 2712 }; | 2702 }; |
| 2713 | 2703 |
| 2714 | 2704 |
| 2715 class NativeCallInstr : public TemplateDefinition<0> { | 2705 class NativeCallInstr : public TemplateDefinition<0> { |
| 2716 public: | 2706 public: |
| 2717 explicit NativeCallInstr(NativeBodyNode* node) | 2707 explicit NativeCallInstr(NativeBodyNode* node) |
| 2718 : ast_node_(*node) {} | 2708 : ast_node_(*node) {} |
| 2719 | 2709 |
| (...skipping 1794 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4514 ForwardInstructionIterator* current_iterator_; | 4504 ForwardInstructionIterator* current_iterator_; |
| 4515 | 4505 |
| 4516 private: | 4506 private: |
| 4517 DISALLOW_COPY_AND_ASSIGN(FlowGraphVisitor); | 4507 DISALLOW_COPY_AND_ASSIGN(FlowGraphVisitor); |
| 4518 }; | 4508 }; |
| 4519 | 4509 |
| 4520 | 4510 |
| 4521 } // namespace dart | 4511 } // namespace dart |
| 4522 | 4512 |
| 4523 #endif // VM_INTERMEDIATE_LANGUAGE_H_ | 4513 #endif // VM_INTERMEDIATE_LANGUAGE_H_ |
| OLD | NEW |