Index: chrome/tools/test/reference_build/chrome_linux/resources/inspector/codemap.js |
diff --git a/chrome/tools/test/reference_build/chrome_linux/resources/inspector/codemap.js b/chrome/tools/test/reference_build/chrome_linux/resources/inspector/codemap.js |
index 3766db04815d4559088db6f786ca345f0b15634f..404127f236a62c2ca0724bfe7ab423174da81bc1 100644 |
--- a/chrome/tools/test/reference_build/chrome_linux/resources/inspector/codemap.js |
+++ b/chrome/tools/test/reference_build/chrome_linux/resources/inspector/codemap.js |
@@ -48,11 +48,16 @@ devtools.profiler.CodeMap = function() { |
this.dynamicsNameGen_ = new devtools.profiler.CodeMap.NameGenerator(); |
/** |
- * Static code entries. Used for libraries code. |
+ * Static code entries. Used for statically compiled code. |
*/ |
this.statics_ = new goog.structs.SplayTree(); |
/** |
+ * Libraries entries. Used for the whole static code libraries. |
+ */ |
+ this.libraries_ = new goog.structs.SplayTree(); |
+ |
+ /** |
* Map of memory pages occupied with static code. |
*/ |
this.pages_ = []; |
@@ -108,6 +113,19 @@ devtools.profiler.CodeMap.prototype.deleteCode = function(start) { |
/** |
+ * Adds a library entry. |
+ * |
+ * @param {number} start The starting address. |
+ * @param {devtools.profiler.CodeMap.CodeEntry} codeEntry Code entry object. |
+ */ |
+devtools.profiler.CodeMap.prototype.addLibrary = function( |
+ start, codeEntry) { |
+ this.markPages_(start, start + codeEntry.size); |
+ this.libraries_.insert(start, codeEntry); |
+}; |
+ |
+ |
+/** |
* Adds a static code entry. |
* |
* @param {number} start The starting address. |
@@ -115,7 +133,6 @@ devtools.profiler.CodeMap.prototype.deleteCode = function(start) { |
*/ |
devtools.profiler.CodeMap.prototype.addStaticCode = function( |
start, codeEntry) { |
- this.markPages_(start, start + codeEntry.size); |
this.statics_.insert(start, codeEntry); |
}; |
@@ -126,7 +143,7 @@ devtools.profiler.CodeMap.prototype.addStaticCode = function( |
devtools.profiler.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; |
+ this.pages_[addr >>> devtools.profiler.CodeMap.PAGE_ALIGNMENT] = 1; |
} |
}; |
@@ -155,9 +172,12 @@ devtools.profiler.CodeMap.prototype.findInTree_ = function(tree, addr) { |
* @param {number} addr Address. |
*/ |
devtools.profiler.CodeMap.prototype.findEntry = function(addr) { |
- var pageAddr = addr >> devtools.profiler.CodeMap.PAGE_ALIGNMENT; |
+ var pageAddr = addr >>> devtools.profiler.CodeMap.PAGE_ALIGNMENT; |
if (pageAddr in this.pages_) { |
- return this.findInTree_(this.statics_, addr); |
+ // Static code entries can contain "holes" of unnamed code. |
+ // In this case, the whole library is assigned to this address. |
+ return this.findInTree_(this.statics_, addr) || |
+ this.findInTree_(this.libraries_, addr); |
} |
var min = this.dynamics_.findMin(); |
var max = this.dynamics_.findMax(); |
@@ -176,7 +196,7 @@ devtools.profiler.CodeMap.prototype.findEntry = function(addr) { |
/** |
- * Returns an array of all dynamic code entries, including deleted ones. |
+ * Returns an array of all dynamic code entries. |
*/ |
devtools.profiler.CodeMap.prototype.getAllDynamicEntries = function() { |
return this.dynamics_.exportValues(); |
@@ -192,6 +212,14 @@ devtools.profiler.CodeMap.prototype.getAllStaticEntries = function() { |
/** |
+ * Returns an array of all libraries entries. |
+ */ |
+devtools.profiler.CodeMap.prototype.getAllLibrariesEntries = function() { |
+ return this.libraries_.exportValues(); |
+}; |
+ |
+ |
+/** |
* Creates a code entry object. |
* |
* @param {number} size Code entry size in bytes. |