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_LITHIUM_H_ | 5 #ifndef V8_LITHIUM_H_ |
6 #define V8_LITHIUM_H_ | 6 #define V8_LITHIUM_H_ |
7 | 7 |
8 #include <set> | 8 #include <set> |
9 | 9 |
10 #include "src/allocation.h" | 10 #include "src/allocation.h" |
| 11 #include "src/bailout-reason.h" |
11 #include "src/hydrogen.h" | 12 #include "src/hydrogen.h" |
12 #include "src/safepoint-table.h" | 13 #include "src/safepoint-table.h" |
13 #include "src/zone-allocator.h" | 14 #include "src/zone-allocator.h" |
14 | 15 |
15 namespace v8 { | 16 namespace v8 { |
16 namespace internal { | 17 namespace internal { |
17 | 18 |
18 #define LITHIUM_OPERAND_LIST(V) \ | 19 #define LITHIUM_OPERAND_LIST(V) \ |
19 V(ConstantOperand, CONSTANT_OPERAND, 128) \ | 20 V(ConstantOperand, CONSTANT_OPERAND, 128) \ |
20 V(StackSlot, STACK_SLOT, 128) \ | 21 V(StackSlot, STACK_SLOT, 128) \ |
(...skipping 669 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
690 ZoneList<LInstruction*> instructions_; | 691 ZoneList<LInstruction*> instructions_; |
691 ZoneList<LPointerMap*> pointer_maps_; | 692 ZoneList<LPointerMap*> pointer_maps_; |
692 ZoneList<Handle<JSFunction> > inlined_closures_; | 693 ZoneList<Handle<JSFunction> > inlined_closures_; |
693 MapSet deprecation_dependencies_; | 694 MapSet deprecation_dependencies_; |
694 MapSet stability_dependencies_; | 695 MapSet stability_dependencies_; |
695 }; | 696 }; |
696 | 697 |
697 | 698 |
698 class LChunkBuilderBase BASE_EMBEDDED { | 699 class LChunkBuilderBase BASE_EMBEDDED { |
699 public: | 700 public: |
700 explicit LChunkBuilderBase(Zone* zone) | 701 explicit LChunkBuilderBase(CompilationInfo* info, HGraph* graph) |
701 : argument_count_(0), | 702 : argument_count_(0), |
702 zone_(zone) { } | 703 chunk_(NULL), |
| 704 info_(info), |
| 705 graph_(graph), |
| 706 status_(UNUSED), |
| 707 zone_(graph->zone()) {} |
703 | 708 |
704 virtual ~LChunkBuilderBase() { } | 709 virtual ~LChunkBuilderBase() { } |
705 | 710 |
| 711 void Abort(BailoutReason reason); |
| 712 void Retry(BailoutReason reason); |
| 713 |
706 protected: | 714 protected: |
| 715 enum Status { UNUSED, BUILDING, DONE, ABORTED }; |
| 716 |
| 717 LPlatformChunk* chunk() const { return chunk_; } |
| 718 CompilationInfo* info() const { return info_; } |
| 719 HGraph* graph() const { return graph_; } |
| 720 int argument_count() const { return argument_count_; } |
| 721 Isolate* isolate() const { return graph_->isolate(); } |
| 722 Heap* heap() const { return isolate()->heap(); } |
| 723 |
| 724 bool is_unused() const { return status_ == UNUSED; } |
| 725 bool is_building() const { return status_ == BUILDING; } |
| 726 bool is_done() const { return status_ == DONE; } |
| 727 bool is_aborted() const { return status_ == ABORTED; } |
| 728 |
707 // An input operand in register, stack slot or a constant operand. | 729 // An input operand in register, stack slot or a constant operand. |
708 // Will not be moved to a register even if one is freely available. | 730 // Will not be moved to a register even if one is freely available. |
709 virtual MUST_USE_RESULT LOperand* UseAny(HValue* value) = 0; | 731 virtual MUST_USE_RESULT LOperand* UseAny(HValue* value) = 0; |
710 | 732 |
711 LEnvironment* CreateEnvironment(HEnvironment* hydrogen_env, | 733 LEnvironment* CreateEnvironment(HEnvironment* hydrogen_env, |
712 int* argument_index_accumulator, | 734 int* argument_index_accumulator, |
713 ZoneList<HValue*>* objects_to_materialize); | 735 ZoneList<HValue*>* objects_to_materialize); |
714 void AddObjectToMaterialize(HValue* value, | 736 void AddObjectToMaterialize(HValue* value, |
715 ZoneList<HValue*>* objects_to_materialize, | 737 ZoneList<HValue*>* objects_to_materialize, |
716 LEnvironment* result); | 738 LEnvironment* result); |
717 | 739 |
718 Zone* zone() const { return zone_; } | 740 Zone* zone() const { return zone_; } |
719 | 741 |
720 int argument_count_; | 742 int argument_count_; |
| 743 LPlatformChunk* chunk_; |
| 744 CompilationInfo* info_; |
| 745 HGraph* const graph_; |
| 746 Status status_; |
721 | 747 |
722 private: | 748 private: |
723 Zone* zone_; | 749 Zone* zone_; |
724 }; | 750 }; |
725 | 751 |
726 | 752 |
727 int StackSlotOffset(int index); | 753 int StackSlotOffset(int index); |
728 | 754 |
729 enum NumberUntagDMode { | 755 enum NumberUntagDMode { |
730 NUMBER_CANDIDATE_IS_SMI, | 756 NUMBER_CANDIDATE_IS_SMI, |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
797 private: | 823 private: |
798 InputIterator input_iterator_; | 824 InputIterator input_iterator_; |
799 DeepIterator env_iterator_; | 825 DeepIterator env_iterator_; |
800 }; | 826 }; |
801 | 827 |
802 class LInstruction; | 828 class LInstruction; |
803 class LCodeGen; | 829 class LCodeGen; |
804 } } // namespace v8::internal | 830 } } // namespace v8::internal |
805 | 831 |
806 #endif // V8_LITHIUM_H_ | 832 #endif // V8_LITHIUM_H_ |
OLD | NEW |