haikuwebkit/Source/JavaScriptCore/SourcesCocoa.txt

38 lines
1.6 KiB
Plaintext
Raw Permalink Normal View History

Setup WebCore build to start using unified sources. https://bugs.webkit.org/show_bug.cgi?id=178362 Reviewed by Tim Horton. .: Pass features to the unified source bundler script. * Source/cmake/WebKitCommon.cmake: * Source/cmake/WebKitFeatures.cmake: * Source/cmake/WebKitMacros.cmake: Source/JavaScriptCore: Change comments in source list files. Also, pass explicit names for build files. * CMakeLists.txt: * PlatformGTK.cmake: * PlatformMac.cmake: * Sources.txt: * SourcesGTK.txt: * SourcesMac.txt: Source/WebCore: This patch adds all the long tooling needed to start adding unified sources to WebCore. Most of the source list files are empty to start but will be filled over the next few days. I started by moving all the non-derived bindings code to unified sources to make sure everything worked correctly. * CMakeLists.txt: * Configurations/GenerateUnifiedSources.xcconfig: Added. * Configurations/WebCore.xcconfig: * PlatformMac.cmake: * Sources.txt: Added. * SourcesCocoa.txt: Added. * SourcesIOS.txt: Added. * SourcesMac.txt: Added. * WebCore.xcodeproj/project.pbxproj: * bindings/js/JSMediaStreamCapabilitiesCustom.cpp: Removed. No one seems to use this... Source/WTF: There are a number of changes to the bundler script. First, it is now possible to enable or disable building files based on if the associated feature flag is enabled or not. The syntax for this is similar to how we do #ifs in C++ code. e.g. #if ENABLE_APPLE_PAY myApplePayFile.cpp #endif would enable myApplePayFile.cpp if and only if the APPLE_PAY feature define is set. I also changed comments from # to // to make it less likely they would be confused with a #if. Finally, this patch enables bundling files in the same relative directory across source list files. Previously, if SourcesCocoa.txt had platform/cf/foo.cpp and SourcesMac.txt had platform/cf/bar.cpp those files would not be put in the same unified source bundle. Now, those files will be put into the same bundle but bar.cpp will always follow foo.cpp. The idea is that by putting more specific files after more general files we can avoid random build failures. * Scripts/generate-unified-source-bundles.rb: Canonical link: https://commits.webkit.org/194673@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@223621 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-10-18 19:14:51 +00:00
// Copyright (C) 2017 Apple Inc. All rights reserved.
//
// 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.
//
// THIS SOFTWARE IS PROVIDED BY APPLE INC. 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 INC. 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.
JSC should use unified sources for platform specific files. https://bugs.webkit.org/show_bug.cgi?id=177290 Reviewed by Michael Saboff. .: Change WEBKIT_COMPUTE_SOURCES CMake macro to look for platform specific unified source lists. This is done in the same way that we look for port specific configuration files. For example, if I were building for the Mac port WEBKIT_COMPUTE_SOURCES would add the Sources.txt and SourcesMac.txt source lists to the list of unified sources. * Source/cmake/WebKitMacros.cmake: Source/JavaScriptCore: Add a list of platform specific source files and update the Generate Unified Sources phase of the Xcode build. I skipped WPE since that seems to have failed for some reason that I didn't fully understand. See: https://webkit-queues.webkit.org/results/4611260 Also, fix duplicate symbols in Glib remote inspector files. * CMakeLists.txt: * JavaScriptCore.xcodeproj/project.pbxproj: * PlatformGTK.cmake: * PlatformMac.cmake: * SourcesGTK.txt: Added. * SourcesMac.txt: Added. * inspector/remote/glib/RemoteInspectorServer.cpp: (Inspector::RemoteInspectorServer::interfaceInfo): (Inspector::RemoteInspectorServer::setTargetList): (Inspector::RemoteInspectorServer::setupInspectorClient): (Inspector::RemoteInspectorServer::setup): (Inspector::RemoteInspectorServer::close): (Inspector::RemoteInspectorServer::connectionClosed): (Inspector::RemoteInspectorServer::sendMessageToBackend): (Inspector::RemoteInspectorServer::sendMessageToFrontend): (Inspector::dbusConnectionCallAsyncReadyCallback): Deleted. Source/WTF: The unified source bundler script can now handle more than one list of sources. Sources will not be bundled across source file lists. We want to ensure that changing one platform's sources doesn't break another platform's build, as much as possible. Additionally, it means that there won't be weird performance changes when files are added to an unrelated platform. Remove stale reference to generate-unified-source-bundles.rb script from Xcode. * Scripts/generate-unified-source-bundles.rb: * WTF.xcodeproj/project.pbxproj: Canonical link: https://commits.webkit.org/193634@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@222327 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-09-21 17:35:18 +00:00
JSC should have a module loader API https://bugs.webkit.org/show_bug.cgi?id=191121 Reviewed by Michael Saboff. This patch adds a new delegate to JSContext that is called to fetch any resolved module. The resolution of a module identifier is computed as if it were a URL on the web with the caveat that it must be a file URL. A new class JSScript has also been added that is similar to JSScriptRef. Right now all JSScripts are copied into memory. In the future we should mmap the provided file into memory so the OS can evict it to disk under pressure. Additionally, the API does not make use of the code signing path nor the bytecode caching path, which we will add in subsequent patches. Lastly, a couple of new convenience methods have been added. C API conversion, can now toRef a JSValue with just a vm rather than requiring an ExecState. Secondly, there is now a call wrapper that does not require CallData and CallType since many places don't care about this. * API/APICast.h: (toRef): * API/JSAPIGlobalObject.cpp: Copied from Source/JavaScriptCore/API/JSVirtualMachineInternal.h. * API/JSAPIGlobalObject.h: Added. (JSC::JSAPIGlobalObject::create): (JSC::JSAPIGlobalObject::createStructure): (JSC::JSAPIGlobalObject::JSAPIGlobalObject): * API/JSAPIGlobalObject.mm: Added. (JSC::JSAPIGlobalObject::moduleLoaderResolve): (JSC::JSAPIGlobalObject::moduleLoaderImportModule): (JSC::JSAPIGlobalObject::moduleLoaderFetch): (JSC::JSAPIGlobalObject::moduleLoaderCreateImportMetaProperties): * API/JSAPIValueWrapper.h: (JSC::jsAPIValueWrapper): Deleted. * API/JSContext.h: * API/JSContext.mm: (-[JSContext moduleLoaderDelegate]): (-[JSContext setModuleLoaderDelegate:]): * API/JSContextInternal.h: * API/JSContextPrivate.h: * API/JSContextRef.cpp: (JSGlobalContextCreateInGroup): * API/JSScript.h: Added. * API/JSScript.mm: Added. (+[JSScript scriptWithSource:inVirtualMachine:]): (fillBufferWithContentsOfFile): (+[JSScript scriptFromUTF8File:inVirtualMachine:withCodeSigning:andBytecodeCache:]): (getJSScriptSourceCode): * API/JSScriptInternal.h: Copied from Source/JavaScriptCore/API/JSVirtualMachineInternal.h. * API/JSValueInternal.h: * API/JSVirtualMachineInternal.h: * API/tests/testapi.mm: (+[JSContextFetchDelegate contextWithBlockForFetch:]): (-[JSContextFetchDelegate context:fetchModuleForIdentifier:withResolveHandler:andRejectHandler:]): (checkModuleCodeRan): (checkModuleWasRejected): (testFetch): (testFetchWithTwoCycle): (testFetchWithThreeCycle): (testLoaderResolvesAbsoluteScriptURL): (testLoaderRejectsNilScriptURL): (testLoaderRejectsFailedFetch): (testImportModuleTwice): (+[JSContextFileLoaderDelegate newContext]): (resolvePathToScripts): (-[JSContextFileLoaderDelegate context:fetchModuleForIdentifier:withResolveHandler:andRejectHandler:]): (testLoadBasicFile): (testObjectiveCAPI): * API/tests/testapiScripts/basic.js: Copied from Source/JavaScriptCore/API/JSVirtualMachineInternal.h. * JavaScriptCore.xcodeproj/project.pbxproj: * Sources.txt: * SourcesCocoa.txt: * config.h: * postprocess-headers.sh: * runtime/CallData.cpp: (JSC::call): * runtime/CallData.h: * runtime/Completion.cpp: (JSC::loadAndEvaluateModule): * runtime/Completion.h: * runtime/JSCast.h: (JSC::jsSecureCast): * runtime/JSGlobalObject.cpp: (JSC::createProxyProperty): Canonical link: https://commits.webkit.org/207912@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@239933 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2019-01-14 20:27:17 +00:00
API/JSAPIGlobalObject.mm
JSC should use unified sources for platform specific files. https://bugs.webkit.org/show_bug.cgi?id=177290 Reviewed by Michael Saboff. .: Change WEBKIT_COMPUTE_SOURCES CMake macro to look for platform specific unified source lists. This is done in the same way that we look for port specific configuration files. For example, if I were building for the Mac port WEBKIT_COMPUTE_SOURCES would add the Sources.txt and SourcesMac.txt source lists to the list of unified sources. * Source/cmake/WebKitMacros.cmake: Source/JavaScriptCore: Add a list of platform specific source files and update the Generate Unified Sources phase of the Xcode build. I skipped WPE since that seems to have failed for some reason that I didn't fully understand. See: https://webkit-queues.webkit.org/results/4611260 Also, fix duplicate symbols in Glib remote inspector files. * CMakeLists.txt: * JavaScriptCore.xcodeproj/project.pbxproj: * PlatformGTK.cmake: * PlatformMac.cmake: * SourcesGTK.txt: Added. * SourcesMac.txt: Added. * inspector/remote/glib/RemoteInspectorServer.cpp: (Inspector::RemoteInspectorServer::interfaceInfo): (Inspector::RemoteInspectorServer::setTargetList): (Inspector::RemoteInspectorServer::setupInspectorClient): (Inspector::RemoteInspectorServer::setup): (Inspector::RemoteInspectorServer::close): (Inspector::RemoteInspectorServer::connectionClosed): (Inspector::RemoteInspectorServer::sendMessageToBackend): (Inspector::RemoteInspectorServer::sendMessageToFrontend): (Inspector::dbusConnectionCallAsyncReadyCallback): Deleted. Source/WTF: The unified source bundler script can now handle more than one list of sources. Sources will not be bundled across source file lists. We want to ensure that changing one platform's sources doesn't break another platform's build, as much as possible. Additionally, it means that there won't be weird performance changes when files are added to an unrelated platform. Remove stale reference to generate-unified-source-bundles.rb script from Xcode. * Scripts/generate-unified-source-bundles.rb: * WTF.xcodeproj/project.pbxproj: Canonical link: https://commits.webkit.org/193634@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@222327 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-09-21 17:35:18 +00:00
API/JSAPIWrapperObject.mm
JSC should have a module loader API https://bugs.webkit.org/show_bug.cgi?id=191121 Reviewed by Michael Saboff. This patch adds a new delegate to JSContext that is called to fetch any resolved module. The resolution of a module identifier is computed as if it were a URL on the web with the caveat that it must be a file URL. A new class JSScript has also been added that is similar to JSScriptRef. Right now all JSScripts are copied into memory. In the future we should mmap the provided file into memory so the OS can evict it to disk under pressure. Additionally, the API does not make use of the code signing path nor the bytecode caching path, which we will add in subsequent patches. Lastly, a couple of new convenience methods have been added. C API conversion, can now toRef a JSValue with just a vm rather than requiring an ExecState. Secondly, there is now a call wrapper that does not require CallData and CallType since many places don't care about this. * API/APICast.h: (toRef): * API/JSAPIGlobalObject.cpp: Copied from Source/JavaScriptCore/API/JSVirtualMachineInternal.h. * API/JSAPIGlobalObject.h: Added. (JSC::JSAPIGlobalObject::create): (JSC::JSAPIGlobalObject::createStructure): (JSC::JSAPIGlobalObject::JSAPIGlobalObject): * API/JSAPIGlobalObject.mm: Added. (JSC::JSAPIGlobalObject::moduleLoaderResolve): (JSC::JSAPIGlobalObject::moduleLoaderImportModule): (JSC::JSAPIGlobalObject::moduleLoaderFetch): (JSC::JSAPIGlobalObject::moduleLoaderCreateImportMetaProperties): * API/JSAPIValueWrapper.h: (JSC::jsAPIValueWrapper): Deleted. * API/JSContext.h: * API/JSContext.mm: (-[JSContext moduleLoaderDelegate]): (-[JSContext setModuleLoaderDelegate:]): * API/JSContextInternal.h: * API/JSContextPrivate.h: * API/JSContextRef.cpp: (JSGlobalContextCreateInGroup): * API/JSScript.h: Added. * API/JSScript.mm: Added. (+[JSScript scriptWithSource:inVirtualMachine:]): (fillBufferWithContentsOfFile): (+[JSScript scriptFromUTF8File:inVirtualMachine:withCodeSigning:andBytecodeCache:]): (getJSScriptSourceCode): * API/JSScriptInternal.h: Copied from Source/JavaScriptCore/API/JSVirtualMachineInternal.h. * API/JSValueInternal.h: * API/JSVirtualMachineInternal.h: * API/tests/testapi.mm: (+[JSContextFetchDelegate contextWithBlockForFetch:]): (-[JSContextFetchDelegate context:fetchModuleForIdentifier:withResolveHandler:andRejectHandler:]): (checkModuleCodeRan): (checkModuleWasRejected): (testFetch): (testFetchWithTwoCycle): (testFetchWithThreeCycle): (testLoaderResolvesAbsoluteScriptURL): (testLoaderRejectsNilScriptURL): (testLoaderRejectsFailedFetch): (testImportModuleTwice): (+[JSContextFileLoaderDelegate newContext]): (resolvePathToScripts): (-[JSContextFileLoaderDelegate context:fetchModuleForIdentifier:withResolveHandler:andRejectHandler:]): (testLoadBasicFile): (testObjectiveCAPI): * API/tests/testapiScripts/basic.js: Copied from Source/JavaScriptCore/API/JSVirtualMachineInternal.h. * JavaScriptCore.xcodeproj/project.pbxproj: * Sources.txt: * SourcesCocoa.txt: * config.h: * postprocess-headers.sh: * runtime/CallData.cpp: (JSC::call): * runtime/CallData.h: * runtime/Completion.cpp: (JSC::loadAndEvaluateModule): * runtime/Completion.h: * runtime/JSCast.h: (JSC::jsSecureCast): * runtime/JSGlobalObject.cpp: (JSC::createProxyProperty): Canonical link: https://commits.webkit.org/207912@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@239933 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2019-01-14 20:27:17 +00:00
API/JSScript.mm
Add API to generate and consume cached bytecode https://bugs.webkit.org/show_bug.cgi?id=193401 <rdar://problem/47514099> Reviewed by Keith Miller. Add the `generateBytecode` and `generateModuleBytecode` functions to generate serialized bytecode for a given `SourceCode`. These functions will eagerly generate code for all the nested functions. Additionally, update the API methods in JSScript to generate and use the bytecode when the bytecodeCache path is provided. * API/JSAPIGlobalObject.mm: (JSC::JSAPIGlobalObject::moduleLoaderFetch): * API/JSContext.mm: (-[JSContext wrapperMap]): * API/JSContextInternal.h: * API/JSScript.mm: (+[JSScript scriptWithSource:inVirtualMachine:]): (+[JSScript scriptFromASCIIFile:inVirtualMachine:withCodeSigning:andBytecodeCache:]): (-[JSScript dealloc]): (-[JSScript readCache]): (-[JSScript writeCache]): (-[JSScript hash]): (-[JSScript source]): (-[JSScript cachedBytecode]): (-[JSScript jsSourceCode:]): * API/JSScriptInternal.h: * API/JSScriptSourceProvider.h: Copied from Source/JavaScriptCore/API/JSScriptInternal.h. (JSScriptSourceProvider::create): (JSScriptSourceProvider::JSScriptSourceProvider): * API/JSScriptSourceProvider.mm: Copied from Source/JavaScriptCore/API/JSScriptInternal.h. (JSScriptSourceProvider::hash const): (JSScriptSourceProvider::source const): (JSScriptSourceProvider::cachedBytecode const): * API/JSVirtualMachine.mm: (-[JSVirtualMachine vm]): * API/JSVirtualMachineInternal.h: * API/tests/testapi.mm: (testBytecodeCache): (-[JSContextFileLoaderDelegate context:fetchModuleForIdentifier:withResolveHandler:andRejectHandler:]): (testObjectiveCAPI): * JavaScriptCore.xcodeproj/project.pbxproj: * SourcesCocoa.txt: * bytecode/UnlinkedFunctionExecutable.cpp: (JSC::UnlinkedFunctionExecutable::unlinkedCodeBlockFor): * bytecode/UnlinkedFunctionExecutable.h: * parser/SourceCodeKey.h: (JSC::SourceCodeKey::source const): * parser/SourceProvider.h: (JSC::CachedBytecode::CachedBytecode): (JSC::CachedBytecode::operator=): (JSC::CachedBytecode::data const): (JSC::CachedBytecode::size const): (JSC::CachedBytecode::owned const): (JSC::CachedBytecode::~CachedBytecode): (JSC::CachedBytecode::freeDataIfOwned): (JSC::SourceProvider::cachedBytecode const): * parser/UnlinkedSourceCode.h: (JSC::UnlinkedSourceCode::provider const): * runtime/CodeCache.cpp: (JSC::generateUnlinkedCodeBlockForFunctions): (JSC::writeCodeBlock): (JSC::serializeBytecode): * runtime/CodeCache.h: (JSC::CodeCacheMap::fetchFromDiskImpl): (JSC::CodeCacheMap::findCacheAndUpdateAge): (JSC::generateUnlinkedCodeBlockImpl): (JSC::generateUnlinkedCodeBlock): * runtime/Completion.cpp: (JSC::generateBytecode): (JSC::generateModuleBytecode): * runtime/Completion.h: * runtime/Options.cpp: (JSC::recomputeDependentOptions): Canonical link: https://commits.webkit.org/208348@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@240511 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2019-01-25 22:31:12 +00:00
API/JSScriptSourceProvider.mm
JSC should use unified sources for platform specific files. https://bugs.webkit.org/show_bug.cgi?id=177290 Reviewed by Michael Saboff. .: Change WEBKIT_COMPUTE_SOURCES CMake macro to look for platform specific unified source lists. This is done in the same way that we look for port specific configuration files. For example, if I were building for the Mac port WEBKIT_COMPUTE_SOURCES would add the Sources.txt and SourcesMac.txt source lists to the list of unified sources. * Source/cmake/WebKitMacros.cmake: Source/JavaScriptCore: Add a list of platform specific source files and update the Generate Unified Sources phase of the Xcode build. I skipped WPE since that seems to have failed for some reason that I didn't fully understand. See: https://webkit-queues.webkit.org/results/4611260 Also, fix duplicate symbols in Glib remote inspector files. * CMakeLists.txt: * JavaScriptCore.xcodeproj/project.pbxproj: * PlatformGTK.cmake: * PlatformMac.cmake: * SourcesGTK.txt: Added. * SourcesMac.txt: Added. * inspector/remote/glib/RemoteInspectorServer.cpp: (Inspector::RemoteInspectorServer::interfaceInfo): (Inspector::RemoteInspectorServer::setTargetList): (Inspector::RemoteInspectorServer::setupInspectorClient): (Inspector::RemoteInspectorServer::setup): (Inspector::RemoteInspectorServer::close): (Inspector::RemoteInspectorServer::connectionClosed): (Inspector::RemoteInspectorServer::sendMessageToBackend): (Inspector::RemoteInspectorServer::sendMessageToFrontend): (Inspector::dbusConnectionCallAsyncReadyCallback): Deleted. Source/WTF: The unified source bundler script can now handle more than one list of sources. Sources will not be bundled across source file lists. We want to ensure that changing one platform's sources doesn't break another platform's build, as much as possible. Additionally, it means that there won't be weird performance changes when files are added to an unrelated platform. Remove stale reference to generate-unified-source-bundles.rb script from Xcode. * Scripts/generate-unified-source-bundles.rb: * WTF.xcodeproj/project.pbxproj: Canonical link: https://commits.webkit.org/193634@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@222327 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-09-21 17:35:18 +00:00
API/JSContext.mm
API/JSManagedValue.mm
API/JSRemoteInspector.cpp
API/JSStringRefCF.cpp
API/JSValue.mm
API/JSVirtualMachine.mm
API/JSWrapperMap.mm
API/ObjCCallbackFunction.mm
// Use inspector/remote/SourcesCocoa.txt for Remote Inspector files