Andreas (rossberg@) is on vacation this week, so it'll be a while before he can
chime in again.

I guess the alternative is to check in something like the following as
tools/node-tick-processor (modeled after linux-tick-processor and the polyfills
in your latest patch set):
---------------------
#!/bin/bash

TEMP_SCRIPT_FILE="/tmp/node-tick-processor-input-script"
tools_path=`cd $(dirname "$0");pwd`
log_file="v8.log"
for arg in "$@"
do
  if ! expr "X${arg}" : "^X-" > /dev/null; then
    log_file=${arg}
  fi
done

cat > $TEMP_SCRIPT_FILE << EOF
// Node polyfill
var os = os || {
  system: function(name, args) {
    return require('child_process').execFileSync(
        name, args, {encoding: 'utf8'}).toString();
  }
};
var print = print || console.log.bind(console);
var read = read || function(fileName) {
  return require('fs').readFileSync(fileName, 'utf8');
};
print("typeof process: " + typeof process);
print("process.argv: " + process.argv);
if (typeof process !== "undefined" && process.argv) {
  print("Polyfilling arguments");
  arguments = process.argv.slice(2);

  // Polyfill "readline()".
  var __readline_buffer__ = read(arguments[0]).split("\n");
  var __readline_index__ = 0;
  var readline = function() {
    if (__readline_index__ >= __readline_buffer__.length) return false;
    return __readline_buffer__[__readline_index__++];
  }
}
EOF

cat $tools_path/splaytree.js $tools_path/codemap.js \
  $tools_path/csvparser.js $tools_path/consarray.js \
  $tools_path/profile.js $tools_path/profile_view.js \
  $tools_path/logreader.js $tools_path/tickprocessor.js \
  $tools_path/SourceMap.js \
  $tools_path/tickprocessor-driver.js >> $TEMP_SCRIPT_FILE

node $TEMP_SCRIPT_FILE $log_file

rm -f $TEMP_SCRIPT_FILE
---------------------

For some reason with the nodejs-0.10.25 that happens to be on my machine, this script only mostly works: ticks in generated code aren't attributed properly, they all show up as "d8". I haven't debugged that. Maybe node 0.10 is just too
old, or maybe one of the polyfills isn't working right.

https://codereview.chromium.org/1179173009/

--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
--- You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to