Revision: 6712
Author: [email protected]
Date: Wed Feb  9 23:47:28 2011
Log: Shorten constructor names in JS tickprocessor.

As they are no more used in DevTools profiler, there is no
need to prefix them with "devtools.profiler" namespace.

Review URL: http://codereview.chromium.org/6456025
http://code.google.com/p/v8/source/detail?r=6712

Modified:
 /branches/bleeding_edge/test/mjsunit/tools/codemap.js
 /branches/bleeding_edge/test/mjsunit/tools/csvparser.js
 /branches/bleeding_edge/test/mjsunit/tools/profile.js
 /branches/bleeding_edge/test/mjsunit/tools/profile_view.js
 /branches/bleeding_edge/test/mjsunit/tools/splaytree.js
 /branches/bleeding_edge/tools/codemap.js
 /branches/bleeding_edge/tools/csvparser.js
 /branches/bleeding_edge/tools/logreader.js
 /branches/bleeding_edge/tools/profile.js
 /branches/bleeding_edge/tools/profile_view.js
 /branches/bleeding_edge/tools/splaytree.js
 /branches/bleeding_edge/tools/tickprocessor.js

=======================================
--- /branches/bleeding_edge/test/mjsunit/tools/codemap.js Tue Dec 7 03:01:02 2010 +++ /branches/bleeding_edge/test/mjsunit/tools/codemap.js Wed Feb 9 23:47:28 2011
@@ -30,7 +30,7 @@


 function newCodeEntry(size, name) {
-  return new devtools.profiler.CodeMap.CodeEntry(size, name);
+  return new CodeMap.CodeEntry(size, name);
 };


