WebKit Bugzilla
Attachment 371064 Details for
Bug 198386
: [PlayStation] Support internal test runner for JSC tests
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
198386.1.diff (text/plain), 4.56 KB, created by
Stephan Szabo
on 2019-05-31 09:37:21 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Stephan Szabo
Created:
2019-05-31 09:37:21 PDT
Size:
4.56 KB
patch
obsolete
>diff --git a/Source/JavaScriptCore/runtime/Options.h b/Source/JavaScriptCore/runtime/Options.h >index 6f223bee75f..14c9b5663e5 100644 >--- a/Source/JavaScriptCore/runtime/Options.h >+++ b/Source/JavaScriptCore/runtime/Options.h >@@ -674,7 +674,7 @@ private: > > // Declare the singleton instance of the options store: > JS_EXPORT_PRIVATE static Entry s_options[numberOfOptions]; >- static Entry s_defaultOptions[numberOfOptions]; >+ JS_EXPORT_PRIVATE static Entry s_defaultOptions[numberOfOptions]; > static const EntryInfo s_optionsInfo[numberOfOptions]; > > friend class Option; >diff --git a/Source/JavaScriptCore/shell/PlatformPlayStation.cmake b/Source/JavaScriptCore/shell/PlatformPlayStation.cmake >index 56b43d83034..202ea75fb81 100644 >--- a/Source/JavaScriptCore/shell/PlatformPlayStation.cmake >+++ b/Source/JavaScriptCore/shell/PlatformPlayStation.cmake >@@ -1,4 +1,6 @@ >+list(REMOVE_ITEM jsc_SOURCES ../jsc.cpp) > list(APPEND jsc_SOURCES >+ ${JAVASCRIPTCORE_DIR}/shell/playstation/TestShell.cpp > ${JAVASCRIPTCORE_DIR}/shell/playstation/Initializer.cpp > ) > >@@ -6,5 +8,5 @@ find_library(LIBTESTWRAPPERS testwrappers PATHS ${WEBKIT_LIBRARIES_DIR}/lib) > > set(PLAYSTATION_jsc_PROCESS_NAME "JSCShell") > set(PLAYSTATION_jsc_MAIN_THREAD_NAME "JSCShell") >-set(PLAYSTATION_jsc_WRAP fopen getcwd main) >+set(PLAYSTATION_jsc_WRAP fopen getcwd chdir main) > list(APPEND jsc_LIBRARIES ${LIBTESTWRAPPERS}) >diff --git a/Source/JavaScriptCore/shell/playstation/TestShell.cpp b/Source/JavaScriptCore/shell/playstation/TestShell.cpp >new file mode 100644 >index 00000000000..8c189c97e15 >--- /dev/null >+++ b/Source/JavaScriptCore/shell/playstation/TestShell.cpp >@@ -0,0 +1,78 @@ >+/* >+ * Copyright (C) 2019 Sony Interactive Entertainment Inc. >+ * >+ * Redistribution and use in source and binary forms, with or without >+ * modification, are permitted provided that the following conditions >+ * are met: >+ * >+ * 1. Redistributions of source code must retain the above copyright >+ * notice, this list of conditions and the following disclaimer. >+ * 2. Redistributions in binary form must reproduce the above copyright >+ * notice, this list of conditions and the following disclaimer in the >+ * documentation and/or other materials provided with the distribution. >+ * 3. Neither the name of Apple Inc. ("Apple") nor the names of >+ * its contributors may be used to endorse or promote products derived >+ * from this software without specific prior written permission. >+ * >+ * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY >+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED >+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE >+ * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY >+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES >+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; >+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND >+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT >+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF >+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. >+ */ >+ >+#include "../jsc.cpp" >+ >+extern "C" void setupTestRun() >+{ >+ // Need to initialize WTF threading before we start any threads. Cannot initialize JSC >+ // threading yet, since that would do somethings that we'd like to defer until after we >+ // have a chance to parse options. >+ WTF::initializeThreading(); >+ >+ // Need to override and enable restricted options before we start parsing options below. >+ Options::enableRestrictedOptions(true); >+ >+ // Initialize JSC before getting VM. >+ WTF::initializeMainThread(); >+ JSC::initializeThreading(); >+ >+#if ENABLE(WEBASSEMBLY) >+ JSC::Wasm::enableFastMemory(); >+#endif >+ Gigacage::disableDisablingPrimitiveGigacageIfShouldBeEnabled(); >+} >+ >+extern "C" void preTest() >+{ >+#define FOR_EACH_OPTION(type_, name_, defaultValue_, availability_, description_) \ >+ JSC::Options::name_() = JSC::Options::name_##Default(); >+ JSC_OPTIONS(FOR_EACH_OPTION) >+#undef FOR_EACH_OPTION >+} >+ >+extern "C" int runTest(int argc, char* argv[]) >+{ >+ CommandLine options(argc, argv); >+ processConfigFile(Options::configFile(), "jsc"); >+ >+ return runJSC( >+ options, true, >+ [&](VM& vm, GlobalObject* globalObject, bool& success) { >+ UNUSED_PARAM(vm); >+ runWithOptions(globalObject, options, success); >+ }); >+} >+ >+extern "C" void postTest() >+{ >+} >+ >+extern "C" void shutdownTestRun() >+{ >+}
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Flags:
achristensen
:
review+
achristensen
:
commit-queue-
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 198386
:
370972
|
370996
|
371064
|
371092