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

Unified Diff: src/debug/liveedit.cc

Issue 2169833002: [parser] Refactor AstTraversalVisitor (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Rebase Created 4 years, 5 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/debug/liveedit.h ('k') | src/parsing/parameter-initializer-rewriter.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/debug/liveedit.cc
diff --git a/src/debug/liveedit.cc b/src/debug/liveedit.cc
index f3f78d950064b20d5d60f102a4f56a588e562217..6df74565c01a623c44c22e47c2afe06c219183c1 100644
--- a/src/debug/liveedit.cc
+++ b/src/debug/liveedit.cc
@@ -1857,7 +1857,7 @@ Handle<JSArray> LiveEditFunctionTracker::Collect(FunctionLiteral* node,
LiveEditFunctionTracker::LiveEditFunctionTracker(Handle<Script> script,
Zone* zone, Isolate* isolate)
- : AstTraversalVisitor(isolate) {
+ : AstTraversalVisitor<LiveEditFunctionTracker>(isolate) {
current_parent_index_ = -1;
isolate_ = isolate;
len_ = 0;
@@ -1867,20 +1867,16 @@ LiveEditFunctionTracker::LiveEditFunctionTracker(Handle<Script> script,
}
void LiveEditFunctionTracker::VisitFunctionLiteral(FunctionLiteral* node) {
- Scope* scope = node->scope();
-
// FunctionStarted is called in pre-order.
FunctionStarted(node);
-
- VisitDeclarations(scope->declarations());
- VisitStatements(node->body());
-
+ // Recurse using the regular traversal.
+ AstTraversalVisitor::VisitFunctionLiteral(node);
// FunctionDone are called in post-order.
// TODO(jgruber): If required, replace the (linear cost)
// FindSharedFunctionInfo call with a more efficient implementation.
Handle<SharedFunctionInfo> info =
script_->FindSharedFunctionInfo(node).ToHandleChecked();
- FunctionDone(info, scope);
+ FunctionDone(info, node->scope());
}
void LiveEditFunctionTracker::FunctionStarted(FunctionLiteral* fun) {
« no previous file with comments | « src/debug/liveedit.h ('k') | src/parsing/parameter-initializer-rewriter.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698