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 <iosfwd> | 9 #include <iosfwd> |
10 #include <map> | 10 #include <map> |
(...skipping 848 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
859 int64_t value_; | 859 int64_t value_; |
860 }; | 860 }; |
861 | 861 |
862 | 862 |
863 class FrameStateDescriptor : public ZoneObject { | 863 class FrameStateDescriptor : public ZoneObject { |
864 public: | 864 public: |
865 FrameStateDescriptor(Zone* zone, FrameStateType type, BailoutId bailout_id, | 865 FrameStateDescriptor(Zone* zone, FrameStateType type, BailoutId bailout_id, |
866 OutputFrameStateCombine state_combine, | 866 OutputFrameStateCombine state_combine, |
867 size_t parameters_count, size_t locals_count, | 867 size_t parameters_count, size_t locals_count, |
868 size_t stack_count, | 868 size_t stack_count, |
| 869 MaybeHandle<SharedFunctionInfo> shared_info, |
869 FrameStateDescriptor* outer_state = nullptr); | 870 FrameStateDescriptor* outer_state = nullptr); |
870 | 871 |
871 FrameStateType type() const { return type_; } | 872 FrameStateType type() const { return type_; } |
872 BailoutId bailout_id() const { return bailout_id_; } | 873 BailoutId bailout_id() const { return bailout_id_; } |
873 OutputFrameStateCombine state_combine() const { return frame_state_combine_; } | 874 OutputFrameStateCombine state_combine() const { return frame_state_combine_; } |
874 size_t parameters_count() const { return parameters_count_; } | 875 size_t parameters_count() const { return parameters_count_; } |
875 size_t locals_count() const { return locals_count_; } | 876 size_t locals_count() const { return locals_count_; } |
876 size_t stack_count() const { return stack_count_; } | 877 size_t stack_count() const { return stack_count_; } |
| 878 MaybeHandle<SharedFunctionInfo> shared_info() const { return shared_info_; } |
877 FrameStateDescriptor* outer_state() const { return outer_state_; } | 879 FrameStateDescriptor* outer_state() const { return outer_state_; } |
878 bool HasContext() const { return type_ == JS_FRAME; } | 880 bool HasContext() const { return type_ == JS_FRAME; } |
879 | 881 |
880 size_t GetSize(OutputFrameStateCombine combine = | 882 size_t GetSize(OutputFrameStateCombine combine = |
881 OutputFrameStateCombine::Ignore()) const; | 883 OutputFrameStateCombine::Ignore()) const; |
882 size_t GetTotalSize() const; | 884 size_t GetTotalSize() const; |
883 size_t GetFrameCount() const; | 885 size_t GetFrameCount() const; |
884 size_t GetJSFrameCount() const; | 886 size_t GetJSFrameCount() const; |
885 | 887 |
886 MachineType GetType(size_t index) const; | 888 MachineType GetType(size_t index) const; |
887 void SetType(size_t index, MachineType type); | 889 void SetType(size_t index, MachineType type); |
888 | 890 |
889 private: | 891 private: |
890 FrameStateType type_; | 892 FrameStateType type_; |
891 BailoutId bailout_id_; | 893 BailoutId bailout_id_; |
892 OutputFrameStateCombine frame_state_combine_; | 894 OutputFrameStateCombine frame_state_combine_; |
893 size_t parameters_count_; | 895 size_t parameters_count_; |
894 size_t locals_count_; | 896 size_t locals_count_; |
895 size_t stack_count_; | 897 size_t stack_count_; |
896 ZoneVector<MachineType> types_; | 898 ZoneVector<MachineType> types_; |
| 899 MaybeHandle<SharedFunctionInfo> const shared_info_; |
897 FrameStateDescriptor* outer_state_; | 900 FrameStateDescriptor* outer_state_; |
898 }; | 901 }; |
899 | 902 |
900 std::ostream& operator<<(std::ostream& os, const Constant& constant); | 903 std::ostream& operator<<(std::ostream& os, const Constant& constant); |
901 | 904 |
902 | 905 |
903 class PhiInstruction final : public ZoneObject { | 906 class PhiInstruction final : public ZoneObject { |
904 public: | 907 public: |
905 typedef ZoneVector<InstructionOperand> Inputs; | 908 typedef ZoneVector<InstructionOperand> Inputs; |
906 | 909 |
(...skipping 235 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1142 int ToInt() const { return id_; } | 1145 int ToInt() const { return id_; } |
1143 | 1146 |
1144 private: | 1147 private: |
1145 explicit StateId(int id) : id_(id) {} | 1148 explicit StateId(int id) : id_(id) {} |
1146 int id_; | 1149 int id_; |
1147 }; | 1150 }; |
1148 | 1151 |
1149 StateId AddFrameStateDescriptor(FrameStateDescriptor* descriptor); | 1152 StateId AddFrameStateDescriptor(FrameStateDescriptor* descriptor); |
1150 FrameStateDescriptor* GetFrameStateDescriptor(StateId deoptimization_id); | 1153 FrameStateDescriptor* GetFrameStateDescriptor(StateId deoptimization_id); |
1151 int GetFrameStateDescriptorCount(); | 1154 int GetFrameStateDescriptorCount(); |
| 1155 DeoptimizationVector const& frame_state_descriptors() const { |
| 1156 return deoptimization_entries_; |
| 1157 } |
1152 | 1158 |
1153 RpoNumber InputRpo(Instruction* instr, size_t index); | 1159 RpoNumber InputRpo(Instruction* instr, size_t index); |
1154 | 1160 |
1155 bool GetSourcePosition(const Instruction* instr, | 1161 bool GetSourcePosition(const Instruction* instr, |
1156 SourcePosition* result) const; | 1162 SourcePosition* result) const; |
1157 void SetSourcePosition(const Instruction* instr, SourcePosition value); | 1163 void SetSourcePosition(const Instruction* instr, SourcePosition value); |
1158 | 1164 |
1159 bool ContainsCall() const { | 1165 bool ContainsCall() const { |
1160 for (Instruction* instr : instructions_) { | 1166 for (Instruction* instr : instructions_) { |
1161 if (instr->IsCall()) return true; | 1167 if (instr->IsCall()) return true; |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1194 | 1200 |
1195 | 1201 |
1196 std::ostream& operator<<(std::ostream& os, | 1202 std::ostream& operator<<(std::ostream& os, |
1197 const PrintableInstructionSequence& code); | 1203 const PrintableInstructionSequence& code); |
1198 | 1204 |
1199 } // namespace compiler | 1205 } // namespace compiler |
1200 } // namespace internal | 1206 } // namespace internal |
1201 } // namespace v8 | 1207 } // namespace v8 |
1202 | 1208 |
1203 #endif // V8_COMPILER_INSTRUCTION_H_ | 1209 #endif // V8_COMPILER_INSTRUCTION_H_ |
OLD | NEW |