Changeset 277094 in webkit
- Timestamp:
- May 6, 2021 9:22:45 AM (3 years ago)
- Location:
- trunk
- Files:
-
- 1 added
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JSTests/ChangeLog
r277035 r277094 1 2021-05-06 Mark Lam <mark.lam@apple.com> 2 3 Forbid further execution in jsc shell if execution is terminated. 4 https://bugs.webkit.org/show_bug.cgi?id=225410 5 rdar://77548608 6 7 Reviewed by Michael Saboff. 8 9 * stress/jsc-shell-forbid-execution-after-termination.js: Added. 10 1 11 2021-05-05 Saam Barati <sbarati@apple.com> 2 12 -
trunk/Source/JavaScriptCore/ChangeLog
r277092 r277094 1 2021-05-06 Mark Lam <mark.lam@apple.com> 2 3 Forbid further execution in jsc shell if execution is terminated. 4 https://bugs.webkit.org/show_bug.cgi?id=225410 5 rdar://77548608 6 7 Reviewed by Michael Saboff. 8 9 1. Introduce a VM::m_executionForbidden flag. 10 2. In the jsc shell, forbid further execution if termination was encountered. 11 12 * jsc.cpp: 13 (runWithOptions): 14 * runtime/VM.cpp: 15 (JSC::VM::drainMicrotasks): 16 * runtime/VM.h: 17 (JSC::VM::executionForbidden const): 18 (JSC::VM::setExecutionForbidden): 19 1 20 2021-05-06 Mark Lam <mark.lam@apple.com> 2 21 -
trunk/Source/JavaScriptCore/jsc.cpp
r276786 r277094 3049 3049 JSValue returnValue = evaluate(globalObject, jscSource(scriptBuffer, sourceOrigin , fileName), JSValue(), evaluationException); 3050 3050 scope.assertNoException(); 3051 if (evaluationException) 3051 if (evaluationException) { 3052 if (vm.isTerminationException(evaluationException.get())) 3053 vm.setExecutionForbidden(); 3052 3054 returnValue = evaluationException->value(); 3055 } 3053 3056 checkException(globalObject, isLastFile, evaluationException, returnValue, options, success); 3054 3057 } -
trunk/Source/JavaScriptCore/runtime/VM.cpp
r277068 r277094 1386 1386 void VM::drainMicrotasks() 1387 1387 { 1388 do { 1389 while (!m_microtaskQueue.isEmpty()) { 1390 m_microtaskQueue.takeFirst()->run(); 1391 if (m_onEachMicrotaskTick) 1392 m_onEachMicrotaskTick(*this); 1393 } 1394 didExhaustMicrotaskQueue(); 1395 } while (!m_microtaskQueue.isEmpty()); 1388 if (UNLIKELY(executionForbidden())) 1389 m_microtaskQueue.clear(); 1390 else { 1391 do { 1392 while (!m_microtaskQueue.isEmpty()) { 1393 m_microtaskQueue.takeFirst()->run(); 1394 if (m_onEachMicrotaskTick) 1395 m_onEachMicrotaskTick(*this); 1396 } 1397 didExhaustMicrotaskQueue(); 1398 } while (!m_microtaskQueue.isEmpty()); 1399 } 1396 1400 finalizeSynchronousJSExecution(); 1397 1401 } -
trunk/Source/JavaScriptCore/runtime/VM.h
r277068 r277094 341 341 bool terminationInProgress() const { return m_terminationInProgress; } 342 342 void setTerminationInProgress(bool value) { m_terminationInProgress = value; } 343 344 bool executionForbidden() const { return m_executionForbidden; } 345 void setExecutionForbidden() { m_executionForbidden = true; } 343 346 344 347 JS_EXPORT_PRIVATE Exception* ensureTerminationException(); … … 1264 1267 1265 1268 bool m_terminationInProgress { false }; 1269 bool m_executionForbidden { false }; 1266 1270 1267 1271 Lock m_loopHintExecutionCountLock; -
trunk/Source/WebCore/ChangeLog
r277093 r277094 1 2021-05-06 Mark Lam <mark.lam@apple.com> 2 3 Forbid further execution in jsc shell if execution is terminated. 4 https://bugs.webkit.org/show_bug.cgi?id=225410 5 rdar://77548608 6 7 Reviewed by Michael Saboff. 8 9 Re-implement WorkerOrWorkletScriptController::forbidExecution() and 10 isExecutionForbidden() using the VM's notion of the flag 11 12 * workers/WorkerOrWorkletScriptController.cpp: 13 (WebCore::WorkerOrWorkletScriptController::forbidExecution): 14 (WebCore::WorkerOrWorkletScriptController::isExecutionForbidden const): 15 * workers/WorkerOrWorkletScriptController.h: 16 1 17 2021-05-06 Darin Adler <darin@apple.com> 2 18 -
trunk/Source/WebCore/workers/WorkerOrWorkletScriptController.cpp
r276069 r277094 109 109 { 110 110 ASSERT(m_globalScope->isContextThread()); 111 m_ executionForbidden = true;111 m_vm->setExecutionForbidden(); 112 112 } 113 113 … … 115 115 { 116 116 ASSERT(m_globalScope->isContextThread()); 117 return m_ executionForbidden;117 return m_vm->executionForbidden(); 118 118 } 119 119 -
trunk/Source/WebCore/workers/WorkerOrWorkletScriptController.h
r273299 r277094 1 1 /* 2 * Copyright (C) 2008-202 0Apple Inc. All Rights Reserved.2 * Copyright (C) 2008-2021 Apple Inc. All Rights Reserved. 3 3 * Copyright (C) 2012 Google Inc. All Rights Reserved. 4 4 * … … 123 123 std::unique_ptr<WorkerConsoleClient> m_consoleClient; 124 124 mutable Lock m_scheduledTerminationMutex; 125 bool m_executionForbidden { false };126 125 bool m_isTerminatingExecution { false }; 127 126 };
Note: See TracChangeset
for help on using the changeset viewer.