JAVASCRIPT   13

v8_prof_processor.js

Guest on 15th May 2021 10:17:58 AM

  1. /* eslint-disable strict */
  2. const scriptFiles = [
  3.   'internal/v8_prof_polyfill',
  4.   'v8/tools/splaytree',
  5.   'v8/tools/codemap',
  6.   'v8/tools/csvparser',
  7.   'v8/tools/consarray',
  8.   'v8/tools/profile',
  9.   'v8/tools/profile_view',
  10.   'v8/tools/logreader',
  11.   'v8/tools/tickprocessor',
  12.   'v8/tools/SourceMap',
  13.   'v8/tools/tickprocessor-driver'
  14. ];
  15. var script = '';
  16.  
  17. scriptFiles.forEach(function(s) {
  18.   script += process.binding('natives')[s] + '\n';
  19. });
  20.  
  21. // eslint-disable-next-line no-unused-vars
  22. function printErr(err) {
  23.   console.error(err);
  24. }
  25.  
  26. const tickArguments = [];
  27. if (process.platform === 'darwin') {
  28.   tickArguments.push('--mac');
  29. } else if (process.platform === 'win32') {
  30.   tickArguments.push('--windows');
  31. }
  32. tickArguments.push.apply(tickArguments, process.argv.slice(1));
  33. script = `(function() {
  34.   arguments = ${JSON.stringify(tickArguments)};
  35.   function write (s) { process.stdout.write(s) }
  36.   ${script}
  37. })()`;
  38. eval(script);

Raw Paste


Login or Register to edit or fork this paste. It's free.