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 684 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
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(BailoutId bailout_id, int parameters_count, |
705 int locals_count, int stack_count) | 705 int locals_count, int stack_count, |
706 FrameStateDescriptor* parent = NULL) | |
Jarin
2014/08/29 15:07:07
Perhaps rename 'parent -> 'outer_state' (or 'outer
sigurds
2014/09/01 08:48:18
Done.
| |
706 : bailout_id_(bailout_id), | 707 : bailout_id_(bailout_id), |
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), |
711 parent_(parent) {} | |
710 | 712 |
711 BailoutId bailout_id() const { return bailout_id_; } | 713 BailoutId bailout_id() const { return bailout_id_; } |
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_; } |
717 FrameStateDescriptor* parent() { return parent_; } | |
718 void set_parent(FrameStateDescriptor* parent) { parent_ = parent; } | |
715 | 719 |
716 int size() { return parameters_count_ + locals_count_ + stack_count_; } | 720 int size() { return parameters_count_ + locals_count_ + stack_count_; } |
717 | 721 |
722 int GetFrameCount() { | |
723 int count = 0; | |
724 for (FrameStateDescriptor* iter = this; iter != NULL; | |
725 iter = iter->parent_) { | |
726 ++count; | |
727 } | |
728 return count; | |
729 } | |
730 | |
718 private: | 731 private: |
719 BailoutId bailout_id_; | 732 BailoutId bailout_id_; |
720 int parameters_count_; | 733 int parameters_count_; |
721 int locals_count_; | 734 int locals_count_; |
722 int stack_count_; | 735 int stack_count_; |
736 FrameStateDescriptor* parent_; | |
723 }; | 737 }; |
724 | 738 |
725 OStream& operator<<(OStream& os, const Constant& constant); | 739 OStream& operator<<(OStream& os, const Constant& constant); |
726 | 740 |
727 typedef ZoneDeque<Constant> ConstantDeque; | 741 typedef ZoneDeque<Constant> ConstantDeque; |
728 typedef std::map<int, Constant, std::less<int>, | 742 typedef std::map<int, Constant, std::less<int>, |
729 zone_allocator<std::pair<int, Constant> > > ConstantMap; | 743 zone_allocator<std::pair<int, Constant> > > ConstantMap; |
730 | 744 |
731 typedef ZoneDeque<Instruction*> InstructionDeque; | 745 typedef ZoneDeque<Instruction*> InstructionDeque; |
732 typedef ZoneDeque<PointerMap*> PointerMapDeque; | 746 typedef ZoneDeque<PointerMap*> PointerMapDeque; |
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
861 DeoptimizationVector deoptimization_entries_; | 875 DeoptimizationVector deoptimization_entries_; |
862 }; | 876 }; |
863 | 877 |
864 OStream& operator<<(OStream& os, const InstructionSequence& code); | 878 OStream& operator<<(OStream& os, const InstructionSequence& code); |
865 | 879 |
866 } // namespace compiler | 880 } // namespace compiler |
867 } // namespace internal | 881 } // namespace internal |
868 } // namespace v8 | 882 } // namespace v8 |
869 | 883 |
870 #endif // V8_COMPILER_INSTRUCTION_H_ | 884 #endif // V8_COMPILER_INSTRUCTION_H_ |
OLD | NEW |