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

Side by Side Diff: src/debug/liveedit.h

Issue 2169833002: [parser] Refactor AstTraversalVisitor (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: 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 unified diff | Download patch
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef V8_DEBUG_LIVEEDIT_H_ 5 #ifndef V8_DEBUG_LIVEEDIT_H_
6 #define V8_DEBUG_LIVEEDIT_H_ 6 #define V8_DEBUG_LIVEEDIT_H_
7 7
8 8
9 // Live Edit feature implementation. 9 // Live Edit feature implementation.
10 // User should be able to change script on already running VM. This feature 10 // User should be able to change script on already running VM. This feature
(...skipping 20 matching lines...) Expand all
31 namespace v8 { 31 namespace v8 {
32 namespace internal { 32 namespace internal {
33 33
34 // This class collects some specific information on structure of functions 34 // This class collects some specific information on structure of functions
35 // in a particular script. 35 // in a particular script.
36 // 36 //
37 // The primary interest of the Tracker is to record function scope structures 37 // The primary interest of the Tracker is to record function scope structures
38 // in order to analyze whether function code may be safely patched (with new 38 // in order to analyze whether function code may be safely patched (with new
39 // code successfully reading existing data from function scopes). The Tracker 39 // code successfully reading existing data from function scopes). The Tracker
40 // also collects compiled function codes. 40 // also collects compiled function codes.
41 class LiveEditFunctionTracker : public AstTraversalVisitor { 41 class LiveEditFunctionTracker
42 : public AstTraversalVisitor<LiveEditFunctionTracker> {
42 public: 43 public:
43 // Traverses the entire AST, and records information about all 44 // Traverses the entire AST, and records information about all
44 // FunctionLiterals for further use by LiveEdit code patching. The collected 45 // FunctionLiterals for further use by LiveEdit code patching. The collected
45 // information is returned as a serialized array. 46 // information is returned as a serialized array.
46 static Handle<JSArray> Collect(FunctionLiteral* node, Handle<Script> script, 47 static Handle<JSArray> Collect(FunctionLiteral* node, Handle<Script> script,
47 Zone* zone, Isolate* isolate); 48 Zone* zone, Isolate* isolate);
48 49
49 virtual ~LiveEditFunctionTracker() {} 50 protected:
50 void VisitFunctionLiteral(FunctionLiteral* node) override; 51 friend AstTraversalVisitor<LiveEditFunctionTracker>;
52 void VisitFunctionLiteral(FunctionLiteral* node);
51 53
52 private: 54 private:
53 LiveEditFunctionTracker(Handle<Script> script, Zone* zone, Isolate* isolate); 55 LiveEditFunctionTracker(Handle<Script> script, Zone* zone, Isolate* isolate);
54 56
55 void FunctionStarted(FunctionLiteral* fun); 57 void FunctionStarted(FunctionLiteral* fun);
56 void FunctionDone(Handle<SharedFunctionInfo> shared, Scope* scope); 58 void FunctionDone(Handle<SharedFunctionInfo> shared, Scope* scope);
57 Handle<Object> SerializeFunctionScope(Scope* scope); 59 Handle<Object> SerializeFunctionScope(Scope* scope);
58 60
59 Handle<Script> script_; 61 Handle<Script> script_;
60 Zone* zone_; 62 Zone* zone_;
(...skipping 309 matching lines...) Expand 10 before | Expand all | Expand 10 after
370 static const int kSharedInfoOffset_ = 3; 372 static const int kSharedInfoOffset_ = 3;
371 static const int kSize_ = 4; 373 static const int kSize_ = 4;
372 374
373 friend class JSArrayBasedStruct<SharedInfoWrapper>; 375 friend class JSArrayBasedStruct<SharedInfoWrapper>;
374 }; 376 };
375 377
376 } // namespace internal 378 } // namespace internal
377 } // namespace v8 379 } // namespace v8
378 380
379 #endif /* V8_DEBUG_LIVEEDIT_H_ */ 381 #endif /* V8_DEBUG_LIVEEDIT_H_ */
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698