Upgrade V8 to version 4.9.385.28
https://chromium.googlesource.com/v8/v8/+/4.9.385.28
FPIIM-449
Change-Id: I4b2e74289d4bf3667f2f3dc8aa2e541f63e26eb4
diff --git a/tools/logreader.js b/tools/logreader.js
index 5f0ec7f..157a7fc 100644
--- a/tools/logreader.js
+++ b/tools/logreader.js
@@ -35,15 +35,31 @@
*
* @param {Array.<Object>} dispatchTable A table used for parsing and processing
* log records.
+ * @param {boolean} timedRange Ignore ticks outside timed range.
+ * @param {boolean} pairwiseTimedRange Ignore ticks outside pairs of timer
+ * markers.
* @constructor
*/
-function LogReader(dispatchTable) {
+function LogReader(dispatchTable, timedRange, pairwiseTimedRange) {
/**
* @type {Array.<Object>}
*/
this.dispatchTable_ = dispatchTable;
/**
+ * @type {boolean}
+ */
+ this.timedRange_ = timedRange;
+
+ /**
+ * @type {boolean}
+ */
+ this.pairwiseTimedRange_ = pairwiseTimedRange;
+ if (pairwiseTimedRange) {
+ this.timedRange_ = true;
+ }
+
+ /**
* Current line.
* @type {number}
*/
@@ -54,6 +70,18 @@
* @type {CsvParser}
*/
this.csvParser_ = new CsvParser();
+
+ /**
+ * Keeps track of whether we've seen a "current-time" tick yet.
+ * @type {boolean}
+ */
+ this.hasSeenTimerMarker_ = false;
+
+ /**
+ * List of log lines seen since last "current-time" tick.
+ * @type {Array.<String>}
+ */
+ this.logLinesSinceLastTimerMarker_ = [];
};
@@ -83,7 +111,28 @@
* @param {string} line A line of log.
*/
LogReader.prototype.processLogLine = function(line) {
- this.processLog_([line]);
+ if (!this.timedRange_) {
+ this.processLog_([line]);
+ return;
+ }
+ if (line.startsWith("current-time")) {
+ if (this.hasSeenTimerMarker_) {
+ this.processLog_(this.logLinesSinceLastTimerMarker_);
+ this.logLinesSinceLastTimerMarker_ = [];
+ // In pairwise mode, a "current-time" line ends the timed range.
+ if (this.pairwiseTimedRange_) {
+ this.hasSeenTimerMarker_ = false;
+ }
+ } else {
+ this.hasSeenTimerMarker_ = true;
+ }
+ } else {
+ if (this.hasSeenTimerMarker_) {
+ this.logLinesSinceLastTimerMarker_.push(line);
+ } else if (!line.startsWith("tick")) {
+ this.processLog_([line]);
+ }
+ }
};