Author: [email protected]
Date: Sat Jun 20 05:54:02 2009
New Revision: 2225

Modified:
    branches/bleeding_edge/tools/linux-tick-processor
    branches/bleeding_edge/tools/tickprocessor.js

Log:
Two requested changes to tick processor.

1. If D8_PATH isn't specified, first try to locate 'd8' shell in path,
    and if not found, fallback to the one in tools_path/..
2. Add '--nm=<nm_exec>' parameter to specify 'nm' executable to use.

Review URL: http://codereview.chromium.org/132021


Modified: branches/bleeding_edge/tools/linux-tick-processor
==============================================================================
--- branches/bleeding_edge/tools/linux-tick-processor   (original)
+++ branches/bleeding_edge/tools/linux-tick-processor   Sat Jun 20 05:54:02  
2009
@@ -1,12 +1,20 @@
  #!/bin/sh

  tools_path=`cd $(dirname "$0");pwd`
+if [ ! "$D8_PATH" ]; then
+  d8_public=`which d8`
+  if [ $d8_public ]; then D8_PATH=$(dirname "$d8_public"); fi
+fi
  [ "$D8_PATH" ] || D8_PATH=$tools_path/..
  d8_exec=$D8_PATH/d8

+if [ "$1" == "--no-build" ]; then
+  shift
+else
  # compile d8 if it doesn't exist, assuming this script
  # resides in the repository.
-[ -x $d8_exec ] || scons -j4 -C $D8_PATH -Y $tools_path/.. d8
+  [ -x $d8_exec ] || scons -j4 -C $D8_PATH -Y $tools_path/.. d8
+fi

  # nm spits out 'no symbols found' messages to stderr.
  $d8_exec $tools_path/splaytree.js $tools_path/codemap.js \

Modified: branches/bleeding_edge/tools/tickprocessor.js
==============================================================================
--- branches/bleeding_edge/tools/tickprocessor.js       (original)
+++ branches/bleeding_edge/tools/tickprocessor.js       Sat Jun 20 05:54:02 2009
@@ -412,9 +412,10 @@
  };


-function UnixCppEntriesProvider() {
+function UnixCppEntriesProvider(nmExec) {
    this.symbols = [];
    this.parsePos = 0;
+  this.nmExec = nmExec;
  };
  inherits(UnixCppEntriesProvider, CppEntriesProvider);

@@ -426,8 +427,8 @@
    this.parsePos = 0;
    try {
      this.symbols = [
-      os.system('nm', ['-C', '-n', libName], -1, -1),
-      os.system('nm', ['-C', '-n', '-D', libName], -1, -1)
+      os.system(this.nmExec, ['-C', '-n', libName], -1, -1),
+      os.system(this.nmExec, ['-C', '-n', '-D', libName], -1, -1)
      ];
    } catch (e) {
      // If the library cannot be found on this system let's not panic.
@@ -525,7 +526,8 @@
      platform: 'unix',
      stateFilter: null,
      ignoreUnknown: false,
-    separateIc: false
+    separateIc: false,
+    nm: 'nm'
    };
    var argsDispatch = {
      '-j': ['stateFilter', TickProcessor.VmStates.JS,
@@ -545,7 +547,9 @@
      '--unix': ['platform', 'unix',
          'Specify that we are running on *nix platform'],
      '--windows': ['platform', 'windows',
-        'Specify that we are running on Windows platform']
+        'Specify that we are running on Windows platform'],
+    '--nm': ['nm', 'nm',
+        'Specify the \'nm\' executable to use (e.g. --nm=/my_dir/nm)']
    };
    argsDispatch['--js'] = argsDispatch['-j'];
    argsDispatch['--gc'] = argsDispatch['-g'];
@@ -577,9 +581,15 @@
        break;
      }
      args.shift();
+    var userValue = null;
+    var eqPos = arg.indexOf('=');
+    if (eqPos != -1) {
+      userValue = arg.substr(eqPos + 1);
+      arg = arg.substr(0, eqPos);
+    }
      if (arg in argsDispatch) {
        var dispatch = argsDispatch[arg];
-      result[dispatch[0]] = dispatch[1];
+      result[dispatch[0]] = userValue == null ? dispatch[1] : userValue;
      } else {
        printUsageAndExit();
      }
@@ -594,7 +604,7 @@

  var params = processArguments(arguments);
  var tickProcessor = new TickProcessor(
-    params.platform == 'unix' ? new UnixCppEntriesProvider() :
+    params.platform == 'unix' ? new UnixCppEntriesProvider(params.nm) :
          new WindowsCppEntriesProvider(),
      params.separateIc,
      params.ignoreUnknown,

--~--~---------~--~----~------------~-------~--~----~
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
-~----------~----~----~----~------~----~------~--~---

Reply via email to