2016-04-18 20:40:09 +02:00
|
|
|
/* eslint-disable strict */
|
2015-12-09 20:37:51 +01:00
|
|
|
const scriptFiles = [
|
2015-11-25 15:08:58 +01:00
|
|
|
'internal/v8_prof_polyfill',
|
|
|
|
'v8/tools/splaytree',
|
|
|
|
'v8/tools/codemap',
|
|
|
|
'v8/tools/csvparser',
|
|
|
|
'v8/tools/consarray',
|
|
|
|
'v8/tools/profile',
|
|
|
|
'v8/tools/profile_view',
|
|
|
|
'v8/tools/logreader',
|
|
|
|
'v8/tools/tickprocessor',
|
|
|
|
'v8/tools/SourceMap',
|
|
|
|
'v8/tools/tickprocessor-driver'
|
|
|
|
];
|
2015-12-09 20:37:51 +01:00
|
|
|
var script = '';
|
2015-11-25 15:08:58 +01:00
|
|
|
|
2015-12-09 20:37:51 +01:00
|
|
|
scriptFiles.forEach(function(s) {
|
|
|
|
script += process.binding('natives')[s] + '\n';
|
2015-11-25 15:08:58 +01:00
|
|
|
});
|
|
|
|
|
2015-12-09 20:37:51 +01:00
|
|
|
var tickArguments = [];
|
2015-11-25 15:08:58 +01:00
|
|
|
if (process.platform === 'darwin') {
|
2015-12-09 20:37:51 +01:00
|
|
|
const nm = 'foo() { nm "$@" | (c++filt -p -i || cat) }; foo $@';
|
|
|
|
tickArguments.push('--mac', '--nm=' + nm);
|
2015-11-25 15:08:58 +01:00
|
|
|
} else if (process.platform === 'win32') {
|
|
|
|
tickArguments.push('--windows');
|
|
|
|
}
|
|
|
|
tickArguments.push.apply(tickArguments, process.argv.slice(1));
|
2016-01-24 18:32:14 +01:00
|
|
|
script = `(function() {
|
|
|
|
arguments = ${JSON.stringify(tickArguments)};
|
|
|
|
${script}
|
|
|
|
})()`;
|
2015-12-09 20:37:51 +01:00
|
|
|
eval(script);
|