OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef V8_MIPS_LITHIUM_MIPS_H_ | 5 #ifndef V8_MIPS_LITHIUM_MIPS_H_ |
6 #define V8_MIPS_LITHIUM_MIPS_H_ | 6 #define V8_MIPS_LITHIUM_MIPS_H_ |
7 | 7 |
8 #include "src/hydrogen.h" | 8 #include "src/hydrogen.h" |
9 #include "src/lithium.h" | 9 #include "src/lithium.h" |
10 #include "src/lithium-allocator.h" | 10 #include "src/lithium-allocator.h" |
(...skipping 2700 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2711 : LChunk(info, graph) { } | 2711 : LChunk(info, graph) { } |
2712 | 2712 |
2713 int GetNextSpillIndex(RegisterKind kind); | 2713 int GetNextSpillIndex(RegisterKind kind); |
2714 LOperand* GetNextSpillSlot(RegisterKind kind); | 2714 LOperand* GetNextSpillSlot(RegisterKind kind); |
2715 }; | 2715 }; |
2716 | 2716 |
2717 | 2717 |
2718 class LChunkBuilder FINAL : public LChunkBuilderBase { | 2718 class LChunkBuilder FINAL : public LChunkBuilderBase { |
2719 public: | 2719 public: |
2720 LChunkBuilder(CompilationInfo* info, HGraph* graph, LAllocator* allocator) | 2720 LChunkBuilder(CompilationInfo* info, HGraph* graph, LAllocator* allocator) |
2721 : LChunkBuilderBase(graph->zone()), | 2721 : LChunkBuilderBase(info, graph), |
2722 chunk_(NULL), | |
2723 info_(info), | |
2724 graph_(graph), | |
2725 status_(UNUSED), | |
2726 current_instruction_(NULL), | 2722 current_instruction_(NULL), |
2727 current_block_(NULL), | 2723 current_block_(NULL), |
2728 next_block_(NULL), | 2724 next_block_(NULL), |
2729 allocator_(allocator) { } | 2725 allocator_(allocator) {} |
2730 | |
2731 Isolate* isolate() const { return graph_->isolate(); } | |
2732 | 2726 |
2733 // Build the sequence for the graph. | 2727 // Build the sequence for the graph. |
2734 LPlatformChunk* Build(); | 2728 LPlatformChunk* Build(); |
2735 | 2729 |
2736 // Declare methods that deal with the individual node types. | 2730 // Declare methods that deal with the individual node types. |
2737 #define DECLARE_DO(type) LInstruction* Do##type(H##type* node); | 2731 #define DECLARE_DO(type) LInstruction* Do##type(H##type* node); |
2738 HYDROGEN_CONCRETE_INSTRUCTION_LIST(DECLARE_DO) | 2732 HYDROGEN_CONCRETE_INSTRUCTION_LIST(DECLARE_DO) |
2739 #undef DECLARE_DO | 2733 #undef DECLARE_DO |
2740 | 2734 |
2741 LInstruction* DoMultiplyAdd(HMul* mul, HValue* addend); | 2735 LInstruction* DoMultiplyAdd(HMul* mul, HValue* addend); |
(...skipping 13 matching lines...) Expand all Loading... |
2755 LInstruction* DoDivByConstI(HDiv* instr); | 2749 LInstruction* DoDivByConstI(HDiv* instr); |
2756 LInstruction* DoDivI(HDiv* instr); | 2750 LInstruction* DoDivI(HDiv* instr); |
2757 LInstruction* DoModByPowerOf2I(HMod* instr); | 2751 LInstruction* DoModByPowerOf2I(HMod* instr); |
2758 LInstruction* DoModByConstI(HMod* instr); | 2752 LInstruction* DoModByConstI(HMod* instr); |
2759 LInstruction* DoModI(HMod* instr); | 2753 LInstruction* DoModI(HMod* instr); |
2760 LInstruction* DoFlooringDivByPowerOf2I(HMathFloorOfDiv* instr); | 2754 LInstruction* DoFlooringDivByPowerOf2I(HMathFloorOfDiv* instr); |
2761 LInstruction* DoFlooringDivByConstI(HMathFloorOfDiv* instr); | 2755 LInstruction* DoFlooringDivByConstI(HMathFloorOfDiv* instr); |
2762 LInstruction* DoFlooringDivI(HMathFloorOfDiv* instr); | 2756 LInstruction* DoFlooringDivI(HMathFloorOfDiv* instr); |
2763 | 2757 |
2764 private: | 2758 private: |
2765 enum Status { | |
2766 UNUSED, | |
2767 BUILDING, | |
2768 DONE, | |
2769 ABORTED | |
2770 }; | |
2771 | |
2772 LPlatformChunk* chunk() const { return chunk_; } | |
2773 CompilationInfo* info() const { return info_; } | |
2774 HGraph* graph() const { return graph_; } | |
2775 | |
2776 bool is_unused() const { return status_ == UNUSED; } | |
2777 bool is_building() const { return status_ == BUILDING; } | |
2778 bool is_done() const { return status_ == DONE; } | |
2779 bool is_aborted() const { return status_ == ABORTED; } | |
2780 | |
2781 void Abort(BailoutReason reason); | |
2782 | |
2783 // Methods for getting operands for Use / Define / Temp. | 2759 // Methods for getting operands for Use / Define / Temp. |
2784 LUnallocated* ToUnallocated(Register reg); | 2760 LUnallocated* ToUnallocated(Register reg); |
2785 LUnallocated* ToUnallocated(DoubleRegister reg); | 2761 LUnallocated* ToUnallocated(DoubleRegister reg); |
2786 | 2762 |
2787 // Methods for setting up define-use relationships. | 2763 // Methods for setting up define-use relationships. |
2788 MUST_USE_RESULT LOperand* Use(HValue* value, LUnallocated* operand); | 2764 MUST_USE_RESULT LOperand* Use(HValue* value, LUnallocated* operand); |
2789 MUST_USE_RESULT LOperand* UseFixed(HValue* value, Register fixed_register); | 2765 MUST_USE_RESULT LOperand* UseFixed(HValue* value, Register fixed_register); |
2790 MUST_USE_RESULT LOperand* UseFixedDouble(HValue* value, | 2766 MUST_USE_RESULT LOperand* UseFixedDouble(HValue* value, |
2791 DoubleRegister fixed_register); | 2767 DoubleRegister fixed_register); |
2792 | 2768 |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2858 void AddInstruction(LInstruction* instr, HInstruction* current); | 2834 void AddInstruction(LInstruction* instr, HInstruction* current); |
2859 | 2835 |
2860 void DoBasicBlock(HBasicBlock* block, HBasicBlock* next_block); | 2836 void DoBasicBlock(HBasicBlock* block, HBasicBlock* next_block); |
2861 LInstruction* DoBit(Token::Value op, HBitwiseBinaryOperation* instr); | 2837 LInstruction* DoBit(Token::Value op, HBitwiseBinaryOperation* instr); |
2862 LInstruction* DoShift(Token::Value op, HBitwiseBinaryOperation* instr); | 2838 LInstruction* DoShift(Token::Value op, HBitwiseBinaryOperation* instr); |
2863 LInstruction* DoArithmeticD(Token::Value op, | 2839 LInstruction* DoArithmeticD(Token::Value op, |
2864 HArithmeticBinaryOperation* instr); | 2840 HArithmeticBinaryOperation* instr); |
2865 LInstruction* DoArithmeticT(Token::Value op, | 2841 LInstruction* DoArithmeticT(Token::Value op, |
2866 HBinaryOperation* instr); | 2842 HBinaryOperation* instr); |
2867 | 2843 |
2868 LPlatformChunk* chunk_; | |
2869 CompilationInfo* info_; | |
2870 HGraph* const graph_; | |
2871 Status status_; | |
2872 HInstruction* current_instruction_; | 2844 HInstruction* current_instruction_; |
2873 HBasicBlock* current_block_; | 2845 HBasicBlock* current_block_; |
2874 HBasicBlock* next_block_; | 2846 HBasicBlock* next_block_; |
2875 LAllocator* allocator_; | 2847 LAllocator* allocator_; |
2876 | 2848 |
2877 DISALLOW_COPY_AND_ASSIGN(LChunkBuilder); | 2849 DISALLOW_COPY_AND_ASSIGN(LChunkBuilder); |
2878 }; | 2850 }; |
2879 | 2851 |
2880 #undef DECLARE_HYDROGEN_ACCESSOR | 2852 #undef DECLARE_HYDROGEN_ACCESSOR |
2881 #undef DECLARE_CONCRETE_INSTRUCTION | 2853 #undef DECLARE_CONCRETE_INSTRUCTION |
2882 | 2854 |
2883 } } // namespace v8::internal | 2855 } } // namespace v8::internal |
2884 | 2856 |
2885 #endif // V8_MIPS_LITHIUM_MIPS_H_ | 2857 #endif // V8_MIPS_LITHIUM_MIPS_H_ |
OLD | NEW |