@@ -47,7 +47,7 @@


 (function testLibrariesAndStaticCode() {
-  var codeMap = new devtools.profiler.CodeMap();
+  var codeMap = new CodeMap();
   codeMap.addLibrary(0x1500, newCodeEntry(0x3000, 'lib1'));
   codeMap.addLibrary(0x15500, newCodeEntry(0x5000, 'lib2'));
   codeMap.addLibrary(0x155500, newCodeEntry(0x10000, 'lib3'));
@@ -97,7 +97,7 @@


 (function testDynamicCode() {
-  var codeMap = new devtools.profiler.CodeMap();
+  var codeMap = new CodeMap();
   codeMap.addCode(0x1500, newCodeEntry(0x200, 'code1'));
   codeMap.addCode(0x1700, newCodeEntry(0x100, 'code2'));
   codeMap.addCode(0x1900, newCodeEntry(0x50, 'code3'));
@@ -123,7 +123,7 @@


 (function testCodeMovesAndDeletions() {
-  var codeMap = new devtools.profiler.CodeMap();
+  var codeMap = new CodeMap();
   codeMap.addCode(0x1500, newCodeEntry(0x200, 'code1'));
   codeMap.addCode(0x1700, newCodeEntry(0x100, 'code2'));
   assertEntry(codeMap, 'code1', 0x1500);
@@ -139,7 +139,7 @@


 (function testDynamicNamesDuplicates() {
-  var codeMap = new devtools.profiler.CodeMap();
+  var codeMap = new CodeMap();
   // Code entries with same names but different addresses.
   codeMap.addCode(0x1500, newCodeEntry(0x200, 'code'));
   codeMap.addCode(0x1700, newCodeEntry(0x100, 'code'));
@@ -152,7 +152,7 @@


 (function testStaticEntriesExport() {
-  var codeMap = new devtools.profiler.CodeMap();
+  var codeMap = new CodeMap();
   codeMap.addStaticCode(0x1500, newCodeEntry(0x3000, 'lib1'));
   codeMap.addStaticCode(0x15500, newCodeEntry(0x5000, 'lib2'));
   codeMap.addStaticCode(0x155500, newCodeEntry(0x10000, 'lib3'));
@@ -163,7 +163,7 @@


 (function testDynamicEntriesExport() {
-  var codeMap = new devtools.profiler.CodeMap();
+  var codeMap = new CodeMap();
   codeMap.addCode(0x1500, newCodeEntry(0x200, 'code1'));
   codeMap.addCode(0x1700, newCodeEntry(0x100, 'code2'));
   codeMap.addCode(0x1900, newCodeEntry(0x50, 'code3'));
=======================================
--- /branches/bleeding_edge/test/mjsunit/tools/csvparser.js Tue Dec 7 03:01:02 2010 +++ /branches/bleeding_edge/test/mjsunit/tools/csvparser.js Wed Feb 9 23:47:28 2011
@@ -28,7 +28,7 @@
 // Load CSV parser implementation from <project root>/tools.
 // Files: tools/csvparser.js

-var parser = new devtools.profiler.CsvParser();
+var parser = new CsvParser();

 assertEquals(
     [],
=======================================
--- /branches/bleeding_edge/test/mjsunit/tools/profile.js Tue Dec 7 03:01:02 2010 +++ /branches/bleeding_edge/test/mjsunit/tools/profile.js Wed Feb 9 23:47:28 2011
@@ -58,7 +58,7 @@


 function ProfileTestDriver() {
-  this.profile = new devtools.profiler.Profile();
+  this.profile = new Profile();
   this.stack_ = [];
   this.addFunctions_();
 };
=======================================
--- /branches/bleeding_edge/test/mjsunit/tools/profile_view.js Tue Dec 7 03:01:02 2010 +++ /branches/bleeding_edge/test/mjsunit/tools/profile_view.js Wed Feb 9 23:47:28 2011
@@ -30,7 +30,7 @@


 function createNode(name, time, opt_parent) {
- var node = new devtools.profiler.ProfileView.Node(name, time, time, null);
+  var node = new ProfileView.Node(name, time, time, null);
   if (opt_parent) {
     opt_parent.addChild(node);
   }
@@ -61,7 +61,7 @@
    createNode('d', 4, b3);
    createNode('d', 2, b3);

-   var view = new devtools.profiler.ProfileView(root);
+   var view = new ProfileView(root);
    var flatTree = [];

    function fillFlatTree(node) {
=======================================
--- /branches/bleeding_edge/test/mjsunit/tools/splaytree.js Tue Dec 7 03:01:02 2010 +++ /branches/bleeding_edge/test/mjsunit/tools/splaytree.js Wed Feb 9 23:47:28 2011
@@ -30,7 +30,7 @@


 (function testIsEmpty() {
-  var tree = new goog.structs.SplayTree();
+  var tree = new SplayTree();
   assertTrue(tree.isEmpty());
   tree.insert(0, 'value');
   assertFalse(tree.isEmpty());
@@ -38,7 +38,7 @@


 (function testExportValues() {
-  var tree = new goog.structs.SplayTree();
+  var tree = new SplayTree();
   assertArrayEquals([], tree.exportValues());
   tree.insert(0, 'value');
   assertArrayEquals(['value'], tree.exportValues());
@@ -79,7 +79,7 @@


 (function testSplay() {
-  var tree = new goog.structs.SplayTree();
+  var tree = new SplayTree();
   tree.root_ = createSampleTree();
assertArrayEquals(['50', '30', '60', '10', '40', '90', '20', '70', '100', '15', '80'],
                     tree.exportValues());
@@ -93,7 +93,7 @@


 (function testInsert() {
-  var tree = new goog.structs.SplayTree();
+  var tree = new SplayTree();
   tree.insert(5, 'root');
   tree.insert(3, 'left');
   assertArrayEquals(['left', 'root'], tree.exportValues());
@@ -103,7 +103,7 @@


 (function testFind() {
-  var tree = new goog.structs.SplayTree();
+  var tree = new SplayTree();
   tree.insert(5, 'root');
   tree.insert(3, 'left');
   tree.insert(7, 'right');
@@ -117,7 +117,7 @@


 (function testFindMin() {
-  var tree = new goog.structs.SplayTree();
+  var tree = new SplayTree();
   assertEquals(null, tree.findMin());
   tree.insert(5, 'root');
   tree.insert(3, 'left');
@@ -127,7 +127,7 @@


 (function testFindMax() {
-  var tree = new goog.structs.SplayTree();
+  var tree = new SplayTree();
   assertEquals(null, tree.findMax());
   tree.insert(5, 'root');
   tree.insert(3, 'left');
@@ -137,7 +137,7 @@


 (function testFindGreatestLessThan() {
-  var tree = new goog.structs.SplayTree();
+  var tree = new SplayTree();
   assertEquals(null, tree.findGreatestLessThan(10));
   tree.insert(5, 'root');
   tree.insert(3, 'left');
@@ -151,7 +151,7 @@


 (function testRemove() {
-  var tree = new goog.structs.SplayTree();
+  var tree = new SplayTree();
   assertThrows('tree.remove(5)');
   tree.insert(5, 'root');
   tree.insert(3, 'left');
=======================================
--- /branches/bleeding_edge/tools/codemap.js    Tue Dec  7 03:01:02 2010
+++ /branches/bleeding_edge/tools/codemap.js    Wed Feb  9 23:47:28 2011
@@ -26,36 +26,31 @@
 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.


-// Initlialize namespaces
-var devtools = devtools || {};
-devtools.profiler = devtools.profiler || {};
-
-
 /**
  * Constructs a mapper that maps addresses into code entries.
  *
  * @constructor
  */
-devtools.profiler.CodeMap = function() {
+function CodeMap() {
   /**
    * Dynamic code entries. Used for JIT compiled code.
    */
-  this.dynamics_ = new goog.structs.SplayTree();
+  this.dynamics_ = new SplayTree();

   /**
    * Name generator for entries having duplicate names.
    */
-  this.dynamicsNameGen_ = new devtools.profiler.CodeMap.NameGenerator();
+  this.dynamicsNameGen_ = new CodeMap.NameGenerator();

   /**
    * Static code entries. Used for statically compiled code.
    */
-  this.statics_ = new goog.structs.SplayTree();
+  this.statics_ = new SplayTree();

   /**
    * Libraries entries. Used for the whole static code libraries.
    */
-  this.libraries_ = new goog.structs.SplayTree();
+  this.libraries_ = new SplayTree();

   /**
    * Map of memory pages occupied with static code.
@@ -67,23 +62,23 @@
 /**
  * The number of alignment bits in a page address.
  */
-devtools.profiler.CodeMap.PAGE_ALIGNMENT = 12;
+CodeMap.PAGE_ALIGNMENT = 12;


 /**
  * Page size in bytes.
  */
-devtools.profiler.CodeMap.PAGE_SIZE =
-    1 << devtools.profiler.CodeMap.PAGE_ALIGNMENT;
+CodeMap.PAGE_SIZE =
+    1 << CodeMap.PAGE_ALIGNMENT;


 /**
  * Adds a dynamic (i.e. moveable and discardable) code entry.
  *
  * @param {number} start The starting address.
- * @param {devtools.profiler.CodeMap.CodeEntry} codeEntry Code entry object.
+ * @param {CodeMap.CodeEntry} codeEntry Code entry object.
  */
-devtools.profiler.CodeMap.prototype.addCode = function(start, codeEntry) {
+CodeMap.prototype.addCode = function(start, codeEntry) {
   this.dynamics_.insert(start, codeEntry);
 };

@@ -95,7 +90,7 @@
  * @param {number} from The starting address of the entry being moved.
  * @param {number} to The destination address.
  */
-devtools.profiler.CodeMap.prototype.moveCode = function(from, to) {
+CodeMap.prototype.moveCode = function(from, to) {
   var removedNode = this.dynamics_.remove(from);
   this.dynamics_.insert(to, removedNode.value);
 };
@@ -107,7 +102,7 @@
  *
  * @param {number} start The starting address of the entry being deleted.
  */
-devtools.profiler.CodeMap.prototype.deleteCode = function(start) {
+CodeMap.prototype.deleteCode = function(start) {
   var removedNode = this.dynamics_.remove(start);
 };

@@ -116,9 +111,9 @@
  * Adds a library entry.
  *
  * @param {number} start The starting address.
- * @param {devtools.profiler.CodeMap.CodeEntry} codeEntry Code entry object.
+ * @param {CodeMap.CodeEntry} codeEntry Code entry object.
  */
-devtools.profiler.CodeMap.prototype.addLibrary = function(
+CodeMap.prototype.addLibrary = function(
     start, codeEntry) {
   this.markPages_(start, start + codeEntry.size);
   this.libraries_.insert(start, codeEntry);
@@ -129,9 +124,9 @@
  * Adds a static code entry.
  *
  * @param {number} start The starting address.
- * @param {devtools.profiler.CodeMap.CodeEntry} codeEntry Code entry object.
+ * @param {CodeMap.CodeEntry} codeEntry Code entry object.
  */
-devtools.profiler.CodeMap.prototype.addStaticCode = function(
+CodeMap.prototype.addStaticCode = function(
     start, codeEntry) {
   this.statics_.insert(start, codeEntry);
 };
@@ -140,10 +135,10 @@
 /**
  * @private
  */
-devtools.profiler.CodeMap.prototype.markPages_ = function(start, end) {
+CodeMap.prototype.markPages_ = function(start, end) {
   for (var addr = start; addr <= end;
-       addr += devtools.profiler.CodeMap.PAGE_SIZE) {
-    this.pages_[addr >>> devtools.profiler.CodeMap.PAGE_ALIGNMENT] = 1;
+       addr += CodeMap.PAGE_SIZE) {
+    this.pages_[addr >>> CodeMap.PAGE_ALIGNMENT] = 1;
   }
 };

@@ -151,7 +146,7 @@
 /**
  * @private
  */
-devtools.profiler.CodeMap.prototype.isAddressBelongsTo_ = function(addr, node) {
+CodeMap.prototype.isAddressBelongsTo_ = function(addr, node) {
   return addr >= node.key && addr < (node.key + node.value.size);
 };

@@ -159,7 +154,7 @@
 /**
  * @private
  */
-devtools.profiler.CodeMap.prototype.findInTree_ = function(tree, addr) {
+CodeMap.prototype.findInTree_ = function(tree, addr) {
   var node = tree.findGreatestLessThan(addr);
   return node && this.isAddressBelongsTo_(addr, node) ? node.value : null;
 };
@@ -171,8 +166,8 @@
  *
  * @param {number} addr Address.
  */
-devtools.profiler.CodeMap.prototype.findEntry = function(addr) {
-  var pageAddr = addr >>> devtools.profiler.CodeMap.PAGE_ALIGNMENT;
+CodeMap.prototype.findEntry = function(addr) {
+  var pageAddr = addr >>> CodeMap.PAGE_ALIGNMENT;
   if (pageAddr in this.pages_) {
     // Static code entries can contain "holes" of unnamed code.
     // In this case, the whole library is assigned to this address.
@@ -200,7 +195,7 @@
  *
  * @param {number} addr Address.
  */
-devtools.profiler.CodeMap.prototype.findDynamicEntryByStartAddress =
+CodeMap.prototype.findDynamicEntryByStartAddress =
     function(addr) {
   var node = this.dynamics_.find(addr);
   return node ? node.value : null;
@@ -210,7 +205,7 @@
 /**
  * Returns an array of all dynamic code entries.
  */
-devtools.profiler.CodeMap.prototype.getAllDynamicEntries = function() {
+CodeMap.prototype.getAllDynamicEntries = function() {
   return this.dynamics_.exportValues();
 };

@@ -218,7 +213,7 @@
 /**
  * Returns an array of all static code entries.
  */
-devtools.profiler.CodeMap.prototype.getAllStaticEntries = function() {
+CodeMap.prototype.getAllStaticEntries = function() {
   return this.statics_.exportValues();
 };

@@ -226,7 +221,7 @@
 /**
  * Returns an array of all libraries entries.
  */
-devtools.profiler.CodeMap.prototype.getAllLibrariesEntries = function() {
+CodeMap.prototype.getAllLibrariesEntries = function() {
   return this.libraries_.exportValues();
 };

@@ -238,29 +233,29 @@
  * @param {string} opt_name Code entry name.
  * @constructor
  */
-devtools.profiler.CodeMap.CodeEntry = function(size, opt_name) {
+CodeMap.CodeEntry = function(size, opt_name) {
   this.size = size;
   this.name = opt_name || '';
   this.nameUpdated_ = false;
 };


-devtools.profiler.CodeMap.CodeEntry.prototype.getName = function() {
+CodeMap.CodeEntry.prototype.getName = function() {
   return this.name;
 };


-devtools.profiler.CodeMap.CodeEntry.prototype.toString = function() {
+CodeMap.CodeEntry.prototype.toString = function() {
   return this.name + ': ' + this.size.toString(16);
 };


-devtools.profiler.CodeMap.NameGenerator = function() {
+CodeMap.NameGenerator = function() {
   this.knownNames_ = {};
 };


-devtools.profiler.CodeMap.NameGenerator.prototype.getName = function(name) {
+CodeMap.NameGenerator.prototype.getName = function(name) {
   if (!(name in this.knownNames_)) {
     this.knownNames_[name] = 0;
     return name;
=======================================
--- /branches/bleeding_edge/tools/csvparser.js  Tue Dec  7 03:01:02 2010
+++ /branches/bleeding_edge/tools/csvparser.js  Wed Feb  9 23:47:28 2011
@@ -26,15 +26,10 @@
 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.


-// Initlialize namespaces.
-var devtools = devtools || {};
-devtools.profiler = devtools.profiler || {};
-
-
 /**
  * Creates a CSV lines parser.
  */
-devtools.profiler.CsvParser = function() {
+function CsvParser() {
 };


@@ -42,14 +37,14 @@
  * A regex for matching a CSV field.
  * @private
  */
-devtools.profiler.CsvParser.CSV_FIELD_RE_ = /^"((?:[^"]|"")*)"|([^,]*)/;
+CsvParser.CSV_FIELD_RE_ = /^"((?:[^"]|"")*)"|([^,]*)/;


 /**
  * A regex for matching a double quote.
  * @private
  */
-devtools.profiler.CsvParser.DOUBLE_QUOTE_RE_ = /""/g;
+CsvParser.DOUBLE_QUOTE_RE_ = /""/g;


 /**
@@ -57,9 +52,9 @@
  *
  * @param {string} line Input line.
  */
-devtools.profiler.CsvParser.prototype.parseLine = function(line) {
-  var fieldRe = devtools.profiler.CsvParser.CSV_FIELD_RE_;
-  var doubleQuoteRe = devtools.profiler.CsvParser.DOUBLE_QUOTE_RE_;
+CsvParser.prototype.parseLine = function(line) {
+  var fieldRe = CsvParser.CSV_FIELD_RE_;
+  var doubleQuoteRe = CsvParser.DOUBLE_QUOTE_RE_;
   var pos = 0;
   var endPos = line.length;
   var fields = [];
=======================================
--- /branches/bleeding_edge/tools/logreader.js  Tue Dec  7 05:24:22 2010
+++ /branches/bleeding_edge/tools/logreader.js  Wed Feb  9 23:47:28 2011
@@ -29,10 +29,6 @@
  * @fileoverview Log Reader is used to process log file produced by V8.
  */

-// Initlialize namespaces
-var devtools = devtools || {};
-devtools.profiler = devtools.profiler || {};
-

 /**
  * Base class for processing log files.
@@ -41,7 +37,7 @@
  *     log records.
  * @constructor
  */
-devtools.profiler.LogReader = function(dispatchTable) {
+function LogReader(dispatchTable) {
   /**
    * @type {Array.<Object>}
    */
@@ -55,9 +51,9 @@

   /**
    * CSV lines parser.
-   * @type {devtools.profiler.CsvParser}
+   * @type {CsvParser}
    */
-  this.csvParser_ = new devtools.profiler.CsvParser();
+  this.csvParser_ = new CsvParser();
 };


@@ -66,7 +62,7 @@
  *
  * @param {string} str Error message.
  */
-devtools.profiler.LogReader.prototype.printError = function(str) {
+LogReader.prototype.printError = function(str) {
   // Do nothing.
 };

@@ -76,7 +72,7 @@
  *
  * @param {string} chunk A portion of log.
  */
-devtools.profiler.LogReader.prototype.processLogChunk = function(chunk) {
+LogReader.prototype.processLogChunk = function(chunk) {
   this.processLog_(chunk.split('\n'));
 };

@@ -86,7 +82,7 @@
  *
  * @param {string} line A line of log.
  */
-devtools.profiler.LogReader.prototype.processLogLine = function(line) {
+LogReader.prototype.processLogLine = function(line) {
   this.processLog_([line]);
 };

@@ -99,7 +95,7 @@
  * @param {Array.<string>} stack String representation of a stack.
  * @return {Array.<number>} Processed stack.
  */
-devtools.profiler.LogReader.prototype.processStack = function(pc, func, stack) {
+LogReader.prototype.processStack = function(pc, func, stack) {
   var fullStack = func ? [pc, func] : [pc];
   var prevFrame = pc;
   for (var i = 0, n = stack.length; i < n; ++i) {
@@ -124,7 +120,7 @@
  * @param {!Object} dispatch Dispatch record.
  * @return {boolean} True if dispatch must be skipped.
  */
-devtools.profiler.LogReader.prototype.skipDispatch = function(dispatch) {
+LogReader.prototype.skipDispatch = function(dispatch) {
   return false;
 };

@@ -135,7 +131,7 @@
  * @param {Array.<string>} fields Log record.
  * @private
  */
-devtools.profiler.LogReader.prototype.dispatchLogRow_ = function(fields) {
+LogReader.prototype.dispatchLogRow_ = function(fields) {
   // Obtain the dispatch.
   var command = fields[0];
   if (!(command in this.dispatchTable_)) {
@@ -173,7 +169,7 @@
  * @param {Array.<string>} lines Log lines.
  * @private
  */
-devtools.profiler.LogReader.prototype.processLog_ = function(lines) {
+LogReader.prototype.processLog_ = function(lines) {
   for (var i = 0, n = lines.length; i < n; ++i, ++this.lineNum_) {
     var line = lines[i];
     if (!line) {
=======================================
--- /branches/bleeding_edge/tools/profile.js    Tue Dec  7 03:01:02 2010
+++ /branches/bleeding_edge/tools/profile.js    Wed Feb  9 23:47:28 2011
@@ -26,27 +26,22 @@
 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.


-// Initlialize namespaces
-var devtools = devtools || {};
-devtools.profiler = devtools.profiler || {};
-
-
 /**
  * Creates a profile object for processing profiling-related events
  * and calculating function execution times.
  *
  * @constructor
  */
-devtools.profiler.Profile = function() {
-  this.codeMap_ = new devtools.profiler.CodeMap();
-  this.topDownTree_ = new devtools.profiler.CallTree();
-  this.bottomUpTree_ = new devtools.profiler.CallTree();
+function Profile() {
+  this.codeMap_ = new CodeMap();
+  this.topDownTree_ = new CallTree();
+  this.bottomUpTree_ = new CallTree();
 };

 /**
  * Version of profiler log.
  */
-devtools.profiler.Profile.VERSION = 2;
+Profile.VERSION = 2;


 /**
@@ -55,7 +50,7 @@
  *
  * @param {string} name Function name.
  */
-devtools.profiler.Profile.prototype.skipThisFunction = function(name) {
+Profile.prototype.skipThisFunction = function(name) {
   return false;
 };

@@ -66,7 +61,7 @@
  *
  * @enum {number}
  */
-devtools.profiler.Profile.Operation = {
+Profile.Operation = {
   MOVE: 0,
   DELETE: 1,
   TICK: 2
@@ -76,7 +71,7 @@
 /**
  * Called whenever the specified operation has failed finding a function
  * containing the specified address. Should be overriden by subclasses.
- * See the devtools.profiler.Profile.Operation enum for the list of
+ * See the Profile.Operation enum for the list of
  * possible operations.
  *
  * @param {number} operation Operation.
@@ -85,7 +80,7 @@
  *     during stack strace processing, specifies a position of the frame
  *     containing the address.
  */
-devtools.profiler.Profile.prototype.handleUnknownCode = function(
+Profile.prototype.handleUnknownCode = function(
     operation, addr, opt_stackPos) {
 };

@@ -97,9 +92,9 @@
  * @param {number} startAddr Starting address.
  * @param {number} endAddr Ending address.
  */
-devtools.profiler.Profile.prototype.addLibrary = function(
+Profile.prototype.addLibrary = function(
     name, startAddr, endAddr) {
-  var entry = new devtools.profiler.CodeMap.CodeEntry(
+  var entry = new CodeMap.CodeEntry(
       endAddr - startAddr, name);
   this.codeMap_.addLibrary(startAddr, entry);
   return entry;
@@ -113,9 +108,9 @@
  * @param {number} startAddr Starting address.
  * @param {number} endAddr Ending address.
  */
-devtools.profiler.Profile.prototype.addStaticCode = function(
+Profile.prototype.addStaticCode = function(
     name, startAddr, endAddr) {
-  var entry = new devtools.profiler.CodeMap.CodeEntry(
+  var entry = new CodeMap.CodeEntry(
       endAddr - startAddr, name);
   this.codeMap_.addStaticCode(startAddr, entry);
   return entry;
@@ -130,9 +125,9 @@
  * @param {number} start Starting address.
  * @param {number} size Code entry size.
  */
-devtools.profiler.Profile.prototype.addCode = function(
+Profile.prototype.addCode = function(
     type, name, start, size) {
- var entry = new devtools.profiler.Profile.DynamicCodeEntry(size, type, name);
+  var entry = new Profile.DynamicCodeEntry(size, type, name);
   this.codeMap_.addCode(start, entry);
   return entry;
 };
@@ -144,7 +139,7 @@
  * @param {number} aliasAddr Alias address.
  * @param {number} addr Code entry address.
  */
-devtools.profiler.Profile.prototype.addCodeAlias = function(
+Profile.prototype.addCodeAlias = function(
     aliasAddr, addr) {
   var entry = this.codeMap_.findDynamicEntryByStartAddress(addr);
   if (entry) {
@@ -159,11 +154,11 @@
  * @param {number} from Current code entry address.
  * @param {number} to New code entry address.
  */
-devtools.profiler.Profile.prototype.moveCode = function(from, to) {
+Profile.prototype.moveCode = function(from, to) {
   try {
     this.codeMap_.moveCode(from, to);
   } catch (e) {
-    this.handleUnknownCode(devtools.profiler.Profile.Operation.MOVE, from);
+    this.handleUnknownCode(Profile.Operation.MOVE, from);
   }
 };

@@ -173,11 +168,11 @@
  *
  * @param {number} start Starting address.
  */
-devtools.profiler.Profile.prototype.deleteCode = function(start) {
+Profile.prototype.deleteCode = function(start) {
   try {
     this.codeMap_.deleteCode(start);
   } catch (e) {
- this.handleUnknownCode(devtools.profiler.Profile.Operation.DELETE, start);
+    this.handleUnknownCode(Profile.Operation.DELETE, start);
   }
 };

@@ -188,7 +183,7 @@
  * @param {number} from Current code entry address.
  * @param {number} to New code entry address.
  */
-devtools.profiler.Profile.prototype.safeMoveDynamicCode = function(from, to) {
+Profile.prototype.safeMoveDynamicCode = function(from, to) {
   if (this.codeMap_.findDynamicEntryByStartAddress(from)) {
     this.codeMap_.moveCode(from, to);
   }
@@ -200,7 +195,7 @@
  *
  * @param {number} start Starting address.
  */
-devtools.profiler.Profile.prototype.safeDeleteDynamicCode = function(start) {
+Profile.prototype.safeDeleteDynamicCode = function(start) {
   if (this.codeMap_.findDynamicEntryByStartAddress(start)) {
     this.codeMap_.deleteCode(start);
   }
@@ -212,7 +207,7 @@
  *
  * @param {number} addr Entry address.
  */
-devtools.profiler.Profile.prototype.findEntry = function(addr) {
+Profile.prototype.findEntry = function(addr) {
   return this.codeMap_.findEntry(addr);
 };

@@ -223,7 +218,7 @@
  *
  * @param {Array<number>} stack Stack sample.
  */
-devtools.profiler.Profile.prototype.recordTick = function(stack) {
+Profile.prototype.recordTick = function(stack) {
   var processedStack = this.resolveAndFilterFuncs_(stack);
   this.bottomUpTree_.addPath(processedStack);
   processedStack.reverse();
@@ -237,7 +232,7 @@
  *
  * @param {Array<number>} stack Stack sample.
  */
-devtools.profiler.Profile.prototype.resolveAndFilterFuncs_ = function(stack) {
+Profile.prototype.resolveAndFilterFuncs_ = function(stack) {
   var result = [];
   for (var i = 0; i < stack.length; ++i) {
     var entry = this.codeMap_.findEntry(stack[i]);
@@ -248,7 +243,7 @@
       }
     } else {
       this.handleUnknownCode(
-          devtools.profiler.Profile.Operation.TICK, stack[i], i);
+          Profile.Operation.TICK, stack[i], i);
     }
   }
   return result;
@@ -258,9 +253,9 @@
 /**
  * Performs a BF traversal of the top down call graph.
  *
- * @param {function(devtools.profiler.CallTree.Node)} f Visitor function.
+ * @param {function(CallTree.Node)} f Visitor function.
  */
-devtools.profiler.Profile.prototype.traverseTopDownTree = function(f) {
+Profile.prototype.traverseTopDownTree = function(f) {
   this.topDownTree_.traverse(f);
 };

@@ -268,9 +263,9 @@
 /**
  * Performs a BF traversal of the bottom up call graph.
  *
- * @param {function(devtools.profiler.CallTree.Node)} f Visitor function.
+ * @param {function(CallTree.Node)} f Visitor function.
  */
-devtools.profiler.Profile.prototype.traverseBottomUpTree = function(f) {
+Profile.prototype.traverseBottomUpTree = function(f) {
   this.bottomUpTree_.traverse(f);
 };

@@ -281,7 +276,7 @@
  *
  * @param {string} opt_label Node label.
  */
-devtools.profiler.Profile.prototype.getTopDownProfile = function(opt_label) {
+Profile.prototype.getTopDownProfile = function(opt_label) {
   return this.getTreeProfile_(this.topDownTree_, opt_label);
 };

@@ -292,7 +287,7 @@
  *
  * @param {string} opt_label Node label.
  */
-devtools.profiler.Profile.prototype.getBottomUpProfile = function(opt_label) {
+Profile.prototype.getBottomUpProfile = function(opt_label) {
   return this.getTreeProfile_(this.bottomUpTree_, opt_label);
 };

@@ -300,10 +295,10 @@
 /**
  * Helper function for calculating a tree profile.
  *
- * @param {devtools.profiler.Profile.CallTree} tree Call tree.
+ * @param {Profile.CallTree} tree Call tree.
  * @param {string} opt_label Node label.
  */
-devtools.profiler.Profile.prototype.getTreeProfile_ = function(tree, opt_label) {
+Profile.prototype.getTreeProfile_ = function(tree, opt_label) {
   if (!opt_label) {
     tree.computeTotalWeights();
     return tree;
@@ -321,9 +316,9 @@
  *
  * @param {string} opt_label Starting node label.
  */
-devtools.profiler.Profile.prototype.getFlatProfile = function(opt_label) {
-  var counters = new devtools.profiler.CallTree();
-  var rootLabel = opt_label || devtools.profiler.CallTree.ROOT_NODE_LABEL;
+Profile.prototype.getFlatProfile = function(opt_label) {
+  var counters = new CallTree();
+  var rootLabel = opt_label || CallTree.ROOT_NODE_LABEL;
   var precs = {};
   precs[rootLabel] = 0;
   var root = counters.findOrAddChild(rootLabel);
@@ -378,8 +373,8 @@
  * @param {string} name Function name.
  * @constructor
  */
-devtools.profiler.Profile.DynamicCodeEntry = function(size, type, name) {
-  devtools.profiler.CodeMap.CodeEntry.call(this, size, name);
+Profile.DynamicCodeEntry = function(size, type, name) {
+  CodeMap.CodeEntry.call(this, size, name);
   this.type = type;
 };

@@ -387,7 +382,7 @@
 /**
  * Returns node name.
  */
-devtools.profiler.Profile.DynamicCodeEntry.prototype.getName = function() {
+Profile.DynamicCodeEntry.prototype.getName = function() {
   var name = this.name;
   if (name.length == 0) {
     name = '<anonymous>';
@@ -402,12 +397,12 @@
 /**
  * Returns raw node name (without type decoration).
  */
-devtools.profiler.Profile.DynamicCodeEntry.prototype.getRawName = function() {
+Profile.DynamicCodeEntry.prototype.getRawName = function() {
   return this.name;
 };


-devtools.profiler.Profile.DynamicCodeEntry.prototype.isJSFunction = function() {
+Profile.DynamicCodeEntry.prototype.isJSFunction = function() {
   return this.type == "Function" ||
     this.type == "LazyCompile" ||
     this.type == "Script";
@@ -419,28 +414,28 @@
  *
  * @constructor
  */
-devtools.profiler.CallTree = function() {
-  this.root_ = new devtools.profiler.CallTree.Node(
-      devtools.profiler.CallTree.ROOT_NODE_LABEL);
+function CallTree() {
+  this.root_ = new CallTree.Node(
+      CallTree.ROOT_NODE_LABEL);
 };


 /**
  * The label of the root node.
  */
-devtools.profiler.CallTree.ROOT_NODE_LABEL = '';
+CallTree.ROOT_NODE_LABEL = '';


 /**
  * @private
  */
-devtools.profiler.CallTree.prototype.totalsComputed_ = false;
+CallTree.prototype.totalsComputed_ = false;


 /**
  * Returns the tree root.
  */
-devtools.profiler.CallTree.prototype.getRoot = function() {
+CallTree.prototype.getRoot = function() {
   return this.root_;
 };

@@ -450,7 +445,7 @@
  *
  * @param {Array<string>} path Call path.
  */
-devtools.profiler.CallTree.prototype.addPath = function(path) {
+CallTree.prototype.addPath = function(path) {
   if (path.length == 0) {
     return;
   }
@@ -470,7 +465,7 @@
  *
  * @param {string} label Child node label.
  */
-devtools.profiler.CallTree.prototype.findOrAddChild = function(label) {
+CallTree.prototype.findOrAddChild = function(label) {
   return this.root_.findOrAddChild(label);
 };

@@ -491,8 +486,8 @@
  *
  * @param {string} label The label of the new root node.
  */
-devtools.profiler.CallTree.prototype.cloneSubtree = function(label) {
-  var subTree = new devtools.profiler.CallTree();
+CallTree.prototype.cloneSubtree = function(label) {
+  var subTree = new CallTree();
   this.traverse(function(node, parent) {
     if (!parent && node.label != label) {
       return null;
@@ -508,7 +503,7 @@
 /**
  * Computes total weights in the call graph.
  */
-devtools.profiler.CallTree.prototype.computeTotalWeights = function() {
+CallTree.prototype.computeTotalWeights = function() {
   if (this.totalsComputed_) {
     return;
   }
@@ -529,10 +524,10 @@
  *   return nodeClone;
  * });
  *
- * @param {function(devtools.profiler.CallTree.Node, *)} f Visitor function.
+ * @param {function(CallTree.Node, *)} f Visitor function.
  *    The second parameter is the result of calling 'f' on the parent node.
  */
-devtools.profiler.CallTree.prototype.traverse = function(f) {
+CallTree.prototype.traverse = function(f) {
   var pairsToProcess = new ConsArray();
   pairsToProcess.concat([{node: this.root_, param: null}]);
   while (!pairsToProcess.atEnd()) {
@@ -550,12 +545,12 @@
 /**
  * Performs an indepth call graph traversal.
  *
- * @param {function(devtools.profiler.CallTree.Node)} enter A function called
+ * @param {function(CallTree.Node)} enter A function called
  *     prior to visiting node's children.
- * @param {function(devtools.profiler.CallTree.Node)} exit A function called
+ * @param {function(CallTree.Node)} exit A function called
  *     after visiting node's children.
  */
-devtools.profiler.CallTree.prototype.traverseInDepth = function(enter, exit) {
+CallTree.prototype.traverseInDepth = function(enter, exit) {
   function traverse(node) {
     enter(node);
     node.forEachChild(traverse);
@@ -569,9 +564,9 @@
  * Constructs a call graph node.
  *
  * @param {string} label Node label.
- * @param {devtools.profiler.CallTree.Node} opt_parent Node parent.
+ * @param {CallTree.Node} opt_parent Node parent.
  */
-devtools.profiler.CallTree.Node = function(label, opt_parent) {
+CallTree.Node = function(label, opt_parent) {
   this.label = label;
   this.parent = opt_parent;
   this.children = {};
@@ -583,14 +578,14 @@
  * a call path).
  * @type {number}
  */
-devtools.profiler.CallTree.Node.prototype.selfWeight = 0;
+CallTree.Node.prototype.selfWeight = 0;


 /**
  * Node total weight (includes weights of all children).
  * @type {number}
  */
-devtools.profiler.CallTree.Node.prototype.totalWeight = 0;
+CallTree.Node.prototype.totalWeight = 0;


 /**
@@ -598,8 +593,8 @@
  *
  * @param {string} label Child node label.
  */
-devtools.profiler.CallTree.Node.prototype.addChild = function(label) {
-  var child = new devtools.profiler.CallTree.Node(label, this);
+CallTree.Node.prototype.addChild = function(label) {
+  var child = new CallTree.Node(label, this);
   this.children[label] = child;
   return child;
 };
@@ -608,7 +603,7 @@
 /**
  * Computes node's total weight.
  */
-devtools.profiler.CallTree.Node.prototype.computeTotalWeight =
+CallTree.Node.prototype.computeTotalWeight =
     function() {
   var totalWeight = this.selfWeight;
   this.forEachChild(function(child) {
@@ -620,7 +615,7 @@
 /**
  * Returns all node's children as an array.
  */
-devtools.profiler.CallTree.Node.prototype.exportChildren = function() {
+CallTree.Node.prototype.exportChildren = function() {
   var result = [];
   this.forEachChild(function (node) { result.push(node); });
   return result;
@@ -632,7 +627,7 @@
  *
  * @param {string} label Child node label.
  */
-devtools.profiler.CallTree.Node.prototype.findChild = function(label) {
+CallTree.Node.prototype.findChild = function(label) {
   return this.children[label] || null;
 };

@@ -643,7 +638,7 @@
  *
  * @param {string} label Child node label.
  */
-devtools.profiler.CallTree.Node.prototype.findOrAddChild = function(label) {
+CallTree.Node.prototype.findOrAddChild = function(label) {
   return this.findChild(label) || this.addChild(label);
 };

@@ -651,9 +646,9 @@
 /**
  * Calls the specified function for every child.
  *
- * @param {function(devtools.profiler.CallTree.Node)} f Visitor function.
+ * @param {function(CallTree.Node)} f Visitor function.
  */
-devtools.profiler.CallTree.Node.prototype.forEachChild = function(f) {
+CallTree.Node.prototype.forEachChild = function(f) {
   for (var c in this.children) {
     f(this.children[c]);
   }
@@ -663,9 +658,9 @@
 /**
  * Walks up from the current node up to the call tree root.
  *
- * @param {function(devtools.profiler.CallTree.Node)} f Visitor function.
+ * @param {function(CallTree.Node)} f Visitor function.
  */
-devtools.profiler.CallTree.Node.prototype.walkUpToRoot = function(f) {
+CallTree.Node.prototype.walkUpToRoot = function(f) {
   for (var curr = this; curr != null; curr = curr.parent) {
     f(curr);
   }
@@ -676,9 +671,9 @@
  * Tries to find a node with the specified path.
  *
  * @param {Array<string>} labels The path.
- * @param {function(devtools.profiler.CallTree.Node)} opt_f Visitor function.
+ * @param {function(CallTree.Node)} opt_f Visitor function.
  */
-devtools.profiler.CallTree.Node.prototype.descendToChild = function(
+CallTree.Node.prototype.descendToChild = function(
     labels, opt_f) {
for (var pos = 0, curr = this; pos < labels.length && curr != null; pos++) {
     var child = curr.findChild(labels[pos]);
=======================================
--- /branches/bleeding_edge/tools/profile_view.js       Tue Dec  7 03:01:02 2010
+++ /branches/bleeding_edge/tools/profile_view.js       Wed Feb  9 23:47:28 2011
@@ -26,18 +26,13 @@
 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.


-// Initlialize namespaces
-var devtools = devtools || {};
-devtools.profiler = devtools.profiler || {};
-
-
 /**
  * Creates a Profile View builder object.
  *
  * @param {number} samplingRate Number of ms between profiler ticks.
  * @constructor
  */
-devtools.profiler.ViewBuilder = function(samplingRate) {
+function ViewBuilder(samplingRate) {
   this.samplingRate = samplingRate;
 };

@@ -45,11 +40,11 @@
 /**
  * Builds a profile view for the specified call tree.
  *
- * @param {devtools.profiler.CallTree} callTree A call tree.
+ * @param {CallTree} callTree A call tree.
  * @param {boolean} opt_bottomUpViewWeights Whether remapping
  *     of self weights for a bottom up view is needed.
  */
-devtools.profiler.ViewBuilder.prototype.buildView = function(
+ViewBuilder.prototype.buildView = function(
     callTree, opt_bottomUpViewWeights) {
   var head;
   var samplingRate = this.samplingRate;
@@ -80,11 +75,11 @@
 /**
  * Factory method for a profile view.
  *
- * @param {devtools.profiler.ProfileView.Node} head View head node.
- * @return {devtools.profiler.ProfileView} Profile view.
+ * @param {ProfileView.Node} head View head node.
+ * @return {ProfileView} Profile view.
  */
-devtools.profiler.ViewBuilder.prototype.createView = function(head) {
-  return new devtools.profiler.ProfileView(head);
+ViewBuilder.prototype.createView = function(head) {
+  return new ProfileView(head);
 };


@@ -97,12 +92,12 @@
  *     profile they can be either callees or callers.)
  * @param {number} selfTime Amount of time that application spent in the
  *     corresponding function only.
- * @param {devtools.profiler.ProfileView.Node} head Profile view head.
- * @return {devtools.profiler.ProfileView.Node} Profile view node.
+ * @param {ProfileView.Node} head Profile view head.
+ * @return {ProfileView.Node} Profile view node.
  */
-devtools.profiler.ViewBuilder.prototype.createViewNode = function(
+ViewBuilder.prototype.createViewNode = function(
     funcName, totalTime, selfTime, head) {
-  return new devtools.profiler.ProfileView.Node(
+  return new ProfileView.Node(
       funcName, totalTime, selfTime, head);
 };

@@ -111,10 +106,10 @@
  * Creates a Profile View object. It allows to perform sorting
  * and filtering actions on the profile.
  *
- * @param {devtools.profiler.ProfileView.Node} head Head (root) node.
+ * @param {ProfileView.Node} head Head (root) node.
  * @constructor
  */
-devtools.profiler.ProfileView = function(head) {
+function ProfileView(head) {
   this.head = head;
 };

@@ -122,11 +117,11 @@
 /**
  * Sorts the profile view using the specified sort function.
  *
- * @param {function(devtools.profiler.ProfileView.Node,
- *     devtools.profiler.ProfileView.Node):number} sortFunc A sorting
+ * @param {function(ProfileView.Node,
+ *     ProfileView.Node):number} sortFunc A sorting
* functions. Must comply with Array.sort sorting function requirements.
  */
-devtools.profiler.ProfileView.prototype.sort = function(sortFunc) {
+ProfileView.prototype.sort = function(sortFunc) {
   this.traverse(function (node) {
     node.sortChildren(sortFunc);
   });
@@ -136,9 +131,9 @@
 /**
  * Traverses profile view nodes in preorder.
  *
- * @param {function(devtools.profiler.ProfileView.Node)} f Visitor function.
+ * @param {function(ProfileView.Node)} f Visitor function.
  */
-devtools.profiler.ProfileView.prototype.traverse = function(f) {
+ProfileView.prototype.traverse = function(f) {
   var nodesToTraverse = new ConsArray();
   nodesToTraverse.concat([this.head]);
   while (!nodesToTraverse.atEnd()) {
@@ -159,10 +154,10 @@
  *     profile they can be either callees or callers.)
  * @param {number} selfTime Amount of time that application spent in the
  *     corresponding function only.
- * @param {devtools.profiler.ProfileView.Node} head Profile view head.
+ * @param {ProfileView.Node} head Profile view head.
  * @constructor
  */
-devtools.profiler.ProfileView.Node = function(
+ProfileView.Node = function(
     internalFuncName, totalTime, selfTime, head) {
   this.internalFuncName = internalFuncName;
   this.totalTime = totalTime;
@@ -176,7 +171,7 @@
 /**
* Returns a share of the function's total time in application's total time.
  */
-devtools.profiler.ProfileView.Node.prototype.__defineGetter__(
+ProfileView.Node.prototype.__defineGetter__(
     'totalPercent',
     function() { return this.totalTime /
       (this.head ? this.head.totalTime : this.totalTime) * 100.0; });
@@ -185,7 +180,7 @@
 /**
  * Returns a share of the function's self time in application's total time.
  */
-devtools.profiler.ProfileView.Node.prototype.__defineGetter__(
+ProfileView.Node.prototype.__defineGetter__(
     'selfPercent',
     function() { return this.selfTime /
       (this.head ? this.head.totalTime : this.totalTime) * 100.0; });
@@ -194,7 +189,7 @@
 /**
  * Returns a share of the function's total time in its parent's total time.
  */
-devtools.profiler.ProfileView.Node.prototype.__defineGetter__(
+ProfileView.Node.prototype.__defineGetter__(
     'parentTotalPercent',
     function() { return this.totalTime /
       (this.parent ? this.parent.totalTime : this.totalTime) * 100.0; });
@@ -203,9 +198,9 @@
 /**
  * Adds a child to the node.
  *
- * @param {devtools.profiler.ProfileView.Node} node Child node.
+ * @param {ProfileView.Node} node Child node.
  */
-devtools.profiler.ProfileView.Node.prototype.addChild = function(node) {
+ProfileView.Node.prototype.addChild = function(node) {
   node.parent = this;
   this.children.push(node);
 };
@@ -214,11 +209,11 @@
 /**
  * Sorts all the node's children recursively.
  *
- * @param {function(devtools.profiler.ProfileView.Node,
- *     devtools.profiler.ProfileView.Node):number} sortFunc A sorting
+ * @param {function(ProfileView.Node,
+ *     ProfileView.Node):number} sortFunc A sorting
* functions. Must comply with Array.sort sorting function requirements.
  */
-devtools.profiler.ProfileView.Node.prototype.sortChildren = function(
+ProfileView.Node.prototype.sortChildren = function(
     sortFunc) {
   this.children.sort(sortFunc);
 };
=======================================
--- /branches/bleeding_edge/tools/splaytree.js  Tue Dec  7 03:01:02 2010
+++ /branches/bleeding_edge/tools/splaytree.js  Wed Feb  9 23:47:28 2011
@@ -26,12 +26,6 @@
 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.


-// A namespace stub. It will become more clear how to declare it properly
-// during integration of this script into Dev Tools.
-var goog = goog || {};
-goog.structs = goog.structs || {};
-
-
 /**
  * Constructs a Splay tree.  A splay tree is a self-balancing binary
  * search tree with the additional property that recently accessed
@@ -40,23 +34,23 @@
  *
  * @constructor
  */
-goog.structs.SplayTree = function() {
+function SplayTree() {
 };


 /**
  * Pointer to the root node of the tree.
  *
- * @type {goog.structs.SplayTree.Node}
+ * @type {SplayTree.Node}
  * @private
  */
-goog.structs.SplayTree.prototype.root_ = null;
+SplayTree.prototype.root_ = null;


 /**
  * @return {boolean} Whether the tree is empty.
  */
-goog.structs.SplayTree.prototype.isEmpty = function() {
+SplayTree.prototype.isEmpty = function() {
   return !this.root_;
 };

@@ -70,9 +64,9 @@
  * @param {number} key Key to insert into the tree.
  * @param {*} value Value to insert into the tree.
  */
-goog.structs.SplayTree.prototype.insert = function(key, value) {
+SplayTree.prototype.insert = function(key, value) {
   if (this.isEmpty()) {
-    this.root_ = new goog.structs.SplayTree.Node(key, value);
+    this.root_ = new SplayTree.Node(key, value);
     return;
   }
   // Splay on the key to move the last node on the search path for
@@ -81,7 +75,7 @@
   if (this.root_.key == key) {
     return;
   }
-  var node = new goog.structs.SplayTree.Node(key, value);
+  var node = new SplayTree.Node(key, value);
   if (key > this.root_.key) {
     node.left = this.root_;
     node.right = this.root_.right;
@@ -101,9 +95,9 @@
  * key is not found, an exception is thrown.
  *
  * @param {number} key Key to find and remove from the tree.
- * @return {goog.structs.SplayTree.Node} The removed node.
+ * @return {SplayTree.Node} The removed node.
  */
-goog.structs.SplayTree.prototype.remove = function(key) {
+SplayTree.prototype.remove = function(key) {
   if (this.isEmpty()) {
     throw Error('Key not found: ' + key);
   }
@@ -132,9 +126,9 @@
  * a node with the specified key.
  *
  * @param {number} key Key to find in the tree.
- * @return {goog.structs.SplayTree.Node} Node having the specified key.
+ * @return {SplayTree.Node} Node having the specified key.
  */
-goog.structs.SplayTree.prototype.find = function(key) {
+SplayTree.prototype.find = function(key) {
   if (this.isEmpty()) {
     return null;
   }
@@ -144,9 +138,9 @@


 /**
- * @return {goog.structs.SplayTree.Node} Node having the minimum key value.
+ * @return {SplayTree.Node} Node having the minimum key value.
  */
-goog.structs.SplayTree.prototype.findMin = function() {
+SplayTree.prototype.findMin = function() {
   if (this.isEmpty()) {
     return null;
   }
@@ -159,9 +153,9 @@


 /**
- * @return {goog.structs.SplayTree.Node} Node having the maximum key value.
+ * @return {SplayTree.Node} Node having the maximum key value.
  */
-goog.structs.SplayTree.prototype.findMax = function(opt_startNode) {
+SplayTree.prototype.findMax = function(opt_startNode) {
   if (this.isEmpty()) {
     return null;
   }
@@ -174,10 +168,10 @@


 /**
- * @return {goog.structs.SplayTree.Node} Node having the maximum key value that
+ * @return {SplayTree.Node} Node having the maximum key value that
  *     is less or equal to the specified key value.
  */
-goog.structs.SplayTree.prototype.findGreatestLessThan = function(key) {
+SplayTree.prototype.findGreatestLessThan = function(key) {
   if (this.isEmpty()) {
     return null;
   }
@@ -199,7 +193,7 @@
 /**
  * @return {Array<*>} An array containing all the values of tree's nodes.
  */
-goog.structs.SplayTree.prototype.exportValues = function() {
+SplayTree.prototype.exportValues = function() {
   var result = [];
   this.traverse_(function(node) { result.push(node.value); });
   return result;
@@ -216,7 +210,7 @@
  * @param {number} key Key to splay the tree on.
  * @private
  */
-goog.structs.SplayTree.prototype.splay_ = function(key) {
+SplayTree.prototype.splay_ = function(key) {
   if (this.isEmpty()) {
     return;
   }
@@ -226,7 +220,7 @@
   // will hold the R tree of the algorithm.  Using a dummy node, left
   // and right will always be nodes and we avoid special cases.
   var dummy, left, right;
-  dummy = left = right = new goog.structs.SplayTree.Node(null, null);
+  dummy = left = right = new SplayTree.Node(null, null);
   var current = this.root_;
   while (true) {
     if (key < current.key) {
@@ -281,10 +275,10 @@
 /**
  * Performs a preorder traversal of the tree.
  *
- * @param {function(goog.structs.SplayTree.Node)} f Visitor function.
+ * @param {function(SplayTree.Node)} f Visitor function.
  * @private
  */
-goog.structs.SplayTree.prototype.traverse_ = function(f) {
+SplayTree.prototype.traverse_ = function(f) {
   var nodesToVisit = [this.root_];
   while (nodesToVisit.length > 0) {
     var node = nodesToVisit.shift();
@@ -304,19 +298,19 @@
  * @param {number} key Key.
  * @param {*} value Value.
  */
-goog.structs.SplayTree.Node = function(key, value) {
+SplayTree.Node = function(key, value) {
   this.key = key;
   this.value = value;
 };


 /**
- * @type {goog.structs.SplayTree.Node}
+ * @type {SplayTree.Node}
  */
-goog.structs.SplayTree.Node.prototype.left = null;
+SplayTree.Node.prototype.left = null;


 /**
- * @type {goog.structs.SplayTree.Node}
+ * @type {SplayTree.Node}
  */
-goog.structs.SplayTree.Node.prototype.right = null;
+SplayTree.Node.prototype.right = null;
=======================================
--- /branches/bleeding_edge/tools/tickprocessor.js      Tue Dec  7 05:24:22 2010
+++ /branches/bleeding_edge/tools/tickprocessor.js      Wed Feb  9 23:47:28 2011
@@ -26,16 +26,21 @@
 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.


-function Profile(separateIc) {
-  devtools.profiler.Profile.call(this);
+function inherits(childCtor, parentCtor) {
+  childCtor.prototype.__proto__ = parentCtor.prototype;
+};
+
+
+function V8Profile(separateIc) {
+  Profile.call(this);
   if (!separateIc) {
- this.skipThisFunction = function(name) { return Profile.IC_RE.test(name); }; + this.skipThisFunction = function(name) { return V8Profile.IC_RE.test(name); };
   }
 };
-Profile.prototype = devtools.profiler.Profile.prototype;
+inherits(V8Profile, Profile);


-Profile.IC_RE =
+V8Profile.IC_RE =
/^(?:CallIC|LoadIC|StoreIC)|(?:Builtin: (?:Keyed)?(?:Call|Load| Store)IC_)/;


@@ -52,13 +57,8 @@
 }


-function inherits(childCtor, parentCtor) {
-  childCtor.prototype.__proto__ = parentCtor.prototype;
-};
-
-
 function SnapshotLogProcessor() {
-  devtools.profiler.LogReader.call(this, {
+  LogReader.call(this, {
       'code-creation': {
           parsers: [null, parseInt, parseInt, null],
           processor: this.processCodeCreation },
@@ -72,8 +72,8 @@
       'snapshot-pos': { parsers: [parseInt, parseInt],
           processor: this.processSnapshotPosition }});

-  Profile.prototype.handleUnknownCode = function(operation, addr) {
-    var op = devtools.profiler.Profile.Operation;
+  V8Profile.prototype.handleUnknownCode = function(operation, addr) {
+    var op = Profile.Operation;
     switch (operation) {
       case op.MOVE:
         print('Snapshot: Code move event for unknown code: 0x' +
@@ -86,10 +86,10 @@
     }
   };

-  this.profile_ = new Profile();
+  this.profile_ = new V8Profile();
   this.serializedEntries_ = [];
 }
-inherits(SnapshotLogProcessor, devtools.profiler.LogReader);
+inherits(SnapshotLogProcessor, LogReader);


 SnapshotLogProcessor.prototype.processCodeCreation = function(
@@ -127,7 +127,7 @@

 function TickProcessor(
cppEntriesProvider, separateIc, ignoreUnknown, stateFilter, snapshotLogProcessor) {
-  devtools.profiler.LogReader.call(this, {
+  LogReader.call(this, {
       'shared-library': { parsers: [null, parseInt, parseInt],
           processor: this.processSharedLibrary },
       'code-creation': {
@@ -172,9 +172,9 @@
   var ticks = this.ticks_ =
     { total: 0, unaccounted: 0, excluded: 0, gc: 0 };

-  Profile.prototype.handleUnknownCode = function(
+  V8Profile.prototype.handleUnknownCode = function(
       operation, addr, opt_stackPos) {
-    var op = devtools.profiler.Profile.Operation;
+    var op = Profile.Operation;
     switch (operation) {
       case op.MOVE:
         print('Code move event for unknown code: 0x' + addr.toString(16));
@@ -193,16 +193,16 @@
     }
   };

-  this.profile_ = new Profile(separateIc);
+  this.profile_ = new V8Profile(separateIc);
   this.codeTypes_ = {};
   // Count each tick as a time unit.
-  this.viewBuilder_ = new devtools.profiler.ViewBuilder(1);
+  this.viewBuilder_ = new ViewBuilder(1);
   this.lastLogFileName_ = null;

   this.generation_ = 1;
   this.currentProducerProfile_ = null;
 };
-inherits(TickProcessor, devtools.profiler.LogReader);
+inherits(TickProcessor, LogReader);


 TickProcessor.VmStates = {
@@ -356,7 +356,7 @@

TickProcessor.prototype.processHeapSampleBegin = function(space, state, ticks) {
   if (space != 'Heap') return;
-  this.currentProducerProfile_ = new devtools.profiler.CallTree();
+  this.currentProducerProfile_ = new CallTree();
 };


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

Reply via email to