Source/JavaScriptCore:
authormark.lam@apple.com <mark.lam@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 3 Mar 2015 00:24:24 +0000 (00:24 +0000)
committermark.lam@apple.com <mark.lam@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 3 Mar 2015 00:24:24 +0000 (00:24 +0000)
commitc33135850046dac495cecfbff76a18ed322fc0bb
treeb676a0fb2b864af6731202a46f4a7cc3ecef3763
parent2b5dacf722648b212cbaceeca08abbc2e5905fbc
Source/JavaScriptCore:
Exception stack unwinding in JSC hangs while the Timeline Profiler is enabled.
<https://webkit.org/b/142191>

Reviewed by Geoffrey Garen.

Imagine a scenario where the Inspector is paused / suspended at a breakpoint or
while the user is stepping through JS code. The user then tries to evaluate an
expression in the console, and that evaluation results in an exception being
thrown. Currently, if the Timeline Profiler is enabled while this exception is
being thrown, the WebProcess will hang while trying to handle that exception.

The issue is that the Timeline Profiler's ProfileGenerator::didExecute() will
return early and decline to process ProfileNodes if the Inspector is paused.
This is proper because it does not want to count work done for injected scripts
(e.g. from the console) towards the timeline profile of the webpage being run.
However, this is in conflict with ProfileGenerator::exceptionUnwind()'s
expectation that didExecute() will process ProfileNodes in order to do the stack
unwinding for the exception handling. As a result,
ProfileGenerator::exceptionUnwind() hangs.

ProfileGenerator::exceptionUnwind() is in error. While the Inspector is paused,
there will not be any ProfileNodes that it needs to "unwind". Hence, the fix is
simply to return early also in ProfileGenerator::exceptionUnwind() if the
Inspector is paused.

* profiler/ProfileGenerator.cpp:
(JSC::ProfileGenerator::exceptionUnwind):

LayoutTests:
Last gardening after r177774

Unreviewed.

Patch by Myles C. Maxfield <mmaxfield@apple.com> on 2015-03-02

* fast/text/font-kerning-expected.html:
* fast/text/font-variant-ligatures-expected.html:
* fast/text/whitespace/inline-whitespace-wrapping-7-expected.html:
* fast/text/whitespace/inline-whitespace-wrapping-7.html:
* mathml/presentation/scripts-subsup-expected.html:
* mathml/presentation/scripts-subsup.html:
* platform/mac/TestExpectations:
* platform/mac/fast/text/multiple-codeunit-vertical-upright-expected.html:
* platform/mac/fast/text/multiple-codeunit-vertical-upright.html:
* platform/mac/fast/text/resources/multiple-codeunit-vertical-upright.otf: Removed.
* svg/text/svg-font-word-rounding-hacks-spaces-expected.html:
* svg/text/svg-font-word-rounding-hacks-spaces.html:
* svg/text/tspan-outline-expected.svg:
* svg/text/tspan-outline.html:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@180907 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/inspector/timeline/exception-in-injected-script-while-recording-expected.txt [new file with mode: 0644]
LayoutTests/inspector/timeline/exception-in-injected-script-while-recording.html [new file with mode: 0644]
Source/JavaScriptCore/ChangeLog
Source/JavaScriptCore/profiler/ProfileGenerator.cpp