Changeset 240113 in webkit for trunk/Source/JavaScriptCore/jsc.cpp
- Timestamp:
- Jan 17, 2019, 9:32:38 AM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/jsc.cpp
r239981 r240113 329 329 static EncodedJSValue JSC_HOST_CALL functionPlatformSupportsSamplingProfiler(ExecState*); 330 330 static EncodedJSValue JSC_HOST_CALL functionGenerateHeapSnapshot(ExecState*); 331 static EncodedJSValue JSC_HOST_CALL functionGenerateHeapSnapshotForGCDebugging(ExecState*); 331 332 static EncodedJSValue JSC_HOST_CALL functionResetSuperSamplerState(ExecState*); 332 333 static EncodedJSValue JSC_HOST_CALL functionEnsureArrayStorage(ExecState*); … … 563 564 addFunction(vm, "platformSupportsSamplingProfiler", functionPlatformSupportsSamplingProfiler, 0); 564 565 addFunction(vm, "generateHeapSnapshot", functionGenerateHeapSnapshot, 0); 566 addFunction(vm, "generateHeapSnapshotForGCDebugging", functionGenerateHeapSnapshotForGCDebugging, 0); 565 567 addFunction(vm, "resetSuperSamplerState", functionResetSuperSamplerState, 0); 566 568 addFunction(vm, "ensureArrayStorage", functionEnsureArrayStorage, 0); … … 2120 2122 } 2121 2123 2124 EncodedJSValue JSC_HOST_CALL functionGenerateHeapSnapshotForGCDebugging(ExecState* exec) 2125 { 2126 VM& vm = exec->vm(); 2127 JSLockHolder lock(vm); 2128 auto scope = DECLARE_THROW_SCOPE(vm); 2129 String jsonString; 2130 { 2131 DeferGCForAWhile deferGC(vm.heap); // Prevent concurrent GC from interfering with the full GC that the snapshot does. 2132 2133 HeapSnapshotBuilder snapshotBuilder(vm.ensureHeapProfiler(), HeapSnapshotBuilder::SnapshotType::GCDebuggingSnapshot); 2134 snapshotBuilder.buildSnapshot(); 2135 2136 jsonString = snapshotBuilder.json(); 2137 } 2138 scope.releaseAssertNoException(); 2139 return JSValue::encode(jsString(&vm, jsonString)); 2140 } 2141 2122 2142 EncodedJSValue JSC_HOST_CALL functionResetSuperSamplerState(ExecState*) 2123 2143 {
Note:
See TracChangeset
for help on using the changeset viewer.