Author: [email protected]
Date: Tue Jul 7 06:06:40 2009
New Revision: 2377
Removed:
branches/bleeding_edge/test/mjsunit/tools/tickprocessor-test.default
branches/bleeding_edge/test/mjsunit/tools/tickprocessor-test.gc-state
branches/bleeding_edge/test/mjsunit/tools/tickprocessor-test.ignore-unknown
branches/bleeding_edge/test/mjsunit/tools/tickprocessor-test.log
branches/bleeding_edge/test/mjsunit/tools/tickprocessor-test.separate-ic
branches/bleeding_edge/test/mjsunit/tools/tickprocessor.js
branches/bleeding_edge/tools/tickprocessor-driver.js
Modified:
branches/bleeding_edge/test/mjsunit/testcfg.py
branches/bleeding_edge/tools/linux-tick-processor
branches/bleeding_edge/tools/tickprocessor.js
branches/bleeding_edge/tools/windows-tick-processor.bat
Log:
Revert r2372 to get the tree green again.
[email protected]
Review URL: http://codereview.chromium.org/155137
Modified: branches/bleeding_edge/test/mjsunit/testcfg.py
==============================================================================
--- branches/bleeding_edge/test/mjsunit/testcfg.py (original)
+++ branches/bleeding_edge/test/mjsunit/testcfg.py Tue Jul 7 06:06:40 2009
@@ -55,15 +55,10 @@
flags_match = FLAGS_PATTERN.search(source)
if flags_match:
result += flags_match.group(1).strip().split()
- additional_files = []
files_match = FILES_PATTERN.search(source);
- # Accept several lines of 'Files:'
- while True:
- if files_match:
- additional_files += files_match.group(1).strip().split()
- files_match = FILES_PATTERN.search(source, files_match.end())
- else:
- break
+ additional_files = []
+ if files_match:
+ additional_files += files_match.group(1).strip().split()
for a_file in additional_files:
result.append(join(dirname(self.config.root), '..', a_file))
framework = join(dirname(self.config.root), 'mjsunit', 'mjsunit.js')
Modified: branches/bleeding_edge/tools/linux-tick-processor
==============================================================================
--- branches/bleeding_edge/tools/linux-tick-processor (original)
+++ branches/bleeding_edge/tools/linux-tick-processor Tue Jul 7 06:06:40
2009
@@ -20,5 +20,4 @@
$d8_exec $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/tickprocessor-driver.js -- $@ 2>/dev/null
+ $tools_path/logreader.js $tools_path/tickprocessor.js -- $@ 2>/dev/null
Modified: branches/bleeding_edge/tools/tickprocessor.js
==============================================================================
--- branches/bleeding_edge/tools/tickprocessor.js (original)
+++ branches/bleeding_edge/tools/tickprocessor.js Tue Jul 7 06:06:40 2009
@@ -288,11 +288,7 @@
function padLeft(s, len) {
s = s.toString();
if (s.length < len) {
- var padLength = len - s.length;
- if (!(padLength in padLeft)) {
- padLeft[padLength] = new Array(padLength + 1).join(' ');
- }
- s = padLeft[padLength] + s;
+ s = (new Array(len - s.length + 1).join(' ')) + s;
}
return s;
};
@@ -515,11 +511,25 @@
};
-function ArgumentsProcessor(args) {
- this.args_ = args;
- this.result_ = ArgumentsProcessor.DEFAULTS;
+function padRight(s, len) {
+ s = s.toString();
+ if (s.length < len) {
+ s = s + (new Array(len - s.length + 1).join(' '));
+ }
+ return s;
+};
- this.argsDispatch_ = {
+
+function processArguments(args) {
+ var result = {
+ logFileName: 'v8.log',
+ platform: 'unix',
+ stateFilter: null,
+ ignoreUnknown: false,
+ separateIc: false,
+ nm: 'nm'
+ };
+ var argsDispatch = {
'-j': ['stateFilter', TickProcessor.VmStates.JS,
'Show only ticks from JS VM state'],
'-g': ['stateFilter', TickProcessor.VmStates.GC,
@@ -541,82 +551,63 @@
'--nm': ['nm', 'nm',
'Specify the \'nm\' executable to use (e.g. --nm=/my_dir/nm)']
};
- this.argsDispatch_['--js'] = this.argsDispatch_['-j'];
- this.argsDispatch_['--gc'] = this.argsDispatch_['-g'];
- this.argsDispatch_['--compiler'] = this.argsDispatch_['-c'];
- this.argsDispatch_['--other'] = this.argsDispatch_['-o'];
- this.argsDispatch_['--external'] = this.argsDispatch_['-e'];
-};
-
-
-ArgumentsProcessor.DEFAULTS = {
- logFileName: 'v8.log',
- platform: 'unix',
- stateFilter: null,
- ignoreUnknown: false,
- separateIc: false,
- nm: 'nm'
-};
-
+ argsDispatch['--js'] = argsDispatch['-j'];
+ argsDispatch['--gc'] = argsDispatch['-g'];
+ argsDispatch['--compiler'] = argsDispatch['-c'];
+ argsDispatch['--other'] = argsDispatch['-o'];
+ argsDispatch['--external'] = argsDispatch['-e'];
+
+ function printUsageAndExit() {
+ print('Cmdline args: [options] [log-file-name]\n' +
+ 'Default log file name is "v8.log".\n');
+ print('Options:');
+ for (var arg in argsDispatch) {
+ var synonims = [arg];
+ var dispatch = argsDispatch[arg];
+ for (var synArg in argsDispatch) {
+ if (arg !== synArg && dispatch === argsDispatch[synArg]) {
+ synonims.push(synArg);
+ delete argsDispatch[synArg];
+ }
+ }
+ print(' ' + padRight(synonims.join(', '), 20) + dispatch[2]);
+ }
+ quit(2);
+ }
-ArgumentsProcessor.prototype.parse = function() {
- while (this.args_.length) {
- var arg = this.args_[0];
+ while (args.length) {
+ var arg = args[0];
if (arg.charAt(0) != '-') {
break;
}
- this.args_.shift();
+ 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 this.argsDispatch_) {
- var dispatch = this.argsDispatch_[arg];
- this.result_[dispatch[0]] = userValue == null ? dispatch[1] :
userValue;
+ if (arg in argsDispatch) {
+ var dispatch = argsDispatch[arg];
+ result[dispatch[0]] = userValue == null ? dispatch[1] : userValue;
} else {
- return false;
+ printUsageAndExit();
}
}
- if (this.args_.length >= 1) {
- this.result_.logFileName = this.args_.shift();
+ if (args.length >= 1) {
+ result.logFileName = args.shift();
}
- return true;
-};
-
-
-ArgumentsProcessor.prototype.result = function() {
- return this.result_;
+ return result;
};
-ArgumentsProcessor.prototype.printUsageAndExit = function() {
-
- function padRight(s, len) {
- s = s.toString();
- if (s.length < len) {
- s = s + (new Array(len - s.length + 1).join(' '));
- }
- return s;
- }
-
- print('Cmdline args: [options] [log-file-name]\n' +
- 'Default log file name is "' +
- ArgumentsProcessor.DEFAULTS.logFileName + '".\n');
- print('Options:');
- for (var arg in this.argsDispatch_) {
- var synonims = [arg];
- var dispatch = this.argsDispatch_[arg];
- for (var synArg in this.argsDispatch_) {
- if (arg !== synArg && dispatch === this.argsDispatch_[synArg]) {
- synonims.push(synArg);
- delete this.argsDispatch_[synArg];
- }
- }
- print(' ' + padRight(synonims.join(', '), 20) + dispatch[2]);
- }
- quit(2);
-};
-
+var params = processArguments(arguments);
+var tickProcessor = new TickProcessor(
+ params.platform == 'unix' ? new UnixCppEntriesProvider(params.nm) :
+ new WindowsCppEntriesProvider(),
+ params.separateIc,
+ params.ignoreUnknown,
+ params.stateFilter);
+tickProcessor.processLogFile(params.logFileName);
+tickProcessor.printStatistics();
Modified: branches/bleeding_edge/tools/windows-tick-processor.bat
==============================================================================
--- branches/bleeding_edge/tools/windows-tick-processor.bat (original)
+++ branches/bleeding_edge/tools/windows-tick-processor.bat Tue Jul 7
06:06:40 2009
@@ -2,4 +2,4 @@
SET tools_dir=%~dp0
-%tools_dir%..\d8 %tools_dir%splaytree.js %tools_dir%codemap.js
%tools_dir%csvparser.js %tools_dir%consarray.js %tools_dir%profile.js
%tools_dir%profile_view.js %tools_dir%logreader.js %tools_dir%tickprocessor.js
%tools_dir%tickprocessor-driver.js
--
--windows %*
+%tools_dir%..\d8 %tools_dir%splaytree.js %tools_dir%codemap.js
%tools_dir%csvparser.js %tools_dir%consarray.js %tools_dir%profile.js
%tools_dir%profile_view.js %tools_dir%logreader.js %tools_dir%tickprocessor.js
--
--windows %*
--~--~---------~--~----~------------~-------~--~----~
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
-~----------~----~----~----~------~----~------~--~---