874
edits
(→Memory Profiling Globals: added docs for getObjectProperties().) |
(added docs for argument global) |
||
| Line 103: | Line 103: | ||
=== Functions === | === Functions === | ||
<code>nsJetpack.</code>'''profileMemory'''(''code'', ''filename'', ''lineNumber'', ''namedObjects'') | <code>nsJetpack.</code>'''profileMemory'''(''code'', ''filename'', ''lineNumber'', ''namedObjects'', ''argument'') | ||
This function launches a memory profiling JS runtime and executes ''code'' in it. The ''filename'' and ''lineNumber'' information is for error reporting purposes only. | This function launches a memory profiling JS runtime and executes ''code'' in it. The ''filename'' and ''lineNumber'' information is for error reporting purposes only. | ||
''namedObjects'' is an optional object whose properties, called "names", point to objects in the target JS runtime; these objects can be referred to by their names by certain functions in the memory profiling JS runtime. | ''namedObjects'' is an optional object whose properties, called "names", point to objects in the target JS runtime; these objects can be referred to by their names by certain functions in the memory profiling JS runtime. | ||
''argument'' is an optional string that will be copied into the profiling JS runtime as a global variable of the same name. This allows the target JS runtime to pass execution parameters (serialized as a JSON string, perhaps) into the profiling JS runtime. | |||
If the final statement of ''code'' results in a string value, this value is copied and passed back as the result of this function. This allows ''code'' to perform some memory profiling activity and return the results back to the target JS runtime. | If the final statement of ''code'' results in a string value, this value is copied and passed back as the result of this function. This allows ''code'' to perform some memory profiling activity and return the results back to the target JS runtime. | ||
| Line 180: | Line 182: | ||
This global variable contains a reference to the [[Labs/Jetpack/Binary_Components#StackFrame_Objects|StackFrame]] of the most recently-thrown exception in the memory profiling runtime. | This global variable contains a reference to the [[Labs/Jetpack/Binary_Components#StackFrame_Objects|StackFrame]] of the most recently-thrown exception in the memory profiling runtime. | ||
'''argument''' | |||
This global variable is a copy of the ''argument'' parameter passed to ''nsJetpack.''<code>profileMemory()</code> in the memory profiling runtime. | |||
=== StackFrame Objects === | === StackFrame Objects === | ||
edits