Index: src/compiler/instruction.h |
diff --git a/src/compiler/instruction.h b/src/compiler/instruction.h |
index e2399b6e79f5df44855bb1f84d3e30d30d03a094..6d007841f42ad0b1dd010f6d03aa28adc9e62c4e 100644 |
--- a/src/compiler/instruction.h |
+++ b/src/compiler/instruction.h |
@@ -702,55 +702,84 @@ class Constant FINAL { |
class FrameStateDescriptor : public ZoneObject { |
public: |
FrameStateDescriptor(const FrameStateCallInfo& state_info, |
- int parameters_count, int locals_count, int stack_count, |
+ size_t parameters_count, size_t locals_count, |
+ size_t stack_count, |
FrameStateDescriptor* outer_state = NULL) |
- : bailout_id_(state_info.bailout_id()), |
+ : type_(state_info.type()), |
+ bailout_id_(state_info.bailout_id()), |
frame_state_combine_(state_info.state_combine()), |
parameters_count_(parameters_count), |
locals_count_(locals_count), |
stack_count_(stack_count), |
- outer_state_(outer_state) {} |
+ outer_state_(outer_state), |
+ jsfunction_(state_info.jsfunction()) {} |
+ FrameStateType type() const { return type_; } |
BailoutId bailout_id() const { return bailout_id_; } |
OutputFrameStateCombine state_combine() const { return frame_state_combine_; } |
- int parameters_count() { return parameters_count_; } |
- int locals_count() { return locals_count_; } |
- int stack_count() { return stack_count_; } |
- FrameStateDescriptor* outer_state() { return outer_state_; } |
- void set_outer_state(FrameStateDescriptor* outer_state) { |
- outer_state_ = outer_state; |
- } |
+ size_t parameters_count() const { return parameters_count_; } |
+ size_t locals_count() const { return locals_count_; } |
+ size_t stack_count() const { return stack_count_; } |
+ FrameStateDescriptor* outer_state() const { return outer_state_; } |
+ MaybeHandle<JSFunction> jsfunction() const { return jsfunction_; } |
- int size() { |
+ size_t size() const { |
return parameters_count_ + locals_count_ + stack_count_ + |
- 1; // Includes context. |
+ (HasContext() ? 1 : 0); |
} |
- int total_size() { |
- int total_size = 0; |
- for (FrameStateDescriptor* iter = this; iter != NULL; |
+ size_t GetTotalSize() const { |
+ size_t total_size = 0; |
+ for (const FrameStateDescriptor* iter = this; iter != NULL; |
iter = iter->outer_state_) { |
total_size += iter->size(); |
} |
return total_size; |
} |
- int GetFrameCount() { |
- int count = 0; |
- for (FrameStateDescriptor* iter = this; iter != NULL; |
+ size_t GetHeight(OutputFrameStateCombine override) const { |
+ size_t height = size() - parameters_count(); |
+ switch (override) { |
+ case kPushOutput: |
+ ++height; |
+ break; |
+ case kIgnoreOutput: |
+ break; |
+ } |
+ return height; |
+ } |
+ |
+ size_t GetFrameCount() const { |
+ size_t count = 0; |
+ for (const FrameStateDescriptor* iter = this; iter != NULL; |
iter = iter->outer_state_) { |
++count; |
} |
return count; |
} |
+ size_t GetJSFrameCount() const { |
+ size_t count = 0; |
+ for (const FrameStateDescriptor* iter = this; iter != NULL; |
+ iter = iter->outer_state_) { |
+ if (iter->type_ == JS_FRAME) { |
+ ++count; |
+ } |
+ } |
+ return count; |
+ } |
+ |
+ bool HasContext() const { return type_ == JS_FRAME; } |
+ |
private: |
+ FrameStateType type_; |
BailoutId bailout_id_; |
OutputFrameStateCombine frame_state_combine_; |
- int parameters_count_; |
- int locals_count_; |
- int stack_count_; |
+ size_t parameters_count_; |
+ size_t locals_count_; |
+ size_t stack_count_; |
FrameStateDescriptor* outer_state_; |
+ MaybeHandle<JSFunction> jsfunction_; |
}; |
OStream& operator<<(OStream& os, const Constant& constant); |