5 #ifndef V8_COMPILER_BYTECODE_ANALYSIS_H_ 6 #define V8_COMPILER_BYTECODE_ANALYSIS_H_ 8 #include "src/base/hashmap.h" 9 #include "src/bit-vector.h" 10 #include "src/compiler/bytecode-liveness-map.h" 11 #include "src/handles.h" 12 #include "src/interpreter/bytecode-register.h" 13 #include "src/utils.h" 14 #include "src/zone/zone-containers.h" 31 bool ContainsParameter(
int index)
const;
32 bool ContainsLocal(
int index)
const;
34 int parameter_count()
const {
return parameter_count_; }
35 int local_count()
const {
return bit_vector_->length() - parameter_count_; }
53 int suspend_id()
const {
return suspend_id_; }
54 int target_offset()
const {
return target_offset_; }
55 bool is_leaf()
const {
return target_offset_ == final_target_offset_; }
63 int final_target_offset_;
65 ResumeJumpTarget(
int suspend_id,
int target_offset,
int final_target_offset);
70 LoopInfo(
int parent_offset,
int parameter_count,
int register_count,
72 : parent_offset_(parent_offset),
73 assignments_(parameter_count, register_count, zone),
74 resume_jump_targets_(zone) {}
76 int parent_offset()
const {
return parent_offset_; }
79 return resume_jump_targets_;
82 resume_jump_targets_.push_back(target);
98 bool do_liveness_analysis);
109 bool IsLoopHeader(
int offset)
const;
112 int GetLoopOffsetFor(
int offset)
const;
114 const LoopInfo& GetLoopInfoFor(
int header_offset)
const;
118 return resume_jump_targets_;
122 bool HasOsrEntryPoint()
const {
return osr_entry_point_ != -1; }
124 int osr_entry_point()
const {
return osr_entry_point_; }
132 std::ostream& PrintLivenessTo(std::ostream& os)
const;
135 struct LoopStackEntry {
140 void PushLoop(
int loop_header,
int loop_end);
143 bool ResumeJumpTargetsAreValid();
144 bool ResumeJumpTargetLeavesResolveSuspendIds(
147 std::map<int, int>* unresolved_suspend_ids);
149 bool LivenessIsValid();
152 Zone* zone()
const {
return zone_; }
157 bool do_liveness_analysis_;
166 int osr_entry_point_;
177 #endif // V8_COMPILER_BYTECODE_ANALYSIS_H_