| 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 2694 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2705 int GetNextSpillIndex(RegisterKind kind); | 2705 int GetNextSpillIndex(RegisterKind kind); |
| 2706 LOperand* GetNextSpillSlot(RegisterKind kind); | 2706 LOperand* GetNextSpillSlot(RegisterKind kind); |
| 2707 | 2707 |
| 2708 int num_double_slots() const { return num_double_slots_; } | 2708 int num_double_slots() const { return num_double_slots_; } |
| 2709 | 2709 |
| 2710 private: | 2710 private: |
| 2711 int num_double_slots_; | 2711 int num_double_slots_; |
| 2712 }; | 2712 }; |
| 2713 | 2713 |
| 2714 | 2714 |
| 2715 class LChunkBuilder V8_FINAL BASE_EMBEDDED { | 2715 class LChunkBuilder V8_FINAL : public LChunkBuilderBase { |
| 2716 public: | 2716 public: |
| 2717 LChunkBuilder(CompilationInfo* info, HGraph* graph, LAllocator* allocator) | 2717 LChunkBuilder(CompilationInfo* info, HGraph* graph, LAllocator* allocator) |
| 2718 : chunk_(NULL), | 2718 : LChunkBuilderBase(graph->zone()), |
| 2719 chunk_(NULL), |
| 2719 info_(info), | 2720 info_(info), |
| 2720 graph_(graph), | 2721 graph_(graph), |
| 2721 zone_(graph->zone()), | |
| 2722 status_(UNUSED), | 2722 status_(UNUSED), |
| 2723 current_instruction_(NULL), | 2723 current_instruction_(NULL), |
| 2724 current_block_(NULL), | 2724 current_block_(NULL), |
| 2725 next_block_(NULL), | 2725 next_block_(NULL), |
| 2726 argument_count_(0), | |
| 2727 allocator_(allocator), | 2726 allocator_(allocator), |
| 2728 instruction_pending_deoptimization_environment_(NULL), | 2727 instruction_pending_deoptimization_environment_(NULL), |
| 2729 pending_deoptimization_ast_id_(BailoutId::None()) { } | 2728 pending_deoptimization_ast_id_(BailoutId::None()) { } |
| 2730 | 2729 |
| 2731 // Build the sequence for the graph. | 2730 // Build the sequence for the graph. |
| 2732 LPlatformChunk* Build(); | 2731 LPlatformChunk* Build(); |
| 2733 | 2732 |
| 2734 LInstruction* CheckElideControlInstruction(HControlInstruction* instr); | 2733 LInstruction* CheckElideControlInstruction(HControlInstruction* instr); |
| 2735 | 2734 |
| 2736 // Declare methods that deal with the individual node types. | 2735 // Declare methods that deal with the individual node types. |
| (...skipping 15 matching lines...) Expand all Loading... |
| 2752 enum Status { | 2751 enum Status { |
| 2753 UNUSED, | 2752 UNUSED, |
| 2754 BUILDING, | 2753 BUILDING, |
| 2755 DONE, | 2754 DONE, |
| 2756 ABORTED | 2755 ABORTED |
| 2757 }; | 2756 }; |
| 2758 | 2757 |
| 2759 LPlatformChunk* chunk() const { return chunk_; } | 2758 LPlatformChunk* chunk() const { return chunk_; } |
| 2760 CompilationInfo* info() const { return info_; } | 2759 CompilationInfo* info() const { return info_; } |
| 2761 HGraph* graph() const { return graph_; } | 2760 HGraph* graph() const { return graph_; } |
| 2762 Zone* zone() const { return zone_; } | |
| 2763 | 2761 |
| 2764 bool is_unused() const { return status_ == UNUSED; } | 2762 bool is_unused() const { return status_ == UNUSED; } |
| 2765 bool is_building() const { return status_ == BUILDING; } | 2763 bool is_building() const { return status_ == BUILDING; } |
| 2766 bool is_done() const { return status_ == DONE; } | 2764 bool is_done() const { return status_ == DONE; } |
| 2767 bool is_aborted() const { return status_ == ABORTED; } | 2765 bool is_aborted() const { return status_ == ABORTED; } |
| 2768 | 2766 |
| 2769 void Abort(BailoutReason reason); | 2767 void Abort(BailoutReason reason); |
| 2770 | 2768 |
| 2771 // Methods for getting operands for Use / Define / Temp. | 2769 // Methods for getting operands for Use / Define / Temp. |
| 2772 LUnallocated* ToUnallocated(Register reg); | 2770 LUnallocated* ToUnallocated(Register reg); |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2807 | 2805 |
| 2808 // An input operand in a register or a constant operand. | 2806 // An input operand in a register or a constant operand. |
| 2809 MUST_USE_RESULT LOperand* UseRegisterOrConstant(HValue* value); | 2807 MUST_USE_RESULT LOperand* UseRegisterOrConstant(HValue* value); |
| 2810 MUST_USE_RESULT LOperand* UseRegisterOrConstantAtStart(HValue* value); | 2808 MUST_USE_RESULT LOperand* UseRegisterOrConstantAtStart(HValue* value); |
| 2811 | 2809 |
| 2812 // An input operand in a constant operand. | 2810 // An input operand in a constant operand. |
| 2813 MUST_USE_RESULT LOperand* UseConstant(HValue* value); | 2811 MUST_USE_RESULT LOperand* UseConstant(HValue* value); |
| 2814 | 2812 |
| 2815 // An input operand in register, stack slot or a constant operand. | 2813 // An input operand in register, stack slot or a constant operand. |
| 2816 // Will not be moved to a register even if one is freely available. | 2814 // Will not be moved to a register even if one is freely available. |
| 2817 MUST_USE_RESULT LOperand* UseAny(HValue* value); | 2815 virtual MUST_USE_RESULT LOperand* UseAny(HValue* value) V8_OVERRIDE; |
| 2818 | 2816 |
| 2819 // Temporary operand that must be in a register. | 2817 // Temporary operand that must be in a register. |
| 2820 MUST_USE_RESULT LUnallocated* TempRegister(); | 2818 MUST_USE_RESULT LUnallocated* TempRegister(); |
| 2821 MUST_USE_RESULT LOperand* FixedTemp(Register reg); | 2819 MUST_USE_RESULT LOperand* FixedTemp(Register reg); |
| 2822 MUST_USE_RESULT LOperand* FixedTemp(XMMRegister reg); | 2820 MUST_USE_RESULT LOperand* FixedTemp(XMMRegister reg); |
| 2823 | 2821 |
| 2824 // Methods for setting up define-use relationships. | 2822 // Methods for setting up define-use relationships. |
| 2825 // Return the same instruction that they are passed. | 2823 // Return the same instruction that they are passed. |
| 2826 template<int I, int T> | 2824 template<int I, int T> |
| 2827 LInstruction* Define(LTemplateInstruction<1, I, T>* instr, | 2825 LInstruction* Define(LTemplateInstruction<1, I, T>* instr, |
| (...skipping 25 matching lines...) Expand all Loading... |
| 2853 LOperand* GetSeqStringSetCharOperand(HSeqStringSetChar* instr); | 2851 LOperand* GetSeqStringSetCharOperand(HSeqStringSetChar* instr); |
| 2854 | 2852 |
| 2855 // Marks a call for the register allocator. Assigns a pointer map to | 2853 // Marks a call for the register allocator. Assigns a pointer map to |
| 2856 // support GC and lazy deoptimization. Assigns an environment to support | 2854 // support GC and lazy deoptimization. Assigns an environment to support |
| 2857 // eager deoptimization if CAN_DEOPTIMIZE_EAGERLY. | 2855 // eager deoptimization if CAN_DEOPTIMIZE_EAGERLY. |
| 2858 LInstruction* MarkAsCall( | 2856 LInstruction* MarkAsCall( |
| 2859 LInstruction* instr, | 2857 LInstruction* instr, |
| 2860 HInstruction* hinstr, | 2858 HInstruction* hinstr, |
| 2861 CanDeoptimize can_deoptimize = CANNOT_DEOPTIMIZE_EAGERLY); | 2859 CanDeoptimize can_deoptimize = CANNOT_DEOPTIMIZE_EAGERLY); |
| 2862 | 2860 |
| 2863 LEnvironment* CreateEnvironment(HEnvironment* hydrogen_env, | |
| 2864 int* argument_index_accumulator, | |
| 2865 ZoneList<HValue*>* objects_to_materialize); | |
| 2866 | |
| 2867 void VisitInstruction(HInstruction* current); | 2861 void VisitInstruction(HInstruction* current); |
| 2868 | 2862 |
| 2869 void DoBasicBlock(HBasicBlock* block, HBasicBlock* next_block); | 2863 void DoBasicBlock(HBasicBlock* block, HBasicBlock* next_block); |
| 2870 LInstruction* DoShift(Token::Value op, HBitwiseBinaryOperation* instr); | 2864 LInstruction* DoShift(Token::Value op, HBitwiseBinaryOperation* instr); |
| 2871 LInstruction* DoArithmeticD(Token::Value op, | 2865 LInstruction* DoArithmeticD(Token::Value op, |
| 2872 HArithmeticBinaryOperation* instr); | 2866 HArithmeticBinaryOperation* instr); |
| 2873 LInstruction* DoArithmeticT(Token::Value op, | 2867 LInstruction* DoArithmeticT(Token::Value op, |
| 2874 HBinaryOperation* instr); | 2868 HBinaryOperation* instr); |
| 2875 | 2869 |
| 2876 LOperand* GetStoreKeyedValueOperand(HStoreKeyed* instr); | 2870 LOperand* GetStoreKeyedValueOperand(HStoreKeyed* instr); |
| 2877 | 2871 |
| 2878 LPlatformChunk* chunk_; | 2872 LPlatformChunk* chunk_; |
| 2879 CompilationInfo* info_; | 2873 CompilationInfo* info_; |
| 2880 HGraph* const graph_; | 2874 HGraph* const graph_; |
| 2881 Zone* zone_; | |
| 2882 Status status_; | 2875 Status status_; |
| 2883 HInstruction* current_instruction_; | 2876 HInstruction* current_instruction_; |
| 2884 HBasicBlock* current_block_; | 2877 HBasicBlock* current_block_; |
| 2885 HBasicBlock* next_block_; | 2878 HBasicBlock* next_block_; |
| 2886 int argument_count_; | |
| 2887 LAllocator* allocator_; | 2879 LAllocator* allocator_; |
| 2888 LInstruction* instruction_pending_deoptimization_environment_; | 2880 LInstruction* instruction_pending_deoptimization_environment_; |
| 2889 BailoutId pending_deoptimization_ast_id_; | 2881 BailoutId pending_deoptimization_ast_id_; |
| 2890 | 2882 |
| 2891 DISALLOW_COPY_AND_ASSIGN(LChunkBuilder); | 2883 DISALLOW_COPY_AND_ASSIGN(LChunkBuilder); |
| 2892 }; | 2884 }; |
| 2893 | 2885 |
| 2894 #undef DECLARE_HYDROGEN_ACCESSOR | 2886 #undef DECLARE_HYDROGEN_ACCESSOR |
| 2895 #undef DECLARE_CONCRETE_INSTRUCTION | 2887 #undef DECLARE_CONCRETE_INSTRUCTION |
| 2896 | 2888 |
| 2897 } } // namespace v8::internal | 2889 } } // namespace v8::internal |
| 2898 | 2890 |
| 2899 #endif // V8_IA32_LITHIUM_IA32_H_ | 2891 #endif // V8_IA32_LITHIUM_IA32_H_ |
| OLD | NEW |