Merge from v8 at revision 3723
diff --git a/tools/profile.js b/tools/profile.js
index d41f5cd..b2de649 100644
--- a/tools/profile.js
+++ b/tools/profile.js
@@ -43,6 +43,11 @@
this.bottomUpTree_ = new devtools.profiler.CallTree();
};
+/**
+ * Version of profiler log.
+ */
+devtools.profiler.Profile.VERSION = 2;
+
/**
* Returns whether a function with the specified name must be skipped.
@@ -134,6 +139,21 @@
/**
+ * Creates an alias entry for a code entry.
+ *
+ * @param {number} aliasAddr Alias address.
+ * @param {number} addr Code entry address.
+ */
+devtools.profiler.Profile.prototype.addCodeAlias = function(
+ aliasAddr, addr) {
+ var entry = this.codeMap_.findDynamicEntryByStartAddress(addr);
+ if (entry) {
+ this.codeMap_.addCode(aliasAddr, entry);
+ }
+};
+
+
+/**
* Reports about moving of a dynamic code entry.
*
* @param {number} from Current code entry address.
@@ -163,6 +183,31 @@
/**
+ * Reports about moving of a dynamic code entry.
+ *
+ * @param {number} from Current code entry address.
+ * @param {number} to New code entry address.
+ */
+devtools.profiler.Profile.prototype.safeMoveDynamicCode = function(from, to) {
+ if (this.codeMap_.findDynamicEntryByStartAddress(from)) {
+ this.codeMap_.moveCode(from, to);
+ }
+};
+
+
+/**
+ * Reports about deletion of a dynamic code entry.
+ *
+ * @param {number} start Starting address.
+ */
+devtools.profiler.Profile.prototype.safeDeleteDynamicCode = function(start) {
+ if (this.codeMap_.findDynamicEntryByStartAddress(start)) {
+ this.codeMap_.deleteCode(start);
+ }
+};
+
+
+/**
* Retrieves a code entry by an address.
*
* @param {number} addr Entry address.
@@ -362,6 +407,13 @@
};
+devtools.profiler.Profile.DynamicCodeEntry.prototype.isJSFunction = function() {
+ return this.type == "Function" ||
+ this.type == "LazyCompile" ||
+ this.type == "Script";
+};
+
+
/**
* Constructs a call graph.
*