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