google chrome - 记录 v8 regexp 执行

google chrome - log v8 regexp execution

我有两个关于在 运行ning google chrome:

时获取 v8 日志的问题
  1. 我尝试使用以下标志 运行 chrome:--js-flags="--log_regexp=true --logfile=~/v8.log" 但我找不到日志文件。即使没有指定 --logfile=~/v8.log 并因此让它成为默认的 v8.log,我也找不到 v8.log 文件。 所以我的问题是:运行从 google chrome.

    时,我在哪里可以找到 v8 日志文件
  2. 我的另一个问题是,在第一个问题中指定的标志中,我使用了 --log_regexp 标志。我在这里 https://gist.github.com/cevek/ef1c9761a67d80d642f98cc75885bf31 看到该标志是受支持的,但是当 运行 宁 node --v8-options 我在支持的标志中找不到该标志。所以我的问题是:你知道这个标志是否受支持/你知道如何使用 v8 记录正则表达式信息吗?

感谢您的帮助!

(此处为 V8 开发人员。)

Where can I find the V8 log file when running it from Google Chrome?

应该在当前目录下。也就是说,要获取任何日志文件,您必须将 --no-sandbox 标志传递给 Chrome。默认情况下,渲染器进程不允许写入磁盘,这是一项重要的安全保障,因此强烈建议在关闭沙箱的情况下仅加载受信任的网站。

Is this flag supported or not?

--log-regexp 目前不是受支持的标志(显然它在早期版本中曾经受支持)。如果 node --v8-options 没有列出标志,那么该版本的 Node 不支持它。 (您可以在 https://chromium.googlesource.com/v8/v8/+/master/src/flags/flag-definitions.h. 找到标志定义的来源)

How to log regexp info with V8?

运行 node --v8-options | grep regexp 给出了几个可能与您的需求相关的标志:

$ node --v8-options | grep regexp
  --trace-regexp-bytecodes (trace regexp bytecode execution)
  --trace-regexp-assembler (trace regexp macro assembler calls.)
  --trace-regexp-parser (trace regexp parsing)
  --trace-regexp-tier-up (trace regexp tiering up execution)