OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 2655 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2666 class LPlatformChunk V8_FINAL : public LChunk { | 2666 class LPlatformChunk V8_FINAL : public LChunk { |
2667 public: | 2667 public: |
2668 LPlatformChunk(CompilationInfo* info, HGraph* graph) | 2668 LPlatformChunk(CompilationInfo* info, HGraph* graph) |
2669 : LChunk(info, graph) { } | 2669 : LChunk(info, graph) { } |
2670 | 2670 |
2671 int GetNextSpillIndex(RegisterKind kind); | 2671 int GetNextSpillIndex(RegisterKind kind); |
2672 LOperand* GetNextSpillSlot(RegisterKind kind); | 2672 LOperand* GetNextSpillSlot(RegisterKind kind); |
2673 }; | 2673 }; |
2674 | 2674 |
2675 | 2675 |
2676 class LChunkBuilder V8_FINAL BASE_EMBEDDED { | 2676 class LChunkBuilder V8_FINAL : public LChunkBuilderBase { |
2677 public: | 2677 public: |
2678 LChunkBuilder(CompilationInfo* info, HGraph* graph, LAllocator* allocator) | 2678 LChunkBuilder(CompilationInfo* info, HGraph* graph, LAllocator* allocator) |
2679 : chunk_(NULL), | 2679 : LChunkBuilderBase(graph->zone()), |
| 2680 chunk_(NULL), |
2680 info_(info), | 2681 info_(info), |
2681 graph_(graph), | 2682 graph_(graph), |
2682 zone_(graph->zone()), | |
2683 status_(UNUSED), | 2683 status_(UNUSED), |
2684 current_instruction_(NULL), | 2684 current_instruction_(NULL), |
2685 current_block_(NULL), | 2685 current_block_(NULL), |
2686 next_block_(NULL), | 2686 next_block_(NULL), |
2687 argument_count_(0), | |
2688 allocator_(allocator), | 2687 allocator_(allocator), |
2689 position_(RelocInfo::kNoPosition), | 2688 position_(RelocInfo::kNoPosition), |
2690 instruction_pending_deoptimization_environment_(NULL), | 2689 instruction_pending_deoptimization_environment_(NULL), |
2691 pending_deoptimization_ast_id_(BailoutId::None()) { } | 2690 pending_deoptimization_ast_id_(BailoutId::None()) { } |
2692 | 2691 |
2693 // Build the sequence for the graph. | 2692 // Build the sequence for the graph. |
2694 LPlatformChunk* Build(); | 2693 LPlatformChunk* Build(); |
2695 | 2694 |
2696 LInstruction* CheckElideControlInstruction(HControlInstruction* instr); | 2695 LInstruction* CheckElideControlInstruction(HControlInstruction* instr); |
2697 | 2696 |
(...skipping 19 matching lines...) Expand all Loading... |
2717 enum Status { | 2716 enum Status { |
2718 UNUSED, | 2717 UNUSED, |
2719 BUILDING, | 2718 BUILDING, |
2720 DONE, | 2719 DONE, |
2721 ABORTED | 2720 ABORTED |
2722 }; | 2721 }; |
2723 | 2722 |
2724 LPlatformChunk* chunk() const { return chunk_; } | 2723 LPlatformChunk* chunk() const { return chunk_; } |
2725 CompilationInfo* info() const { return info_; } | 2724 CompilationInfo* info() const { return info_; } |
2726 HGraph* graph() const { return graph_; } | 2725 HGraph* graph() const { return graph_; } |
2727 Zone* zone() const { return zone_; } | |
2728 | 2726 |
2729 bool is_unused() const { return status_ == UNUSED; } | 2727 bool is_unused() const { return status_ == UNUSED; } |
2730 bool is_building() const { return status_ == BUILDING; } | 2728 bool is_building() const { return status_ == BUILDING; } |
2731 bool is_done() const { return status_ == DONE; } | 2729 bool is_done() const { return status_ == DONE; } |
2732 bool is_aborted() const { return status_ == ABORTED; } | 2730 bool is_aborted() const { return status_ == ABORTED; } |
2733 | 2731 |
2734 void Abort(BailoutReason reason); | 2732 void Abort(BailoutReason reason); |
2735 | 2733 |
2736 // Methods for getting operands for Use / Define / Temp. | 2734 // Methods for getting operands for Use / Define / Temp. |
2737 LUnallocated* ToUnallocated(Register reg); | 2735 LUnallocated* ToUnallocated(Register reg); |
(...skipping 29 matching lines...) Expand all Loading... |
2767 | 2765 |
2768 // An input operand in a register or a constant operand. | 2766 // An input operand in a register or a constant operand. |
2769 MUST_USE_RESULT LOperand* UseRegisterOrConstant(HValue* value); | 2767 MUST_USE_RESULT LOperand* UseRegisterOrConstant(HValue* value); |
2770 MUST_USE_RESULT LOperand* UseRegisterOrConstantAtStart(HValue* value); | 2768 MUST_USE_RESULT LOperand* UseRegisterOrConstantAtStart(HValue* value); |
2771 | 2769 |
2772 // An input operand in a constant operand. | 2770 // An input operand in a constant operand. |
2773 MUST_USE_RESULT LOperand* UseConstant(HValue* value); | 2771 MUST_USE_RESULT LOperand* UseConstant(HValue* value); |
2774 | 2772 |
2775 // An input operand in register, stack slot or a constant operand. | 2773 // An input operand in register, stack slot or a constant operand. |
2776 // Will not be moved to a register even if one is freely available. | 2774 // Will not be moved to a register even if one is freely available. |
2777 MUST_USE_RESULT LOperand* UseAny(HValue* value); | 2775 virtual MUST_USE_RESULT LOperand* UseAny(HValue* value) V8_OVERRIDE; |
2778 | 2776 |
2779 // Temporary operand that must be in a register. | 2777 // Temporary operand that must be in a register. |
2780 MUST_USE_RESULT LUnallocated* TempRegister(); | 2778 MUST_USE_RESULT LUnallocated* TempRegister(); |
2781 MUST_USE_RESULT LOperand* FixedTemp(Register reg); | 2779 MUST_USE_RESULT LOperand* FixedTemp(Register reg); |
2782 MUST_USE_RESULT LOperand* FixedTemp(DoubleRegister reg); | 2780 MUST_USE_RESULT LOperand* FixedTemp(DoubleRegister reg); |
2783 | 2781 |
2784 // Methods for setting up define-use relationships. | 2782 // Methods for setting up define-use relationships. |
2785 // Return the same instruction that they are passed. | 2783 // Return the same instruction that they are passed. |
2786 template<int I, int T> | 2784 template<int I, int T> |
2787 LInstruction* Define(LTemplateInstruction<1, I, T>* instr, | 2785 LInstruction* Define(LTemplateInstruction<1, I, T>* instr, |
(...skipping 17 matching lines...) Expand all Loading... |
2805 enum CanDeoptimize { CAN_DEOPTIMIZE_EAGERLY, CANNOT_DEOPTIMIZE_EAGERLY }; | 2803 enum CanDeoptimize { CAN_DEOPTIMIZE_EAGERLY, CANNOT_DEOPTIMIZE_EAGERLY }; |
2806 | 2804 |
2807 // By default we assume that instruction sequences generated for calls | 2805 // By default we assume that instruction sequences generated for calls |
2808 // cannot deoptimize eagerly and we do not attach environment to this | 2806 // cannot deoptimize eagerly and we do not attach environment to this |
2809 // instruction. | 2807 // instruction. |
2810 LInstruction* MarkAsCall( | 2808 LInstruction* MarkAsCall( |
2811 LInstruction* instr, | 2809 LInstruction* instr, |
2812 HInstruction* hinstr, | 2810 HInstruction* hinstr, |
2813 CanDeoptimize can_deoptimize = CANNOT_DEOPTIMIZE_EAGERLY); | 2811 CanDeoptimize can_deoptimize = CANNOT_DEOPTIMIZE_EAGERLY); |
2814 | 2812 |
2815 LEnvironment* CreateEnvironment(HEnvironment* hydrogen_env, | |
2816 int* argument_index_accumulator, | |
2817 ZoneList<HValue*>* objects_to_materialize); | |
2818 | |
2819 void VisitInstruction(HInstruction* current); | 2813 void VisitInstruction(HInstruction* current); |
2820 | 2814 |
2821 void DoBasicBlock(HBasicBlock* block, HBasicBlock* next_block); | 2815 void DoBasicBlock(HBasicBlock* block, HBasicBlock* next_block); |
2822 LInstruction* DoBit(Token::Value op, HBitwiseBinaryOperation* instr); | 2816 LInstruction* DoBit(Token::Value op, HBitwiseBinaryOperation* instr); |
2823 LInstruction* DoShift(Token::Value op, HBitwiseBinaryOperation* instr); | 2817 LInstruction* DoShift(Token::Value op, HBitwiseBinaryOperation* instr); |
2824 LInstruction* DoArithmeticD(Token::Value op, | 2818 LInstruction* DoArithmeticD(Token::Value op, |
2825 HArithmeticBinaryOperation* instr); | 2819 HArithmeticBinaryOperation* instr); |
2826 LInstruction* DoArithmeticT(Token::Value op, | 2820 LInstruction* DoArithmeticT(Token::Value op, |
2827 HBinaryOperation* instr); | 2821 HBinaryOperation* instr); |
2828 | 2822 |
2829 LPlatformChunk* chunk_; | 2823 LPlatformChunk* chunk_; |
2830 CompilationInfo* info_; | 2824 CompilationInfo* info_; |
2831 HGraph* const graph_; | 2825 HGraph* const graph_; |
2832 Zone* zone_; | |
2833 Status status_; | 2826 Status status_; |
2834 HInstruction* current_instruction_; | 2827 HInstruction* current_instruction_; |
2835 HBasicBlock* current_block_; | 2828 HBasicBlock* current_block_; |
2836 HBasicBlock* next_block_; | 2829 HBasicBlock* next_block_; |
2837 int argument_count_; | |
2838 LAllocator* allocator_; | 2830 LAllocator* allocator_; |
2839 int position_; | 2831 int position_; |
2840 LInstruction* instruction_pending_deoptimization_environment_; | 2832 LInstruction* instruction_pending_deoptimization_environment_; |
2841 BailoutId pending_deoptimization_ast_id_; | 2833 BailoutId pending_deoptimization_ast_id_; |
2842 | 2834 |
2843 DISALLOW_COPY_AND_ASSIGN(LChunkBuilder); | 2835 DISALLOW_COPY_AND_ASSIGN(LChunkBuilder); |
2844 }; | 2836 }; |
2845 | 2837 |
2846 #undef DECLARE_HYDROGEN_ACCESSOR | 2838 #undef DECLARE_HYDROGEN_ACCESSOR |
2847 #undef DECLARE_CONCRETE_INSTRUCTION | 2839 #undef DECLARE_CONCRETE_INSTRUCTION |
2848 | 2840 |
2849 } } // namespace v8::internal | 2841 } } // namespace v8::internal |
2850 | 2842 |
2851 #endif // V8_MIPS_LITHIUM_MIPS_H_ | 2843 #endif // V8_MIPS_LITHIUM_MIPS_H_ |
OLD | NEW |