| OLD | NEW | 
|---|
| 1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 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_COMPILER_INSTRUCTION_H_ | 5 #ifndef V8_COMPILER_INSTRUCTION_H_ | 
| 6 #define V8_COMPILER_INSTRUCTION_H_ | 6 #define V8_COMPILER_INSTRUCTION_H_ | 
| 7 | 7 | 
| 8 #include <deque> | 8 #include <deque> | 
| 9 #include <map> | 9 #include <map> | 
| 10 #include <set> | 10 #include <set> | 
| (...skipping 683 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 694   } | 694   } | 
| 695 | 695 | 
| 696  private: | 696  private: | 
| 697   Type type_; | 697   Type type_; | 
| 698   int64_t value_; | 698   int64_t value_; | 
| 699 }; | 699 }; | 
| 700 | 700 | 
| 701 | 701 | 
| 702 class FrameStateDescriptor : public ZoneObject { | 702 class FrameStateDescriptor : public ZoneObject { | 
| 703  public: | 703  public: | 
| 704   FrameStateDescriptor(BailoutId bailout_id, int parameters_count, | 704   FrameStateDescriptor(const FrameStateCallInfo& state_info, | 
| 705                        int locals_count, int stack_count) | 705                        int parameters_count, int locals_count, int stack_count) | 
| 706       : bailout_id_(bailout_id), | 706       : bailout_id_(state_info.bailout_id()), | 
|  | 707         frame_state_combine_(state_info.state_combine()), | 
| 707         parameters_count_(parameters_count), | 708         parameters_count_(parameters_count), | 
| 708         locals_count_(locals_count), | 709         locals_count_(locals_count), | 
| 709         stack_count_(stack_count) {} | 710         stack_count_(stack_count) {} | 
| 710 | 711 | 
| 711   BailoutId bailout_id() const { return bailout_id_; } | 712   BailoutId bailout_id() const { return bailout_id_; } | 
|  | 713   OutputFrameStateCombine state_combine() const { return frame_state_combine_; } | 
| 712   int parameters_count() { return parameters_count_; } | 714   int parameters_count() { return parameters_count_; } | 
| 713   int locals_count() { return locals_count_; } | 715   int locals_count() { return locals_count_; } | 
| 714   int stack_count() { return stack_count_; } | 716   int stack_count() { return stack_count_; } | 
| 715 | 717 | 
| 716   int size() { return parameters_count_ + locals_count_ + stack_count_; } | 718   int size() { | 
|  | 719     return parameters_count_ + locals_count_ + stack_count_ + | 
|  | 720            1;  // Includes context. | 
|  | 721   } | 
| 717 | 722 | 
| 718  private: | 723  private: | 
| 719   BailoutId bailout_id_; | 724   BailoutId bailout_id_; | 
|  | 725   OutputFrameStateCombine frame_state_combine_; | 
| 720   int parameters_count_; | 726   int parameters_count_; | 
| 721   int locals_count_; | 727   int locals_count_; | 
| 722   int stack_count_; | 728   int stack_count_; | 
| 723 }; | 729 }; | 
| 724 | 730 | 
| 725 OStream& operator<<(OStream& os, const Constant& constant); | 731 OStream& operator<<(OStream& os, const Constant& constant); | 
| 726 | 732 | 
| 727 typedef ZoneDeque<Constant> ConstantDeque; | 733 typedef ZoneDeque<Constant> ConstantDeque; | 
| 728 typedef std::map<int, Constant, std::less<int>, | 734 typedef std::map<int, Constant, std::less<int>, | 
| 729                  zone_allocator<std::pair<int, Constant> > > ConstantMap; | 735                  zone_allocator<std::pair<int, Constant> > > ConstantMap; | 
| (...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 831     int index = static_cast<int>(immediates_.size()); | 837     int index = static_cast<int>(immediates_.size()); | 
| 832     immediates_.push_back(constant); | 838     immediates_.push_back(constant); | 
| 833     return index; | 839     return index; | 
| 834   } | 840   } | 
| 835   Constant GetImmediate(int index) const { | 841   Constant GetImmediate(int index) const { | 
| 836     DCHECK(index >= 0); | 842     DCHECK(index >= 0); | 
| 837     DCHECK(index < static_cast<int>(immediates_.size())); | 843     DCHECK(index < static_cast<int>(immediates_.size())); | 
| 838     return immediates_[index]; | 844     return immediates_[index]; | 
| 839   } | 845   } | 
| 840 | 846 | 
| 841   int AddDeoptimizationEntry(FrameStateDescriptor* descriptor); | 847   class StateId { | 
| 842   FrameStateDescriptor* GetDeoptimizationEntry(int deoptimization_id); | 848    public: | 
| 843   int GetDeoptimizationEntryCount(); | 849     static StateId FromInt(int id) { return StateId(id); } | 
|  | 850     int ToInt() const { return id_; } | 
|  | 851 | 
|  | 852    private: | 
|  | 853     explicit StateId(int id) : id_(id) {} | 
|  | 854     int id_; | 
|  | 855   }; | 
|  | 856 | 
|  | 857   StateId AddFrameStateDescriptor(FrameStateDescriptor* descriptor); | 
|  | 858   FrameStateDescriptor* GetFrameStateDescriptor(StateId deoptimization_id); | 
|  | 859   int GetFrameStateDescriptorCount(); | 
| 844 | 860 | 
| 845  private: | 861  private: | 
| 846   friend OStream& operator<<(OStream& os, const InstructionSequence& code); | 862   friend OStream& operator<<(OStream& os, const InstructionSequence& code); | 
| 847 | 863 | 
| 848   typedef std::set<int, std::less<int>, ZoneIntAllocator> VirtualRegisterSet; | 864   typedef std::set<int, std::less<int>, ZoneIntAllocator> VirtualRegisterSet; | 
| 849 | 865 | 
| 850   Graph* graph_; | 866   Graph* graph_; | 
| 851   Linkage* linkage_; | 867   Linkage* linkage_; | 
| 852   Schedule* schedule_; | 868   Schedule* schedule_; | 
| 853   ConstantMap constants_; | 869   ConstantMap constants_; | 
| 854   ConstantDeque immediates_; | 870   ConstantDeque immediates_; | 
| 855   InstructionDeque instructions_; | 871   InstructionDeque instructions_; | 
| 856   int next_virtual_register_; | 872   int next_virtual_register_; | 
| 857   PointerMapDeque pointer_maps_; | 873   PointerMapDeque pointer_maps_; | 
| 858   VirtualRegisterSet doubles_; | 874   VirtualRegisterSet doubles_; | 
| 859   VirtualRegisterSet references_; | 875   VirtualRegisterSet references_; | 
| 860   Frame frame_; | 876   Frame frame_; | 
| 861   DeoptimizationVector deoptimization_entries_; | 877   DeoptimizationVector deoptimization_entries_; | 
| 862 }; | 878 }; | 
| 863 | 879 | 
| 864 OStream& operator<<(OStream& os, const InstructionSequence& code); | 880 OStream& operator<<(OStream& os, const InstructionSequence& code); | 
| 865 | 881 | 
| 866 }  // namespace compiler | 882 }  // namespace compiler | 
| 867 }  // namespace internal | 883 }  // namespace internal | 
| 868 }  // namespace v8 | 884 }  // namespace v8 | 
| 869 | 885 | 
| 870 #endif  // V8_COMPILER_INSTRUCTION_H_ | 886 #endif  // V8_COMPILER_INSTRUCTION_H_ | 
| OLD | NEW | 
|---|