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 2612 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2623 class LPlatformChunk V8_FINAL : public LChunk { | 2623 class LPlatformChunk V8_FINAL : public LChunk { |
2624 public: | 2624 public: |
2625 LPlatformChunk(CompilationInfo* info, HGraph* graph) | 2625 LPlatformChunk(CompilationInfo* info, HGraph* graph) |
2626 : LChunk(info, graph) { } | 2626 : LChunk(info, graph) { } |
2627 | 2627 |
2628 int GetNextSpillIndex(RegisterKind kind); | 2628 int GetNextSpillIndex(RegisterKind kind); |
2629 LOperand* GetNextSpillSlot(RegisterKind kind); | 2629 LOperand* GetNextSpillSlot(RegisterKind kind); |
2630 }; | 2630 }; |
2631 | 2631 |
2632 | 2632 |
2633 class LChunkBuilder V8_FINAL BASE_EMBEDDED { | 2633 class LChunkBuilder V8_FINAL : public LChunkBuilderBase { |
2634 public: | 2634 public: |
2635 LChunkBuilder(CompilationInfo* info, HGraph* graph, LAllocator* allocator) | 2635 LChunkBuilder(CompilationInfo* info, HGraph* graph, LAllocator* allocator) |
2636 : chunk_(NULL), | 2636 : LChunkBuilderBase(graph->zone()), |
| 2637 chunk_(NULL), |
2637 info_(info), | 2638 info_(info), |
2638 graph_(graph), | 2639 graph_(graph), |
2639 zone_(graph->zone()), | |
2640 status_(UNUSED), | 2640 status_(UNUSED), |
2641 current_instruction_(NULL), | 2641 current_instruction_(NULL), |
2642 current_block_(NULL), | 2642 current_block_(NULL), |
2643 next_block_(NULL), | 2643 next_block_(NULL), |
2644 argument_count_(0), | |
2645 allocator_(allocator), | 2644 allocator_(allocator), |
2646 instruction_pending_deoptimization_environment_(NULL), | 2645 instruction_pending_deoptimization_environment_(NULL), |
2647 pending_deoptimization_ast_id_(BailoutId::None()) { } | 2646 pending_deoptimization_ast_id_(BailoutId::None()) { } |
2648 | 2647 |
2649 // Build the sequence for the graph. | 2648 // Build the sequence for the graph. |
2650 LPlatformChunk* Build(); | 2649 LPlatformChunk* Build(); |
2651 | 2650 |
2652 LInstruction* CheckElideControlInstruction(HControlInstruction* instr); | 2651 LInstruction* CheckElideControlInstruction(HControlInstruction* instr); |
2653 | 2652 |
2654 // Declare methods that deal with the individual node types. | 2653 // Declare methods that deal with the individual node types. |
(...skipping 15 matching lines...) Expand all Loading... |
2670 enum Status { | 2669 enum Status { |
2671 UNUSED, | 2670 UNUSED, |
2672 BUILDING, | 2671 BUILDING, |
2673 DONE, | 2672 DONE, |
2674 ABORTED | 2673 ABORTED |
2675 }; | 2674 }; |
2676 | 2675 |
2677 LPlatformChunk* chunk() const { return chunk_; } | 2676 LPlatformChunk* chunk() const { return chunk_; } |
2678 CompilationInfo* info() const { return info_; } | 2677 CompilationInfo* info() const { return info_; } |
2679 HGraph* graph() const { return graph_; } | 2678 HGraph* graph() const { return graph_; } |
2680 Zone* zone() const { return zone_; } | |
2681 | 2679 |
2682 bool is_unused() const { return status_ == UNUSED; } | 2680 bool is_unused() const { return status_ == UNUSED; } |
2683 bool is_building() const { return status_ == BUILDING; } | 2681 bool is_building() const { return status_ == BUILDING; } |
2684 bool is_done() const { return status_ == DONE; } | 2682 bool is_done() const { return status_ == DONE; } |
2685 bool is_aborted() const { return status_ == ABORTED; } | 2683 bool is_aborted() const { return status_ == ABORTED; } |
2686 | 2684 |
2687 void Abort(BailoutReason reason); | 2685 void Abort(BailoutReason reason); |
2688 | 2686 |
2689 // Methods for getting operands for Use / Define / Temp. | 2687 // Methods for getting operands for Use / Define / Temp. |
2690 LUnallocated* ToUnallocated(Register reg); | 2688 LUnallocated* ToUnallocated(Register reg); |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2723 | 2721 |
2724 // An input operand in a register or a constant operand. | 2722 // An input operand in a register or a constant operand. |
2725 MUST_USE_RESULT LOperand* UseRegisterOrConstant(HValue* value); | 2723 MUST_USE_RESULT LOperand* UseRegisterOrConstant(HValue* value); |
2726 MUST_USE_RESULT LOperand* UseRegisterOrConstantAtStart(HValue* value); | 2724 MUST_USE_RESULT LOperand* UseRegisterOrConstantAtStart(HValue* value); |
2727 | 2725 |
2728 // An input operand in a constant operand. | 2726 // An input operand in a constant operand. |
2729 MUST_USE_RESULT LOperand* UseConstant(HValue* value); | 2727 MUST_USE_RESULT LOperand* UseConstant(HValue* value); |
2730 | 2728 |
2731 // An input operand in register, stack slot or a constant operand. | 2729 // An input operand in register, stack slot or a constant operand. |
2732 // Will not be moved to a register even if one is freely available. | 2730 // Will not be moved to a register even if one is freely available. |
2733 MUST_USE_RESULT LOperand* UseAny(HValue* value); | 2731 virtual MUST_USE_RESULT LOperand* UseAny(HValue* value) V8_OVERRIDE; |
2734 | 2732 |
2735 // Temporary operand that must be in a register. | 2733 // Temporary operand that must be in a register. |
2736 MUST_USE_RESULT LUnallocated* TempRegister(); | 2734 MUST_USE_RESULT LUnallocated* TempRegister(); |
2737 MUST_USE_RESULT LOperand* FixedTemp(Register reg); | 2735 MUST_USE_RESULT LOperand* FixedTemp(Register reg); |
2738 MUST_USE_RESULT LOperand* FixedTemp(XMMRegister reg); | 2736 MUST_USE_RESULT LOperand* FixedTemp(XMMRegister reg); |
2739 | 2737 |
2740 // Methods for setting up define-use relationships. | 2738 // Methods for setting up define-use relationships. |
2741 // Return the same instruction that they are passed. | 2739 // Return the same instruction that they are passed. |
2742 template<int I, int T> | 2740 template<int I, int T> |
2743 LInstruction* Define(LTemplateInstruction<1, I, T>* instr, | 2741 LInstruction* Define(LTemplateInstruction<1, I, T>* instr, |
(...skipping 21 matching lines...) Expand all Loading... |
2765 enum CanDeoptimize { CAN_DEOPTIMIZE_EAGERLY, CANNOT_DEOPTIMIZE_EAGERLY }; | 2763 enum CanDeoptimize { CAN_DEOPTIMIZE_EAGERLY, CANNOT_DEOPTIMIZE_EAGERLY }; |
2766 | 2764 |
2767 // Marks a call for the register allocator. Assigns a pointer map to | 2765 // Marks a call for the register allocator. Assigns a pointer map to |
2768 // support GC and lazy deoptimization. Assigns an environment to support | 2766 // support GC and lazy deoptimization. Assigns an environment to support |
2769 // eager deoptimization if CAN_DEOPTIMIZE_EAGERLY. | 2767 // eager deoptimization if CAN_DEOPTIMIZE_EAGERLY. |
2770 LInstruction* MarkAsCall( | 2768 LInstruction* MarkAsCall( |
2771 LInstruction* instr, | 2769 LInstruction* instr, |
2772 HInstruction* hinstr, | 2770 HInstruction* hinstr, |
2773 CanDeoptimize can_deoptimize = CANNOT_DEOPTIMIZE_EAGERLY); | 2771 CanDeoptimize can_deoptimize = CANNOT_DEOPTIMIZE_EAGERLY); |
2774 | 2772 |
2775 LEnvironment* CreateEnvironment(HEnvironment* hydrogen_env, | |
2776 int* argument_index_accumulator, | |
2777 ZoneList<HValue*>* objects_to_materialize); | |
2778 | |
2779 void VisitInstruction(HInstruction* current); | 2773 void VisitInstruction(HInstruction* current); |
2780 | 2774 |
2781 void DoBasicBlock(HBasicBlock* block, HBasicBlock* next_block); | 2775 void DoBasicBlock(HBasicBlock* block, HBasicBlock* next_block); |
2782 LInstruction* DoShift(Token::Value op, HBitwiseBinaryOperation* instr); | 2776 LInstruction* DoShift(Token::Value op, HBitwiseBinaryOperation* instr); |
2783 LInstruction* DoArithmeticD(Token::Value op, | 2777 LInstruction* DoArithmeticD(Token::Value op, |
2784 HArithmeticBinaryOperation* instr); | 2778 HArithmeticBinaryOperation* instr); |
2785 LInstruction* DoArithmeticT(Token::Value op, | 2779 LInstruction* DoArithmeticT(Token::Value op, |
2786 HBinaryOperation* instr); | 2780 HBinaryOperation* instr); |
2787 | 2781 |
2788 LPlatformChunk* chunk_; | 2782 LPlatformChunk* chunk_; |
2789 CompilationInfo* info_; | 2783 CompilationInfo* info_; |
2790 HGraph* const graph_; | 2784 HGraph* const graph_; |
2791 Zone* zone_; | |
2792 Status status_; | 2785 Status status_; |
2793 HInstruction* current_instruction_; | 2786 HInstruction* current_instruction_; |
2794 HBasicBlock* current_block_; | 2787 HBasicBlock* current_block_; |
2795 HBasicBlock* next_block_; | 2788 HBasicBlock* next_block_; |
2796 int argument_count_; | |
2797 LAllocator* allocator_; | 2789 LAllocator* allocator_; |
2798 LInstruction* instruction_pending_deoptimization_environment_; | 2790 LInstruction* instruction_pending_deoptimization_environment_; |
2799 BailoutId pending_deoptimization_ast_id_; | 2791 BailoutId pending_deoptimization_ast_id_; |
2800 | 2792 |
2801 DISALLOW_COPY_AND_ASSIGN(LChunkBuilder); | 2793 DISALLOW_COPY_AND_ASSIGN(LChunkBuilder); |
2802 }; | 2794 }; |
2803 | 2795 |
2804 #undef DECLARE_HYDROGEN_ACCESSOR | 2796 #undef DECLARE_HYDROGEN_ACCESSOR |
2805 #undef DECLARE_CONCRETE_INSTRUCTION | 2797 #undef DECLARE_CONCRETE_INSTRUCTION |
2806 | 2798 |
2807 } } // namespace v8::int | 2799 } } // namespace v8::int |
2808 | 2800 |
2809 #endif // V8_X64_LITHIUM_X64_H_ | 2801 #endif // V8_X64_LITHIUM_X64_H_ |
OLD | NEW |