Index: webkit/glue/devtools/js/profiler_processor.js |
=================================================================== |
--- webkit/glue/devtools/js/profiler_processor.js (revision 17398) |
+++ webkit/glue/devtools/js/profiler_processor.js (working copy) |
@@ -21,16 +21,31 @@ |
/** |
+ * RegExp that leaves only JS functions. |
* @type {RegExp} |
*/ |
devtools.profiler.JsProfile.JS_FUNC_RE = /^(LazyCompile|Function|Script):/; |
+/** |
+ * RegExp that filters out native code (ending with "native src.js:xxx"). |
+ * @type {RegExp} |
+ */ |
+devtools.profiler.JsProfile.JS_NATIVE_FUNC_RE = /\ native\ \w+\.js:\d+$/; |
/** |
+ * RegExp that filters out native scripts. |
+ * @type {RegExp} |
+ */ |
+devtools.profiler.JsProfile.JS_NATIVE_SCRIPT_RE = /^Script:\ native/; |
+ |
+ |
+/** |
* @override |
*/ |
devtools.profiler.JsProfile.prototype.skipThisFunction = function(name) { |
- return !devtools.profiler.JsProfile.JS_FUNC_RE.test(name); |
+ return !devtools.profiler.JsProfile.JS_FUNC_RE.test(name) || |
+ devtools.profiler.JsProfile.JS_NATIVE_FUNC_RE.test(name) || |
pfeldman
2009/06/02 11:30:24
Could you hide this behind the flag / option at le
mnaganov (inactive)
2009/06/02 11:44:43
Added a comment that you need to comment out these
|
+ devtools.profiler.JsProfile.JS_NATIVE_SCRIPT_RE.test(name); |
}; |
@@ -43,7 +58,8 @@ |
*/ |
devtools.profiler.Processor = function(newProfileCallback) { |
/** |
- * |
+ * Callback that adds a new profile to view. |
+ * @type {function(devtools.profiler.ProfileView)} |
*/ |
this.newProfileCallback_ = newProfileCallback; |
@@ -98,6 +114,16 @@ |
/** |
+ * Sets new profile callback. |
+ * @param {function(devtools.profiler.ProfileView)} callback Callback function. |
+ */ |
+devtools.profiler.Processor.prototype.setNewProfileCallback = function( |
+ callback) { |
+ this.newProfileCallback_ = callback; |
+}; |
+ |
+ |
+/** |
* Processes a portion of V8 profiler event log. |
* |
* @param {string} chunk A portion of log. |