Diff
Modified: trunk/ChangeLog (219288 => 219289)
--- trunk/ChangeLog 2017-07-10 10:13:47 UTC (rev 219288)
+++ trunk/ChangeLog 2017-07-10 13:19:55 UTC (rev 219289)
@@ -1,3 +1,15 @@
+2017-07-10 Carlos Garcia Campos <[email protected]>
+
+ Move make-js-file-arrays.py from WebCore to _javascript_Core
+ https://bugs.webkit.org/show_bug.cgi?id=174024
+
+ Reviewed by Michael Catanzaro.
+
+ Make MAKE_JS_FILE_ARRAYS independent of WebCore and update it to use make-js-file-arrays.py from
+ _javascript_Core. It's no longer needed to set PYTHON_PATH to find jsmin.py.
+
+ * Source/cmake/WebKitMacros.cmake:
+
2017-07-08 Yusuke Suzuki <[email protected]>
Drop NOSNIFF compile flag
Modified: trunk/Source/_javascript_Core/ChangeLog (219288 => 219289)
--- trunk/Source/_javascript_Core/ChangeLog 2017-07-10 10:13:47 UTC (rev 219288)
+++ trunk/Source/_javascript_Core/ChangeLog 2017-07-10 13:19:55 UTC (rev 219289)
@@ -1,3 +1,18 @@
+2017-07-10 Carlos Garcia Campos <[email protected]>
+
+ Move make-js-file-arrays.py from WebCore to _javascript_Core
+ https://bugs.webkit.org/show_bug.cgi?id=174024
+
+ Reviewed by Michael Catanzaro.
+
+ It's currently used only by WebCore, but it depends on other _javascript_Core scripts and it's not WebCore
+ specific at all. I plan to use it to compile the _javascript_ atoms used by the WebDriver implementation.
+ Added command line option to pass the namespace to use instead of using WebCore.
+
+ * _javascript_Core.xcodeproj/project.pbxproj:
+ * Scripts/make-js-file-arrays.py: Renamed from Source/WebCore/Scripts/make-js-file-arrays.py.
+ (main):
+
2017-07-09 Yusuke Suzuki <[email protected]>
[JSC] Drop LineNumberAdder since we no longer treat <LF><CR> (not <CR><LF>) as one line terminator
Modified: trunk/Source/_javascript_Core/_javascript_Core.xcodeproj/project.pbxproj (219288 => 219289)
--- trunk/Source/_javascript_Core/_javascript_Core.xcodeproj/project.pbxproj 2017-07-10 10:13:47 UTC (rev 219288)
+++ trunk/Source/_javascript_Core/_javascript_Core.xcodeproj/project.pbxproj 2017-07-10 13:19:55 UTC (rev 219289)
@@ -1900,6 +1900,7 @@
A5EA710A19F6DE7E0098F5EC /* generate_objc_internal_header.py in Headers */ = {isa = PBXBuildFile; fileRef = A5EA70F619F6DE5A0098F5EC /* generate_objc_internal_header.py */; settings = {ATTRIBUTES = (Private, ); }; };
A5EA710C19F6DE820098F5EC /* objc_generator.py in Headers */ = {isa = PBXBuildFile; fileRef = A5EA70F819F6DE5A0098F5EC /* objc_generator.py */; settings = {ATTRIBUTES = (Private, ); }; };
A5EA710E19F6DF810098F5EC /* InspectorAlternateBackendDispatchers.h in Headers */ = {isa = PBXBuildFile; fileRef = A5EA710D19F6DF810098F5EC /* InspectorAlternateBackendDispatchers.h */; settings = {ATTRIBUTES = (Private, ); }; };
+ A5EF13F91F073204000F0442 /* make-js-file-arrays.py in Headers */ = {isa = PBXBuildFile; fileRef = A5EF13F71F0731B4000F0442 /* make-js-file-arrays.py */; settings = {ATTRIBUTES = (Private, ); }; };
A5EF9B141A1D43F600702E90 /* generate_cpp_backend_dispatcher_header.py in Headers */ = {isa = PBXBuildFile; fileRef = C4F4B6D11A05C76F005CAB76 /* generate_cpp_backend_dispatcher_header.py */; settings = {ATTRIBUTES = (Private, ); }; };
A5EF9B151A1D43FA00702E90 /* generate_cpp_backend_dispatcher_implementation.py in Headers */ = {isa = PBXBuildFile; fileRef = C4F4B6D21A05C76F005CAB76 /* generate_cpp_backend_dispatcher_implementation.py */; settings = {ATTRIBUTES = (Private, ); }; };
A5EF9B161A1D440000702E90 /* generate_cpp_frontend_dispatcher_header.py in Headers */ = {isa = PBXBuildFile; fileRef = C4F4B6D31A05C76F005CAB76 /* generate_cpp_frontend_dispatcher_header.py */; settings = {ATTRIBUTES = (Private, ); }; };
@@ -4532,6 +4533,7 @@
A5EA70F619F6DE5A0098F5EC /* generate_objc_internal_header.py */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.python; path = generate_objc_internal_header.py; sourceTree = "<group>"; };
A5EA70F819F6DE5A0098F5EC /* objc_generator.py */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.python; path = objc_generator.py; sourceTree = "<group>"; };
A5EA710D19F6DF810098F5EC /* InspectorAlternateBackendDispatchers.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InspectorAlternateBackendDispatchers.h; sourceTree = "<group>"; };
+ A5EF13F71F0731B4000F0442 /* make-js-file-arrays.py */ = {isa = PBXFileReference; lastKnownFileType = text.script.python; path = "make-js-file-arrays.py"; sourceTree = "<group>"; };
A5FC84B01D1DDAC8006B5C46 /* DebuggerLocation.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DebuggerLocation.cpp; sourceTree = "<group>"; };
A5FC84B11D1DDAC8006B5C46 /* DebuggerLocation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DebuggerLocation.h; sourceTree = "<group>"; };
A5FD0065189AFE9C00633231 /* ScriptArguments.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ScriptArguments.cpp; sourceTree = "<group>"; };
@@ -7827,6 +7829,7 @@
9959E9301BD181F6001AA413 /* inline-and-minify-stylesheets-and-scripts.py */,
9959E9291BD17FA0001AA413 /* jsmin.py */,
99DA00AD1BD5993E00F4575C /* lazywriter.py */,
+ A5EF13F71F0731B4000F0442 /* make-js-file-arrays.py */,
99DA00AE1BD5993E00F4575C /* UpdateContents.py */,
9959E92A1BD17FA0001AA413 /* xxd.pl */,
);
@@ -9221,6 +9224,7 @@
860161E40F3A83C100F84710 /* MacroAssemblerX86.h in Headers */,
860161E50F3A83C100F84710 /* MacroAssemblerX86_64.h in Headers */,
860161E60F3A83C100F84710 /* MacroAssemblerX86Common.h in Headers */,
+ A5EF13F91F073204000F0442 /* make-js-file-arrays.py in Headers */,
A700873A17CBE85300C3E643 /* MapConstructor.h in Headers */,
A74DEF94182D991400522C22 /* MapIteratorPrototype.h in Headers */,
A700873E17CBE8D300C3E643 /* MapPrototype.h in Headers */,
Copied: trunk/Source/_javascript_Core/Scripts/make-js-file-arrays.py (from rev 219288, trunk/Source/WebCore/Scripts/make-js-file-arrays.py) (0 => 219289)
--- trunk/Source/_javascript_Core/Scripts/make-js-file-arrays.py (rev 0)
+++ trunk/Source/_javascript_Core/Scripts/make-js-file-arrays.py 2017-07-10 13:19:55 UTC (rev 219289)
@@ -0,0 +1,97 @@
+#!/usr/bin/env python
+# Copyright (C) 2014 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.
+
+import io
+import os
+from optparse import OptionParser
+from StringIO import StringIO
+from jsmin import _javascript_Minify
+
+
+def stringifyCodepoint(code):
+ if code < 128:
+ return '{0:d}'.format(code)
+ else:
+ return "'\\x{0:02x}'".format(code)
+
+
+def chunk(list, chunkSize):
+ for i in xrange(0, len(list), chunkSize):
+ yield list[i:i + chunkSize]
+
+
+def main():
+ parser = OptionParser(usage="usage: %prog [options] header source [input [input...]]")
+ parser.add_option('--no-minify', action='', help='Do not run the input files through jsmin')
+ parser.add_option('-n', '--namespace', help='Namespace to use')
+ (options, arguments) = parser.parse_args()
+ if not options.namespace:
+ print 'Error: must provide a namespace'
+ parser.print_usage()
+ exit(-1)
+ if len(arguments) < 3:
+ print 'Error: must provide at least 3 arguments'
+ parser.print_usage()
+ exit(-1)
+
+ namespace = options.namespace
+ headerPath = arguments[0]
+ sourcePath = arguments[1]
+ inputPaths = arguments[2:]
+
+ headerFile = open(headerPath, 'w')
+ print >> headerFile, 'namespace {0:s} {{'.format(namespace)
+
+ sourceFile = open(sourcePath, 'w')
+ print >> sourceFile, '#include "{0:s}"'.format(os.path.basename(headerPath))
+ print >> sourceFile, 'namespace {0:s} {{'.format(namespace)
+
+ jsm = _javascript_Minify()
+
+ for inputFileName in inputPaths:
+ inputStream = io.FileIO(inputFileName)
+ outputStream = StringIO()
+
+ if not options.no_minify:
+ jsm.minify(inputStream, outputStream)
+ characters = outputStream.getvalue()
+ else:
+ characters = inputStream.read()
+
+ size = len(characters)
+ variableName = os.path.splitext(os.path.basename(inputFileName))[0]
+
+ print >> headerFile, 'extern const char {0:s}_javascript_[{1:d}];'.format(variableName, size)
+ print >> sourceFile, 'const char {0:s}_javascript_[{1:d}] = {{'.format(variableName, size)
+
+ codepoints = map(ord, characters)
+ for codepointChunk in chunk(codepoints, 16):
+ print >> sourceFile, ' {0:s},'.format(','.join(map(stringifyCodepoint, codepointChunk)))
+
+ print >> sourceFile, '};'
+
+ print >> headerFile, '}} // namespace {0:s}'.format(namespace)
+ print >> sourceFile, '}} // namespace {0:s}'.format(namespace)
+
+if __name__ == '__main__':
+ main()
Modified: trunk/Source/WebCore/CMakeLists.txt (219288 => 219289)
--- trunk/Source/WebCore/CMakeLists.txt 2017-07-10 10:13:47 UTC (rev 219288)
+++ trunk/Source/WebCore/CMakeLists.txt 2017-07-10 13:19:55 UTC (rev 219289)
@@ -3748,9 +3748,11 @@
MAKE_JS_FILE_ARRAYS(
${DERIVED_SOURCES_WEBCORE_DIR}/UserAgentScriptsData.cpp
${DERIVED_SOURCES_WEBCORE_DIR}/UserAgentScripts.h
+ WebCore
WebCore_USER_AGENT_SCRIPTS
WebCore_USER_AGENT_SCRIPTS_DEPENDENCIES
)
+ list(APPEND WebCore_DERIVED_SOURCES ${DERIVED_SOURCES_WEBCORE_DIR}/UserAgentScriptsData.cpp)
endif ()
if (ENABLE_WEB_RTC)
@@ -3764,9 +3766,11 @@
MAKE_JS_FILE_ARRAYS(
${DERIVED_SOURCES_WEBCORE_DIR}/SDPProcessorScriptsData.cpp
${DERIVED_SOURCES_WEBCORE_DIR}/SDPProcessorScriptsData.h
+ WebCore
WebCore_SDP_PROCESSOR_SCRIPTS
WebCore_SDP_PROCESSOR_SCRIPTS_DEPENDENCIES
)
+ list(APPEND WebCore_DERIVED_SOURCES ${DERIVED_SOURCES_WEBCORE_DIR}/SDPProcessorScriptsData.cpp)
endif ()
# Generate plug-in resources
Modified: trunk/Source/WebCore/ChangeLog (219288 => 219289)
--- trunk/Source/WebCore/ChangeLog 2017-07-10 10:13:47 UTC (rev 219288)
+++ trunk/Source/WebCore/ChangeLog 2017-07-10 13:19:55 UTC (rev 219289)
@@ -1,3 +1,15 @@
+2017-07-10 Carlos Garcia Campos <[email protected]>
+
+ Move make-js-file-arrays.py from WebCore to _javascript_Core
+ https://bugs.webkit.org/show_bug.cgi?id=174024
+
+ Reviewed by Michael Catanzaro.
+
+ * CMakeLists.txt: Explicitly add files generated by MAKE_JS_FILE_ARRAYS to the build, since the macro no longer
+ does it.
+ * DerivedSources.make: Updated to use make-js-file-arrays.py from _javascript_Core. It's no longer needed to set
+ PYTHON_PATH to find jsmin.py.
+
2017-07-10 Charlie Turner <[email protected]>
[GTK] http/tests/media/video-redirect.html is failing
Modified: trunk/Source/WebCore/DerivedSources.make (219288 => 219289)
--- trunk/Source/WebCore/DerivedSources.make 2017-07-10 10:13:47 UTC (rev 219288)
+++ trunk/Source/WebCore/DerivedSources.make 2017-07-10 13:19:55 UTC (rev 219289)
@@ -1109,8 +1109,8 @@
ifdef WEBCORE_SDP_PROCESSOR_SCRIPTS
all : SDPProcessorScriptsData.h
-SDPProcessorScriptsData.h : Scripts/make-js-file-arrays.py $(WEBCORE_SDP_PROCESSOR_SCRIPTS)
- PYTHONPATH=$(_javascript_Core_SCRIPTS_DIR) $(PYTHON) $< $@ SDPProcessorScriptsData.cpp $(WEBCORE_SDP_PROCESSOR_SCRIPTS)
+SDPProcessorScriptsData.h : $(_javascript_Core_SCRIPTS_DIR)/make-js-file-arrays.py $(WEBCORE_SDP_PROCESSOR_SCRIPTS)
+ $(PYTHON) $(_javascript_Core_SCRIPTS_DIR)/make-js-file-arrays.py -n WebCore $@ SDPProcessorScriptsData.cpp $(WEBCORE_SDP_PROCESSOR_SCRIPTS)
endif
# --------
@@ -1164,8 +1164,8 @@
ifdef USER_AGENT_SCRIPTS
all : UserAgentScripts.h
-UserAgentScripts.h : Scripts/make-js-file-arrays.py $(USER_AGENT_SCRIPTS)
- PYTHONPATH=$(_javascript_Core_SCRIPTS_DIR) $(PYTHON) $< $@ UserAgentScriptsData.cpp $(USER_AGENT_SCRIPTS)
+UserAgentScripts.h : $(_javascript_Core_SCRIPTS_DIR)/make-js-file-arrays.py $(USER_AGENT_SCRIPTS)
+ $(PYTHON) $(_javascript_Core_SCRIPTS_DIR)/make-js-file-arrays.py -n WebCore $@ UserAgentScriptsData.cpp $(USER_AGENT_SCRIPTS)
endif
# --------
Deleted: trunk/Source/WebCore/Scripts/make-js-file-arrays.py (219288 => 219289)
--- trunk/Source/WebCore/Scripts/make-js-file-arrays.py 2017-07-10 10:13:47 UTC (rev 219288)
+++ trunk/Source/WebCore/Scripts/make-js-file-arrays.py 2017-07-10 13:19:55 UTC (rev 219289)
@@ -1,91 +0,0 @@
-#!/usr/bin/env python
-# Copyright (C) 2014 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.
-
-import io
-import os
-from optparse import OptionParser
-from StringIO import StringIO
-from jsmin import _javascript_Minify
-
-
-def stringifyCodepoint(code):
- if code < 128:
- return '{0:d}'.format(code)
- else:
- return "'\\x{0:02x}'".format(code)
-
-
-def chunk(list, chunkSize):
- for i in xrange(0, len(list), chunkSize):
- yield list[i:i + chunkSize]
-
-
-def main():
- parser = OptionParser(usage="usage: %prog [--no-minify] header source [input [input...]]")
- parser.add_option('--no-minify', action='', help='Do not run the input files through jsmin')
- (options, arguments) = parser.parse_args()
- if len(arguments) < 3:
- print 'Error: must provide at least 3 arguments'
- parser.print_usage()
- exit(-1)
-
- headerPath = arguments[0]
- sourcePath = arguments[1]
- inputPaths = arguments[2:]
-
- headerFile = open(headerPath, 'w')
- print >> headerFile, 'namespace WebCore {'
-
- sourceFile = open(sourcePath, 'w')
- print >> sourceFile, '#include "{0:s}"'.format(os.path.basename(headerPath))
- print >> sourceFile, 'namespace WebCore {'
-
- jsm = _javascript_Minify()
-
- for inputFileName in inputPaths:
- inputStream = io.FileIO(inputFileName)
- outputStream = StringIO()
-
- if not options.no_minify:
- jsm.minify(inputStream, outputStream)
- characters = outputStream.getvalue()
- else:
- characters = inputStream.read()
-
- size = len(characters)
- variableName = os.path.splitext(os.path.basename(inputFileName))[0]
-
- print >> headerFile, 'extern const char {0:s}_javascript_[{1:d}];'.format(variableName, size)
- print >> sourceFile, 'const char {0:s}_javascript_[{1:d}] = {{'.format(variableName, size)
-
- codepoints = map(ord, characters)
- for codepointChunk in chunk(codepoints, 16):
- print >> sourceFile, ' {0:s},'.format(','.join(map(stringifyCodepoint, codepointChunk)))
-
- print >> sourceFile, '};'
-
- print >> headerFile, '}'
- print >> sourceFile, '}'
-
-if __name__ == '__main__':
- main()
Modified: trunk/Source/cmake/WebKitMacros.cmake (219288 => 219289)
--- trunk/Source/cmake/WebKitMacros.cmake 2017-07-10 10:13:47 UTC (rev 219288)
+++ trunk/Source/cmake/WebKitMacros.cmake 2017-07-10 13:19:55 UTC (rev 219289)
@@ -396,22 +396,12 @@
endforeach ()
endmacro()
-macro(MAKE_JS_FILE_ARRAYS _output_cpp _output_h _scripts _scripts_dependencies)
- if (NOT CMAKE_VERSION VERSION_LESS 3.1)
- set(_python_path ${CMAKE_COMMAND} -E env "PYTHONPATH=${_javascript_Core_SCRIPTS_DIR}")
- elseif (WIN32)
- set(_python_path set "PYTHONPATH=${_javascript_Core_SCRIPTS_DIR}" &&)
- else ()
- set(_python_path "PYTHONPATH=${_javascript_Core_SCRIPTS_DIR}")
- endif ()
-
+macro(MAKE_JS_FILE_ARRAYS _output_cpp _output_h _namespace _scripts _scripts_dependencies)
add_custom_command(
OUTPUT ${_output_h} ${_output_cpp}
- MAIN_DEPENDENCY ${WEBCORE_DIR}/Scripts/make-js-file-arrays.py
- DEPENDS ${${_scripts}}
- COMMAND ${_python_path} ${PYTHON_EXECUTABLE} ${WEBCORE_DIR}/Scripts/make-js-file-arrays.py ${_output_h} ${_output_cpp} ${${_scripts}}
+ DEPENDS ${_javascript_Core_SCRIPTS_DIR}/make-js-file-arrays.py ${${_scripts}}
+ COMMAND ${PYTHON_EXECUTABLE} ${_javascript_Core_SCRIPTS_DIR}/make-js-file-arrays.py -n ${_namespace} ${_output_h} ${_output_cpp} ${${_scripts}}
VERBATIM)
- list(APPEND WebCore_DERIVED_SOURCES ${_output_cpp})
ADD_SOURCE_DEPENDENCIES(${${_scripts_dependencies}} ${_output_h} ${_output_cpp})
endmacro()