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_IA32_LITHIUM_IA32_H_ | 5 #ifndef V8_IA32_LITHIUM_IA32_H_ |
6 #define V8_IA32_LITHIUM_IA32_H_ | 6 #define V8_IA32_LITHIUM_IA32_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 2732 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2743 int num_double_slots() const { return num_double_slots_; } | 2743 int num_double_slots() const { return num_double_slots_; } |
2744 | 2744 |
2745 private: | 2745 private: |
2746 int num_double_slots_; | 2746 int num_double_slots_; |
2747 }; | 2747 }; |
2748 | 2748 |
2749 | 2749 |
2750 class LChunkBuilder FINAL : public LChunkBuilderBase { | 2750 class LChunkBuilder FINAL : public LChunkBuilderBase { |
2751 public: | 2751 public: |
2752 LChunkBuilder(CompilationInfo* info, HGraph* graph, LAllocator* allocator) | 2752 LChunkBuilder(CompilationInfo* info, HGraph* graph, LAllocator* allocator) |
2753 : LChunkBuilderBase(graph->zone()), | 2753 : LChunkBuilderBase(info, graph), |
2754 chunk_(NULL), | |
2755 info_(info), | |
2756 graph_(graph), | |
2757 status_(UNUSED), | |
2758 current_instruction_(NULL), | 2754 current_instruction_(NULL), |
2759 current_block_(NULL), | 2755 current_block_(NULL), |
2760 next_block_(NULL), | 2756 next_block_(NULL), |
2761 allocator_(allocator) { } | 2757 allocator_(allocator) {} |
2762 | |
2763 Isolate* isolate() const { return graph_->isolate(); } | |
2764 | 2758 |
2765 // Build the sequence for the graph. | 2759 // Build the sequence for the graph. |
2766 LPlatformChunk* Build(); | 2760 LPlatformChunk* Build(); |
2767 | 2761 |
2768 // Declare methods that deal with the individual node types. | 2762 // Declare methods that deal with the individual node types. |
2769 #define DECLARE_DO(type) LInstruction* Do##type(H##type* node); | 2763 #define DECLARE_DO(type) LInstruction* Do##type(H##type* node); |
2770 HYDROGEN_CONCRETE_INSTRUCTION_LIST(DECLARE_DO) | 2764 HYDROGEN_CONCRETE_INSTRUCTION_LIST(DECLARE_DO) |
2771 #undef DECLARE_DO | 2765 #undef DECLARE_DO |
2772 | 2766 |
2773 LInstruction* DoMathFloor(HUnaryMathOperation* instr); | 2767 LInstruction* DoMathFloor(HUnaryMathOperation* instr); |
2774 LInstruction* DoMathRound(HUnaryMathOperation* instr); | 2768 LInstruction* DoMathRound(HUnaryMathOperation* instr); |
2775 LInstruction* DoMathFround(HUnaryMathOperation* instr); | 2769 LInstruction* DoMathFround(HUnaryMathOperation* instr); |
2776 LInstruction* DoMathAbs(HUnaryMathOperation* instr); | 2770 LInstruction* DoMathAbs(HUnaryMathOperation* instr); |
2777 LInstruction* DoMathLog(HUnaryMathOperation* instr); | 2771 LInstruction* DoMathLog(HUnaryMathOperation* instr); |
2778 LInstruction* DoMathExp(HUnaryMathOperation* instr); | 2772 LInstruction* DoMathExp(HUnaryMathOperation* instr); |
2779 LInstruction* DoMathSqrt(HUnaryMathOperation* instr); | 2773 LInstruction* DoMathSqrt(HUnaryMathOperation* instr); |
2780 LInstruction* DoMathPowHalf(HUnaryMathOperation* instr); | 2774 LInstruction* DoMathPowHalf(HUnaryMathOperation* instr); |
2781 LInstruction* DoMathClz32(HUnaryMathOperation* instr); | 2775 LInstruction* DoMathClz32(HUnaryMathOperation* instr); |
2782 LInstruction* DoDivByPowerOf2I(HDiv* instr); | 2776 LInstruction* DoDivByPowerOf2I(HDiv* instr); |
2783 LInstruction* DoDivByConstI(HDiv* instr); | 2777 LInstruction* DoDivByConstI(HDiv* instr); |
2784 LInstruction* DoDivI(HDiv* instr); | 2778 LInstruction* DoDivI(HDiv* instr); |
2785 LInstruction* DoModByPowerOf2I(HMod* instr); | 2779 LInstruction* DoModByPowerOf2I(HMod* instr); |
2786 LInstruction* DoModByConstI(HMod* instr); | 2780 LInstruction* DoModByConstI(HMod* instr); |
2787 LInstruction* DoModI(HMod* instr); | 2781 LInstruction* DoModI(HMod* instr); |
2788 LInstruction* DoFlooringDivByPowerOf2I(HMathFloorOfDiv* instr); | 2782 LInstruction* DoFlooringDivByPowerOf2I(HMathFloorOfDiv* instr); |
2789 LInstruction* DoFlooringDivByConstI(HMathFloorOfDiv* instr); | 2783 LInstruction* DoFlooringDivByConstI(HMathFloorOfDiv* instr); |
2790 LInstruction* DoFlooringDivI(HMathFloorOfDiv* instr); | 2784 LInstruction* DoFlooringDivI(HMathFloorOfDiv* instr); |
2791 | 2785 |
2792 private: | 2786 private: |
2793 enum Status { | |
2794 UNUSED, | |
2795 BUILDING, | |
2796 DONE, | |
2797 ABORTED | |
2798 }; | |
2799 | |
2800 LPlatformChunk* chunk() const { return chunk_; } | |
2801 CompilationInfo* info() const { return info_; } | |
2802 HGraph* graph() const { return graph_; } | |
2803 | |
2804 bool is_unused() const { return status_ == UNUSED; } | |
2805 bool is_building() const { return status_ == BUILDING; } | |
2806 bool is_done() const { return status_ == DONE; } | |
2807 bool is_aborted() const { return status_ == ABORTED; } | |
2808 | |
2809 void Abort(BailoutReason reason); | |
2810 | |
2811 // Methods for getting operands for Use / Define / Temp. | 2787 // Methods for getting operands for Use / Define / Temp. |
2812 LUnallocated* ToUnallocated(Register reg); | 2788 LUnallocated* ToUnallocated(Register reg); |
2813 LUnallocated* ToUnallocated(XMMRegister reg); | 2789 LUnallocated* ToUnallocated(XMMRegister reg); |
2814 | 2790 |
2815 // Methods for setting up define-use relationships. | 2791 // Methods for setting up define-use relationships. |
2816 MUST_USE_RESULT LOperand* Use(HValue* value, LUnallocated* operand); | 2792 MUST_USE_RESULT LOperand* Use(HValue* value, LUnallocated* operand); |
2817 MUST_USE_RESULT LOperand* UseFixed(HValue* value, Register fixed_register); | 2793 MUST_USE_RESULT LOperand* UseFixed(HValue* value, Register fixed_register); |
2818 MUST_USE_RESULT LOperand* UseFixedDouble(HValue* value, | 2794 MUST_USE_RESULT LOperand* UseFixedDouble(HValue* value, |
2819 XMMRegister fixed_register); | 2795 XMMRegister fixed_register); |
2820 | 2796 |
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2896 | 2872 |
2897 void DoBasicBlock(HBasicBlock* block, HBasicBlock* next_block); | 2873 void DoBasicBlock(HBasicBlock* block, HBasicBlock* next_block); |
2898 LInstruction* DoShift(Token::Value op, HBitwiseBinaryOperation* instr); | 2874 LInstruction* DoShift(Token::Value op, HBitwiseBinaryOperation* instr); |
2899 LInstruction* DoArithmeticD(Token::Value op, | 2875 LInstruction* DoArithmeticD(Token::Value op, |
2900 HArithmeticBinaryOperation* instr); | 2876 HArithmeticBinaryOperation* instr); |
2901 LInstruction* DoArithmeticT(Token::Value op, | 2877 LInstruction* DoArithmeticT(Token::Value op, |
2902 HBinaryOperation* instr); | 2878 HBinaryOperation* instr); |
2903 | 2879 |
2904 LOperand* GetStoreKeyedValueOperand(HStoreKeyed* instr); | 2880 LOperand* GetStoreKeyedValueOperand(HStoreKeyed* instr); |
2905 | 2881 |
2906 LPlatformChunk* chunk_; | |
2907 CompilationInfo* info_; | |
2908 HGraph* const graph_; | |
2909 Status status_; | |
2910 HInstruction* current_instruction_; | 2882 HInstruction* current_instruction_; |
2911 HBasicBlock* current_block_; | 2883 HBasicBlock* current_block_; |
2912 HBasicBlock* next_block_; | 2884 HBasicBlock* next_block_; |
2913 LAllocator* allocator_; | 2885 LAllocator* allocator_; |
2914 | 2886 |
2915 DISALLOW_COPY_AND_ASSIGN(LChunkBuilder); | 2887 DISALLOW_COPY_AND_ASSIGN(LChunkBuilder); |
2916 }; | 2888 }; |
2917 | 2889 |
2918 #undef DECLARE_HYDROGEN_ACCESSOR | 2890 #undef DECLARE_HYDROGEN_ACCESSOR |
2919 #undef DECLARE_CONCRETE_INSTRUCTION | 2891 #undef DECLARE_CONCRETE_INSTRUCTION |
2920 | 2892 |
2921 } } // namespace v8::internal | 2893 } } // namespace v8::internal |
2922 | 2894 |
2923 #endif // V8_IA32_LITHIUM_IA32_H_ | 2895 #endif // V8_IA32_LITHIUM_IA32_H_ |
OLD | NEW |