From 8c6896e5d320ab7473940b320c568a342046f203 Mon Sep 17 00:00:00 2001 From: Matheus Marchini Date: Thu, 16 May 2019 17:20:26 -0700 Subject: [PATCH] src: allow --interpreted-frames-native-stack in NODE_OPTIONS PR-URL: https://github.com/nodejs/node/pull/27744 Reviewed-By: Richard Lau Reviewed-By: Anna Henningsen Reviewed-By: Colin Ihrig Reviewed-By: Rich Trott Reviewed-By: James M Snell Reviewed-By: Ruben Bridgewater --- doc/api/cli.md | 1 + src/node_options.cc | 3 +++ test/parallel/test-cli-node-options.js | 3 +++ 3 files changed, 7 insertions(+) diff --git a/doc/api/cli.md b/doc/api/cli.md index 376e427db0a801..d8c73147af28d2 100644 --- a/doc/api/cli.md +++ b/doc/api/cli.md @@ -1064,6 +1064,7 @@ Node.js options that are allowed are: V8 options that are allowed are: - `--abort-on-uncaught-exception` +- `--interpreted-frames-native-stack` - `--max-old-space-size` - `--perf-basic-prof-only-functions` - `--perf-basic-prof` diff --git a/src/node_options.cc b/src/node_options.cc index 2086214e65f735..98049453d8b24e 100644 --- a/src/node_options.cc +++ b/src/node_options.cc @@ -563,6 +563,9 @@ PerIsolateOptionsParser::PerIsolateOptionsParser( "for analysis", V8Option{}, kAllowedInEnvironment); + AddOption("--interpreted-frames-native-stack", + "help system profilers to translate JavaScript interpreted frames", + V8Option{}, kAllowedInEnvironment); AddOption("--max-old-space-size", "", V8Option{}, kAllowedInEnvironment); AddOption("--perf-basic-prof", "", V8Option{}, kAllowedInEnvironment); AddOption("--perf-basic-prof-only-functions", diff --git a/test/parallel/test-cli-node-options.js b/test/parallel/test-cli-node-options.js index 07b69c5b130ea5..7e42139470e964 100644 --- a/test/parallel/test-cli-node-options.js +++ b/test/parallel/test-cli-node-options.js @@ -65,6 +65,9 @@ expect('--stack-trace-limit=100', /(\s*at f \(\[eval\]:1:\d*\)\r?\n){100}/, '(function f() { f(); })();', true); +// Unsupported on arm. See https://crbug.com/v8/8713. +if (!['arm', 'arm64'].includes(process.arch)) + expect('--interpreted-frames-native-stack', 'B\n'); function expect(opt, want, command = 'console.log("B")', wantsError = false) { const argv = ['-e', command];