HELLO·Android
系统源代码
IT资讯
技术文章
我的收藏
注册
登录
-
我收藏的文章
创建代码块
我的代码块
我的账号
Oreo
|
8.0.0_r4
下载
查看原文件
收藏
根目录
external
v8
src
debug
liveedit.h
// Copyright 2012 the V8 project authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef V8_DEBUG_LIVEEDIT_H_ #define V8_DEBUG_LIVEEDIT_H_ // Live Edit feature implementation. // User should be able to change script on already running VM. This feature // matches hot swap features in other frameworks. // // The basic use-case is when user spots some mistake in function body // from debugger and wishes to change the algorithm without restart. // // A single change always has a form of a simple replacement (in pseudo-code): // script.source[positions, positions+length] = new_string; // Implementation first determines, which function's body includes this // change area. Then both old and new versions of script are fully compiled // in order to analyze, whether the function changed its outer scope // expectations (or number of parameters). If it didn't, function's code is // patched with a newly compiled code. If it did change, enclosing function // gets patched. All inner functions are left untouched, whatever happened // to them in a new script version. However, new version of code will // instantiate newly compiled functions. #include "src/allocation.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. // // The primary interest of the Tracker is to record function scope structures // 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 : public AstTraversalVisitor
{ public: // 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
Collect(FunctionLiteral* node, Handle
登录后可以享受更多权益
您还没有登录,登录后您可以:
收藏Android系统代码
收藏喜欢的文章
多个平台共享账号
去登录
首次使用?从这里
注册