haikuwebkit/LayoutTests/js/floating-point-denormalized...

11 lines
210 B
Plaintext
Raw Permalink Normal View History

WebKit2 on iOS needs to capture the main thread's floating point environment. <https://webkit.org/b/132755> Reviewed by Geoffrey Garen. Source/WebCore: For iOS, WorkerThread::workerThread() expects to be able to initialize the worker thread's floating point environment to be the same as the one in the main thread. The FP env of the main thread is expected to have been captured in the mainThreadFEnv global. On WebKit2 for iOS, we neglected to initialize mainThreadFEnv. We now introduce a FloatingPointEnvironment class that will encapsulate the main thread (aka "UIThread") fenv, and we'll call FloatingPointEnv::saveMainThreadEnvironment() from ChildProcess::platformInitialize() to ensure that the FloatingPointEnvironment singleton instance is initialized properly for WebKit2. In the ChildProcess::platformInitialize(), we also need to initialize the ARMv7 FP env to support denormalized numbers. We'll do this before calling saveMainThreadEnvironment(). Tests: fast/workers/worker-floating-point.html js/floating-point-denormalized.html * WebCore.exp.in: * WebCore.xcodeproj/project.pbxproj: * platform/ios/wak/FloatingPointEnvironment.cpp: Added. (WebCore::FloatingPointEnvironment::env): (WebCore::FloatingPointEnvironment::FloatingPointEnvironment): (WebCore::FloatingPointEnvironment::enableDenormalSupport): (WebCore::FloatingPointEnvironment::saveMainThreadEnvironment): (WebCore::FloatingPointEnvironment::propagateMainThreadEnvironment): * platform/ios/wak/FloatingPointEnvironment.h: Added. * platform/ios/wak/WebCoreThread.h: * platform/ios/wak/WebCoreThread.mm: (RunWebThread): (StartWebThread): * workers/WorkerThread.cpp: (WebCore::WorkerThread::workerThread): Source/WebKit2: * Shared/mac/ChildProcessMac.mm: (WebKit::ChildProcess::platformInitialize): - Call FloatingPointEnv::enableNeededFloatingPointModes() to initialize the ARMv7 FP env to support denormalized numbers. - Call FloatingPointEnv::saveMainThreadEnvironment() to capture the main thread fp env. LayoutTests: * fast/workers/resources/worker-floating-point.js: Added. (runTest1): (doDiv): (runTest2): * fast/workers/worker-floating-point-expected.txt: Added. * fast/workers/worker-floating-point.html: Added. * js/floating-point-denormalized-expected.txt: Added. * js/floating-point-denormalized.html: Added. * js/script-tests/floating-point-denormalized.js: Added. Canonical link: https://commits.webkit.org/150908@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@168676 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2014-05-13 06:40:08 +00:00
This tests that floating point math supports for denormalized numbers.
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
PASS
PASS successfullyParsed is true
TEST COMPLETE