Index: src/debug/liveedit.h |
diff --git a/src/debug/liveedit.h b/src/debug/liveedit.h |
index 4edd5831823beaf6ef3bd92cb0cab47ce3bab01e..af740437277174b3a0135883e9d0a0b90871db39 100644 |
--- a/src/debug/liveedit.h |
+++ b/src/debug/liveedit.h |
@@ -32,25 +32,39 @@ namespace v8 { |
namespace internal { |
// This class collects some specific information on structure of functions |
-// in a particular script. It gets called from compiler all the time, but |
-// actually records any data only when liveedit operation is in process; |
-// in any other time this class is very cheap. |
+// in a particular script. |
// |
// The primary interest of the Tracker is to record function scope structures |
-// in order to analyze whether function code maybe safely patched (with new |
+// in order to analyze whether function code may be safely patched (with new |
// code successfully reading existing data from function scopes). The Tracker |
// also collects compiled function codes. |
-class LiveEditFunctionTracker { |
+class LiveEditFunctionTracker : public AstTraversalVisitor { |
public: |
- explicit LiveEditFunctionTracker(Isolate* isolate, FunctionLiteral* fun); |
- ~LiveEditFunctionTracker(); |
- void RecordFunctionInfo(Handle<SharedFunctionInfo> info, |
- FunctionLiteral* lit, Zone* zone); |
+ // Traverses the entire AST, and records information about all |
+ // FunctionLiterals for further use by LiveEdit code patching. The collected |
+ // information is returned as a serialized array. |
+ static Handle<JSArray> Collect(FunctionLiteral* node, Handle<Script> script, |
+ Zone* zone, Isolate* isolate); |
- static bool IsActive(Isolate* isolate); |
+ virtual ~LiveEditFunctionTracker() {} |
+ void VisitFunctionLiteral(FunctionLiteral* node) override; |
private: |
+ LiveEditFunctionTracker(Handle<Script> script, Zone* zone, Isolate* isolate); |
+ |
+ void FunctionStarted(FunctionLiteral* fun); |
+ void FunctionDone(Handle<SharedFunctionInfo> shared, Scope* scope); |
+ Handle<Object> SerializeFunctionScope(Scope* scope); |
+ |
+ Handle<Script> script_; |
+ Zone* zone_; |
Isolate* isolate_; |
+ |
+ Handle<JSArray> result_; |
+ int len_; |
+ int current_parent_index_; |
+ |
+ DISALLOW_COPY_AND_ASSIGN(LiveEditFunctionTracker); |
}; |