Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(85)

Unified Diff: src/compiler/instruction.h

Issue 534573002: Reland "Make FrameStates recursive (to be used for inlining).". (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Rebase. Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/compiler/graph-builder.cc ('k') | src/compiler/instruction-selector.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler/instruction.h
diff --git a/src/compiler/instruction.h b/src/compiler/instruction.h
index 2b3a28e4d33329a7268eadf480feb28a4a93ab0d..ee868b180ce08c0c96e32e0aa622560afd3e4887 100644
--- a/src/compiler/instruction.h
+++ b/src/compiler/instruction.h
@@ -702,30 +702,55 @@ class Constant FINAL {
class FrameStateDescriptor : public ZoneObject {
public:
FrameStateDescriptor(const FrameStateCallInfo& state_info,
- int parameters_count, int locals_count, int stack_count)
+ int parameters_count, int locals_count, int stack_count,
+ FrameStateDescriptor* outer_state = NULL)
: 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) {}
+ stack_count_(stack_count),
+ outer_state_(outer_state) {}
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;
+ }
int size() {
return parameters_count_ + locals_count_ + stack_count_ +
1; // Includes context.
}
+ int total_size() {
+ int total_size = 0;
+ for (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;
+ iter = iter->outer_state_) {
+ ++count;
+ }
+ return count;
+ }
+
private:
BailoutId bailout_id_;
OutputFrameStateCombine frame_state_combine_;
int parameters_count_;
int locals_count_;
int stack_count_;
+ FrameStateDescriptor* outer_state_;
};
OStream& operator<<(OStream& os, const Constant& constant);
« no previous file with comments | « src/compiler/graph-builder.cc ('k') | src/compiler/instruction-selector.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698