diff options
author | Michaël Zasso <targos@protonmail.com> | 2016-09-06 22:49:51 +0200 |
---|---|---|
committer | Michaël Zasso <targos@protonmail.com> | 2016-09-22 09:51:19 +0200 |
commit | ec02b811a8a5c999bab4de312be2d732b7d9d50b (patch) | |
tree | ca3068017254f238cf413a451c57a803572983a4 /deps/v8/src/debug/liveedit.h | |
parent | d2eb7ce0105369a9cad82787cb33a665e9bd00ad (diff) | |
download | android-node-v8-ec02b811a8a5c999bab4de312be2d732b7d9d50b.tar.gz android-node-v8-ec02b811a8a5c999bab4de312be2d732b7d9d50b.tar.bz2 android-node-v8-ec02b811a8a5c999bab4de312be2d732b7d9d50b.zip |
deps: update V8 to 5.4.500.27
Pick up latest commit from the 5.4-lkgr branch.
deps: edit V8 gitignore to allow trace event copy
deps: update V8 trace event to 315bf1e2d45be7d53346c31cfcc37424a32c30c8
deps: edit V8 gitignore to allow gtest_prod.h copy
deps: update V8 gtest to 6f8a66431cb592dad629028a50b3dd418a408c87
PR-URL: https://github.com/nodejs/node/pull/8317
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Ali Ijaz Sheikh <ofrobots@google.com>
Diffstat (limited to 'deps/v8/src/debug/liveedit.h')
-rw-r--r-- | deps/v8/src/debug/liveedit.h | 62 |
1 files changed, 34 insertions, 28 deletions
diff --git a/deps/v8/src/debug/liveedit.h b/deps/v8/src/debug/liveedit.h index 67be70e00a..784f828162 100644 --- a/deps/v8/src/debug/liveedit.h +++ b/deps/v8/src/debug/liveedit.h @@ -26,32 +26,47 @@ #include "src/allocation.h" -#include "src/compiler.h" +#include "src/ast/ast-traversal-visitor.h" 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<LiveEditFunctionTracker> { public: - explicit LiveEditFunctionTracker(Isolate* isolate, FunctionLiteral* fun); - ~LiveEditFunctionTracker(); - void RecordFunctionInfo(Handle<SharedFunctionInfo> info, - FunctionLiteral* lit, Zone* zone); - void RecordRootFunctionInfo(Handle<Code> code); + // 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); + protected: + friend AstTraversalVisitor<LiveEditFunctionTracker>; + void VisitFunctionLiteral(FunctionLiteral* node); 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); }; @@ -279,15 +294,14 @@ class FunctionInfoWrapper : public JSArrayBasedStruct<FunctionInfoWrapper> { int end_position, int param_num, int literal_count, int parent_index); - void SetFunctionCode(Handle<Code> function_code, - Handle<HeapObject> code_scope_info); - void SetFunctionScopeInfo(Handle<Object> scope_info_array) { this->SetField(kFunctionScopeInfoOffset_, scope_info_array); } void SetSharedFunctionInfo(Handle<SharedFunctionInfo> info); + Handle<SharedFunctionInfo> GetSharedFunctionInfo(); + int GetLiteralCount() { return this->GetSmiValueField(kLiteralNumOffset_); } @@ -296,12 +310,6 @@ class FunctionInfoWrapper : public JSArrayBasedStruct<FunctionInfoWrapper> { return this->GetSmiValueField(kParentIndexOffset_); } - Handle<Code> GetFunctionCode(); - - MaybeHandle<TypeFeedbackVector> GetFeedbackVector(); - - Handle<Object> GetCodeScopeInfo(); - int GetStartPosition() { return this->GetSmiValueField(kStartPositionOffset_); } @@ -313,13 +321,11 @@ class FunctionInfoWrapper : public JSArrayBasedStruct<FunctionInfoWrapper> { static const int kStartPositionOffset_ = 1; static const int kEndPositionOffset_ = 2; static const int kParamNumOffset_ = 3; - static const int kCodeOffset_ = 4; - static const int kCodeScopeInfoOffset_ = 5; - static const int kFunctionScopeInfoOffset_ = 6; - static const int kParentIndexOffset_ = 7; - static const int kSharedFunctionInfoOffset_ = 8; - static const int kLiteralNumOffset_ = 9; - static const int kSize_ = 10; + static const int kFunctionScopeInfoOffset_ = 4; + static const int kParentIndexOffset_ = 5; + static const int kSharedFunctionInfoOffset_ = 6; + static const int kLiteralNumOffset_ = 7; + static const int kSize_ = 8; friend class JSArrayBasedStruct<FunctionInfoWrapper>; }; |