Changeset 218652 in webkit
- Timestamp:
- Jun 21, 2017 2:32:44 PM (7 years ago)
- Location:
- trunk
- Files:
-
- 4 added
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r218651 r218652 1 2017-06-21 Joseph Pecoraro <pecoraro@apple.com> 2 3 Web Inspector: Using "break on all exceptions" when throwing stack overflow hangs inspector 4 https://bugs.webkit.org/show_bug.cgi?id=172432 5 <rdar://problem/29870873> 6 7 Reviewed by Saam Barati. 8 9 * inspector/debugger/no-pause-out-of-memory-exception-expected.txt: Added. 10 * inspector/debugger/no-pause-out-of-memory-exception.html: Added. 11 * inspector/debugger/no-pause-stack-overflow-exception-expected.txt: Added. 12 * inspector/debugger/no-pause-stack-overflow-exception.html: Added. 13 1 14 2017-06-20 Simon Fraser <simon.fraser@apple.com> 2 15 -
trunk/Source/JavaScriptCore/ChangeLog
r218641 r218652 1 2017-06-21 Joseph Pecoraro <pecoraro@apple.com> 2 3 Web Inspector: Using "break on all exceptions" when throwing stack overflow hangs inspector 4 https://bugs.webkit.org/show_bug.cgi?id=172432 5 <rdar://problem/29870873> 6 7 Reviewed by Saam Barati. 8 9 Avoid pausing on StackOverflow and OutOfMemory errors to avoid a hang. 10 We will proceed to improve debugging of these cases in the follow-up bugs. 11 12 * debugger/Debugger.cpp: 13 (JSC::Debugger::exception): 14 Ignore pausing on these errors. 15 16 * runtime/ErrorInstance.h: 17 (JSC::ErrorInstance::setStackOverflowError): 18 (JSC::ErrorInstance::isStackOverflowError): 19 (JSC::ErrorInstance::setOutOfMemoryError): 20 (JSC::ErrorInstance::isOutOfMemoryError): 21 * runtime/ExceptionHelpers.cpp: 22 (JSC::createStackOverflowError): 23 * runtime/Error.cpp: 24 (JSC::createOutOfMemoryError): 25 Mark these kinds of errors. 26 1 27 2017-06-21 Saam Barati <sbarati@apple.com> 2 28 -
trunk/Source/JavaScriptCore/debugger/Debugger.cpp
r216428 r218652 758 758 return; 759 759 760 if (JSObject* object = jsDynamicCast<JSObject*>(m_vm, exception)) { 761 if (object->isErrorInstance()) { 762 ErrorInstance* error = static_cast<ErrorInstance*>(object); 763 // FIXME: <https://webkit.org/b/173625> Web Inspector: Should be able to pause and debug a StackOverflow Exception 764 // FIXME: <https://webkit.org/b/173627> Web Inspector: Should be able to pause and debug an OutOfMemory Exception 765 if (error->isStackOverflowError() || error->isOutOfMemoryError()) 766 return; 767 } 768 } 769 760 770 PauseReasonDeclaration reason(*this, PausedForException); 761 771 if (m_pauseOnExceptionsState == PauseOnAllExceptions || (m_pauseOnExceptionsState == PauseOnUncaughtExceptions && !hasCatchHandler)) { -
trunk/Source/JavaScriptCore/runtime/Error.cpp
r217108 r218652 31 31 #include "Interpreter.h" 32 32 #include "JSArray.h" 33 #include "JSCInlines.h" 33 34 #include "JSFunction.h" 34 35 #include "JSGlobalObject.h" 35 36 #include "JSObject.h" 36 37 #include "JSString.h" 37 #include "JSCInlines.h"38 38 #include "NativeErrorConstructor.h" 39 39 #include "SourceCode.h" … … 311 311 JSObject* createOutOfMemoryError(ExecState* exec) 312 312 { 313 return createError(exec, ASCIILiteral("Out of memory"), nullptr); 313 auto* error = createError(exec, ASCIILiteral("Out of memory"), nullptr); 314 jsCast<ErrorInstance*>(error)->setOutOfMemoryError(); 315 return error; 314 316 } 315 317 -
trunk/Source/JavaScriptCore/runtime/ErrorInstance.h
r208952 r218652 62 62 void clearRuntimeTypeForCause() { m_runtimeTypeForCause = TypeNothing; } 63 63 64 void setStackOverflowError() { m_stackOverflowError = true; } 65 bool isStackOverflowError() const { return m_stackOverflowError; } 66 void setOutOfMemoryError() { m_outOfMemoryError = true; } 67 bool isOutOfMemoryError() const { return m_outOfMemoryError; } 68 64 69 JS_EXPORT_PRIVATE String sanitizedToString(ExecState*); 65 70 … … 71 76 SourceAppender m_sourceAppender { nullptr }; 72 77 RuntimeType m_runtimeTypeForCause { TypeNothing }; 78 bool m_stackOverflowError { false }; 79 bool m_outOfMemoryError { false }; 73 80 }; 74 81 -
trunk/Source/JavaScriptCore/runtime/ExceptionHelpers.cpp
r217108 r218652 30 30 #include "ExceptionHelpers.h" 31 31 32 #include "CallFrame.h" 32 33 #include "CodeBlock.h" 33 #include "CallFrame.h"34 34 #include "ErrorHandlingScope.h" 35 35 #include "Exception.h" 36 #include "Interpreter.h" 37 #include "JSCInlines.h" 36 38 #include "JSGlobalObjectFunctions.h" 37 #include "Interpreter.h"38 39 #include "Nodes.h" 39 #include "JSCInlines.h"40 40 #include "RuntimeType.h" 41 41 #include <wtf/text/StringBuilder.h> … … 75 75 JSObject* createStackOverflowError(ExecState* exec, JSGlobalObject* globalObject) 76 76 { 77 return createRangeError(exec, globalObject, ASCIILiteral("Maximum call stack size exceeded.")); 77 auto* error = createRangeError(exec, globalObject, ASCIILiteral("Maximum call stack size exceeded.")); 78 jsCast<ErrorInstance*>(error)->setStackOverflowError(); 79 return error; 78 80 } 79 81
Note: See TracChangeset
for help on using the changeset viewer.