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

Unified Diff: src/compiler/instruction.h

Issue 517323002: Make FrameStates recursive (to be used for inlining). (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Fix bug in GetParentCount Created 6 years, 4 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
Index: src/compiler/instruction.h
diff --git a/src/compiler/instruction.h b/src/compiler/instruction.h
index 98c85bc89d24e30c033cef10cc409954bf8ef0b2..47497265caa4285a0cfb0c2154cfdbe87f139176 100644
--- a/src/compiler/instruction.h
+++ b/src/compiler/instruction.h
@@ -702,24 +702,38 @@ class Constant V8_FINAL {
class FrameStateDescriptor : public ZoneObject {
public:
FrameStateDescriptor(BailoutId bailout_id, int parameters_count,
- int locals_count, int stack_count)
+ int locals_count, int stack_count,
+ 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.
: bailout_id_(bailout_id),
parameters_count_(parameters_count),
locals_count_(locals_count),
- stack_count_(stack_count) {}
+ stack_count_(stack_count),
+ parent_(parent) {}
BailoutId bailout_id() const { return bailout_id_; }
int parameters_count() { return parameters_count_; }
int locals_count() { return locals_count_; }
int stack_count() { return stack_count_; }
+ FrameStateDescriptor* parent() { return parent_; }
+ void set_parent(FrameStateDescriptor* parent) { parent_ = parent; }
int size() { return parameters_count_ + locals_count_ + stack_count_; }
+ int GetFrameCount() {
+ int count = 0;
+ for (FrameStateDescriptor* iter = this; iter != NULL;
+ iter = iter->parent_) {
+ ++count;
+ }
+ return count;
+ }
+
private:
BailoutId bailout_id_;
int parameters_count_;
int locals_count_;
int stack_count_;
+ FrameStateDescriptor* parent_;
};
OStream& operator<<(OStream& os, const Constant& constant);

Powered by Google App Engine
This is Rietveld 408576698