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 2679 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2690 class LPlatformChunk V8_FINAL : public LChunk { | 2690 class LPlatformChunk V8_FINAL : public LChunk { |
2691 public: | 2691 public: |
2692 LPlatformChunk(CompilationInfo* info, HGraph* graph) | 2692 LPlatformChunk(CompilationInfo* info, HGraph* graph) |
2693 : LChunk(info, graph) { } | 2693 : LChunk(info, graph) { } |
2694 | 2694 |
2695 int GetNextSpillIndex(RegisterKind kind); | 2695 int GetNextSpillIndex(RegisterKind kind); |
2696 LOperand* GetNextSpillSlot(RegisterKind kind); | 2696 LOperand* GetNextSpillSlot(RegisterKind kind); |
2697 }; | 2697 }; |
2698 | 2698 |
2699 | 2699 |
2700 class LChunkBuilder V8_FINAL BASE_EMBEDDED { | 2700 class LChunkBuilder V8_FINAL : public LChunkBuilderBase { |
2701 public: | 2701 public: |
2702 LChunkBuilder(CompilationInfo* info, HGraph* graph, LAllocator* allocator) | 2702 LChunkBuilder(CompilationInfo* info, HGraph* graph, LAllocator* allocator) |
2703 : chunk_(NULL), | 2703 : LChunkBuilderBase(graph->zone()), |
| 2704 chunk_(NULL), |
2704 info_(info), | 2705 info_(info), |
2705 graph_(graph), | 2706 graph_(graph), |
2706 zone_(graph->zone()), | |
2707 status_(UNUSED), | 2707 status_(UNUSED), |
2708 current_instruction_(NULL), | 2708 current_instruction_(NULL), |
2709 current_block_(NULL), | 2709 current_block_(NULL), |
2710 next_block_(NULL), | 2710 next_block_(NULL), |
2711 argument_count_(0), | |
2712 allocator_(allocator), | 2711 allocator_(allocator), |
2713 position_(RelocInfo::kNoPosition), | 2712 position_(RelocInfo::kNoPosition), |
2714 instruction_pending_deoptimization_environment_(NULL), | 2713 instruction_pending_deoptimization_environment_(NULL), |
2715 pending_deoptimization_ast_id_(BailoutId::None()) { } | 2714 pending_deoptimization_ast_id_(BailoutId::None()) { } |
2716 | 2715 |
2717 // Build the sequence for the graph. | 2716 // Build the sequence for the graph. |
2718 LPlatformChunk* Build(); | 2717 LPlatformChunk* Build(); |
2719 | 2718 |
2720 LInstruction* CheckElideControlInstruction(HControlInstruction* instr); | 2719 LInstruction* CheckElideControlInstruction(HControlInstruction* instr); |
2721 | 2720 |
(...skipping 21 matching lines...) Expand all Loading... |
2743 enum Status { | 2742 enum Status { |
2744 UNUSED, | 2743 UNUSED, |
2745 BUILDING, | 2744 BUILDING, |
2746 DONE, | 2745 DONE, |
2747 ABORTED | 2746 ABORTED |
2748 }; | 2747 }; |
2749 | 2748 |
2750 LPlatformChunk* chunk() const { return chunk_; } | 2749 LPlatformChunk* chunk() const { return chunk_; } |
2751 CompilationInfo* info() const { return info_; } | 2750 CompilationInfo* info() const { return info_; } |
2752 HGraph* graph() const { return graph_; } | 2751 HGraph* graph() const { return graph_; } |
2753 Zone* zone() const { return zone_; } | |
2754 | 2752 |
2755 bool is_unused() const { return status_ == UNUSED; } | 2753 bool is_unused() const { return status_ == UNUSED; } |
2756 bool is_building() const { return status_ == BUILDING; } | 2754 bool is_building() const { return status_ == BUILDING; } |
2757 bool is_done() const { return status_ == DONE; } | 2755 bool is_done() const { return status_ == DONE; } |
2758 bool is_aborted() const { return status_ == ABORTED; } | 2756 bool is_aborted() const { return status_ == ABORTED; } |
2759 | 2757 |
2760 void Abort(BailoutReason reason); | 2758 void Abort(BailoutReason reason); |
2761 | 2759 |
2762 // Methods for getting operands for Use / Define / Temp. | 2760 // Methods for getting operands for Use / Define / Temp. |
2763 LUnallocated* ToUnallocated(Register reg); | 2761 LUnallocated* ToUnallocated(Register reg); |
(...skipping 29 matching lines...) Expand all Loading... |
2793 | 2791 |
2794 // An input operand in a register or a constant operand. | 2792 // An input operand in a register or a constant operand. |
2795 MUST_USE_RESULT LOperand* UseRegisterOrConstant(HValue* value); | 2793 MUST_USE_RESULT LOperand* UseRegisterOrConstant(HValue* value); |
2796 MUST_USE_RESULT LOperand* UseRegisterOrConstantAtStart(HValue* value); | 2794 MUST_USE_RESULT LOperand* UseRegisterOrConstantAtStart(HValue* value); |
2797 | 2795 |
2798 // An input operand in a constant operand. | 2796 // An input operand in a constant operand. |
2799 MUST_USE_RESULT LOperand* UseConstant(HValue* value); | 2797 MUST_USE_RESULT LOperand* UseConstant(HValue* value); |
2800 | 2798 |
2801 // An input operand in register, stack slot or a constant operand. | 2799 // An input operand in register, stack slot or a constant operand. |
2802 // Will not be moved to a register even if one is freely available. | 2800 // Will not be moved to a register even if one is freely available. |
2803 MUST_USE_RESULT LOperand* UseAny(HValue* value); | 2801 virtual MUST_USE_RESULT LOperand* UseAny(HValue* value) V8_OVERRIDE; |
2804 | 2802 |
2805 // Temporary operand that must be in a register. | 2803 // Temporary operand that must be in a register. |
2806 MUST_USE_RESULT LUnallocated* TempRegister(); | 2804 MUST_USE_RESULT LUnallocated* TempRegister(); |
2807 MUST_USE_RESULT LOperand* FixedTemp(Register reg); | 2805 MUST_USE_RESULT LOperand* FixedTemp(Register reg); |
2808 MUST_USE_RESULT LOperand* FixedTemp(DoubleRegister reg); | 2806 MUST_USE_RESULT LOperand* FixedTemp(DoubleRegister reg); |
2809 | 2807 |
2810 // Methods for setting up define-use relationships. | 2808 // Methods for setting up define-use relationships. |
2811 // Return the same instruction that they are passed. | 2809 // Return the same instruction that they are passed. |
2812 template<int I, int T> | 2810 template<int I, int T> |
2813 LInstruction* Define(LTemplateInstruction<1, I, T>* instr, | 2811 LInstruction* Define(LTemplateInstruction<1, I, T>* instr, |
(...skipping 17 matching lines...) Expand all Loading... |
2831 enum CanDeoptimize { CAN_DEOPTIMIZE_EAGERLY, CANNOT_DEOPTIMIZE_EAGERLY }; | 2829 enum CanDeoptimize { CAN_DEOPTIMIZE_EAGERLY, CANNOT_DEOPTIMIZE_EAGERLY }; |
2832 | 2830 |
2833 // By default we assume that instruction sequences generated for calls | 2831 // By default we assume that instruction sequences generated for calls |
2834 // cannot deoptimize eagerly and we do not attach environment to this | 2832 // cannot deoptimize eagerly and we do not attach environment to this |
2835 // instruction. | 2833 // instruction. |
2836 LInstruction* MarkAsCall( | 2834 LInstruction* MarkAsCall( |
2837 LInstruction* instr, | 2835 LInstruction* instr, |
2838 HInstruction* hinstr, | 2836 HInstruction* hinstr, |
2839 CanDeoptimize can_deoptimize = CANNOT_DEOPTIMIZE_EAGERLY); | 2837 CanDeoptimize can_deoptimize = CANNOT_DEOPTIMIZE_EAGERLY); |
2840 | 2838 |
2841 LEnvironment* CreateEnvironment(HEnvironment* hydrogen_env, | |
2842 int* argument_index_accumulator, | |
2843 ZoneList<HValue*>* objects_to_materialize); | |
2844 | |
2845 void VisitInstruction(HInstruction* current); | 2839 void VisitInstruction(HInstruction* current); |
2846 | 2840 |
2847 void DoBasicBlock(HBasicBlock* block, HBasicBlock* next_block); | 2841 void DoBasicBlock(HBasicBlock* block, HBasicBlock* next_block); |
2848 LInstruction* DoShift(Token::Value op, HBitwiseBinaryOperation* instr); | 2842 LInstruction* DoShift(Token::Value op, HBitwiseBinaryOperation* instr); |
2849 LInstruction* DoArithmeticD(Token::Value op, | 2843 LInstruction* DoArithmeticD(Token::Value op, |
2850 HArithmeticBinaryOperation* instr); | 2844 HArithmeticBinaryOperation* instr); |
2851 LInstruction* DoArithmeticT(Token::Value op, | 2845 LInstruction* DoArithmeticT(Token::Value op, |
2852 HBinaryOperation* instr); | 2846 HBinaryOperation* instr); |
2853 | 2847 |
2854 LPlatformChunk* chunk_; | 2848 LPlatformChunk* chunk_; |
2855 CompilationInfo* info_; | 2849 CompilationInfo* info_; |
2856 HGraph* const graph_; | 2850 HGraph* const graph_; |
2857 Zone* zone_; | |
2858 Status status_; | 2851 Status status_; |
2859 HInstruction* current_instruction_; | 2852 HInstruction* current_instruction_; |
2860 HBasicBlock* current_block_; | 2853 HBasicBlock* current_block_; |
2861 HBasicBlock* next_block_; | 2854 HBasicBlock* next_block_; |
2862 int argument_count_; | |
2863 LAllocator* allocator_; | 2855 LAllocator* allocator_; |
2864 int position_; | 2856 int position_; |
2865 LInstruction* instruction_pending_deoptimization_environment_; | 2857 LInstruction* instruction_pending_deoptimization_environment_; |
2866 BailoutId pending_deoptimization_ast_id_; | 2858 BailoutId pending_deoptimization_ast_id_; |
2867 | 2859 |
2868 DISALLOW_COPY_AND_ASSIGN(LChunkBuilder); | 2860 DISALLOW_COPY_AND_ASSIGN(LChunkBuilder); |
2869 }; | 2861 }; |
2870 | 2862 |
2871 #undef DECLARE_HYDROGEN_ACCESSOR | 2863 #undef DECLARE_HYDROGEN_ACCESSOR |
2872 #undef DECLARE_CONCRETE_INSTRUCTION | 2864 #undef DECLARE_CONCRETE_INSTRUCTION |
2873 | 2865 |
2874 } } // namespace v8::internal | 2866 } } // namespace v8::internal |
2875 | 2867 |
2876 #endif // V8_ARM_LITHIUM_ARM_H_ | 2868 #endif // V8_ARM_LITHIUM_ARM_H_ |
OLD | NEW |