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

Unified Diff: src/debug/liveedit.h

Issue 1971683002: [debugger] Refactor LiveEdit function info collection (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Keep infos as MaybeHandle Created 4 years, 7 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.cc ('k') | src/debug/liveedit.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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);
};
« no previous file with comments | « src/compiler.cc ('k') | src/debug/liveedit.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698