Title: [269171] trunk/Source/_javascript_Core
Revision
269171
Author
[email protected]
Date
2020-10-29 14:38:30 -0700 (Thu, 29 Oct 2020)

Log Message

_javascript_Core should support multiple build variants
<https://webkit.org/b/218347>
<rdar://problem/70786057>

Patch by Jérôme Decoodt <[email protected]> on 2020-10-29
Reviewed by Keith Miller.

Update _javascript_Core to handle BUILD_VARIANTS properly by
passing the value to build phase scripts and handling all
variants set during the build. For engineering builds,
BUILD_VARIANTS=normal.

* CMakeLists.txt:
- Update to pass equivalent ${BUILD_VARIANTS} for non-Apple
  platforms to asm.rb and generate_offset_extractor.rb.

* _javascript_Core.xcodeproj/project.pbxproj:
(LLInt Offsets | Generate Derived Sources):
(Offline Assembler | Offline Assemble):
- Update build phase script to pass "${BUILD_VARIANTS}" as an
  argument to scripts.

* offlineasm/asm.rb:
- Parse BUILD_VARIANTS argument to pass to
  offsetsAndConfigurationIndexForVariants().
* offlineasm/generate_offset_extractor.rb:
- Parse BUILD_VARIANTS argument to pass to
  configurationIndicesForVariants().

* offlineasm/offsets.rb:
(offsetsAndConfigurationIndex):
- Update argument list in comment block.
(offsetsAndConfigurationIndexForVariants): Add.
- Invoke offsetsAndConfigurationIndex() for each build variant.
(configurationIndices):
- Update argument list in comment block.
(configurationIndicesForVariants): Add.
- Invoke configurationIndices() for each build variant.

Modified Paths

Diff

Modified: trunk/Source/_javascript_Core/CMakeLists.txt (269170 => 269171)


--- trunk/Source/_javascript_Core/CMakeLists.txt	2020-10-29 21:35:14 UTC (rev 269170)
+++ trunk/Source/_javascript_Core/CMakeLists.txt	2020-10-29 21:38:30 UTC (rev 269171)
@@ -183,6 +183,11 @@
     ${_javascript_Core_DERIVED_SOURCES_DIR}/udis86_itab.h
 )
 
+# This is the default build variant for Xcode builds.
+set(BUILD_VARIANTS
+    "normal"
+)
+
 set(LLINT_ASM
     llint/LowLevelInterpreter.asm
     llint/LowLevelInterpreter32_64.asm
@@ -291,7 +296,7 @@
     OUTPUT ${_javascript_Core_DERIVED_SOURCES_DIR}/LLIntDesiredOffsets.h
     MAIN_DEPENDENCY ${_javascript_CORE_DIR}/offlineasm/generate_offset_extractor.rb
     DEPENDS LLIntSettingsExtractor ${LLINT_ASM} ${OFFLINE_ASM} ${_javascript_Core_DERIVED_SOURCES_DIR}/InitBytecodes.asm ${_javascript_Core_DERIVED_SOURCES_DIR}/InitWasm.asm ${_javascript_Core_DERIVED_SOURCES_DIR}/AirOpcode.h ${_javascript_Core_DERIVED_SOURCES_DIR}/WasmOps.h
-    COMMAND ${RUBY_EXECUTABLE} ${_javascript_CORE_DIR}/offlineasm/generate_offset_extractor.rb -I${_javascript_Core_DERIVED_SOURCES_DIR}/ ${_javascript_CORE_DIR}/llint/LowLevelInterpreter.asm $<TARGET_FILE:LLIntSettingsExtractor> ${_javascript_Core_DERIVED_SOURCES_DIR}/LLIntDesiredOffsets.h ${OFFLINE_ASM_BACKEND}
+    COMMAND ${RUBY_EXECUTABLE} ${_javascript_CORE_DIR}/offlineasm/generate_offset_extractor.rb -I${_javascript_Core_DERIVED_SOURCES_DIR}/ ${_javascript_CORE_DIR}/llint/LowLevelInterpreter.asm $<TARGET_FILE:LLIntSettingsExtractor> ${_javascript_Core_DERIVED_SOURCES_DIR}/LLIntDesiredOffsets.h ${OFFLINE_ASM_BACKEND} ${BUILD_VARIANTS}
     VERBATIM)
 
 # We add the header files directly to the ADD_EXECUTABLE call instead of setting the
@@ -335,7 +340,7 @@
     OUTPUT ${_javascript_Core_DERIVED_SOURCES_DIR}/${LLIntOutput}
     MAIN_DEPENDENCY ${_javascript_CORE_DIR}/offlineasm/asm.rb
     DEPENDS LLIntOffsetsExtractor ${LLINT_ASM} ${OFFLINE_ASM} ${_javascript_Core_DERIVED_SOURCES_DIR}/InitBytecodes.asm ${_javascript_Core_DERIVED_SOURCES_DIR}/InitWasm.asm
-    COMMAND ${CMAKE_COMMAND} -E env CMAKE_CXX_COMPILER_ID=${CMAKE_CXX_COMPILER_ID} GCC_OFFLINEASM_SOURCE_MAP=${GCC_OFFLINEASM_SOURCE_MAP} ${RUBY_EXECUTABLE} ${_javascript_CORE_DIR}/offlineasm/asm.rb -I${_javascript_Core_DERIVED_SOURCES_DIR}/ ${_javascript_CORE_DIR}/llint/LowLevelInterpreter.asm $<TARGET_FILE:LLIntOffsetsExtractor> ${_javascript_Core_DERIVED_SOURCES_DIR}/${LLIntOutput} ${OFFLINE_ASM_ARGS}
+    COMMAND ${CMAKE_COMMAND} -E env CMAKE_CXX_COMPILER_ID=${CMAKE_CXX_COMPILER_ID} GCC_OFFLINEASM_SOURCE_MAP=${GCC_OFFLINEASM_SOURCE_MAP} ${RUBY_EXECUTABLE} ${_javascript_CORE_DIR}/offlineasm/asm.rb -I${_javascript_Core_DERIVED_SOURCES_DIR}/ ${_javascript_CORE_DIR}/llint/LowLevelInterpreter.asm $<TARGET_FILE:LLIntOffsetsExtractor> ${_javascript_Core_DERIVED_SOURCES_DIR}/${LLIntOutput} ${BUILD_VARIANTS} ${OFFLINE_ASM_ARGS}
     COMMAND ${CMAKE_COMMAND} -E touch_nocreate ${_javascript_Core_DERIVED_SOURCES_DIR}/${LLIntOutput}
     WORKING_DIRECTORY ${_javascript_Core_DERIVED_SOURCES_DIR}
     VERBATIM)

Modified: trunk/Source/_javascript_Core/ChangeLog (269170 => 269171)


--- trunk/Source/_javascript_Core/ChangeLog	2020-10-29 21:35:14 UTC (rev 269170)
+++ trunk/Source/_javascript_Core/ChangeLog	2020-10-29 21:38:30 UTC (rev 269171)
@@ -1,3 +1,43 @@
+2020-10-29  Jérôme Decoodt  <[email protected]>
+
+        _javascript_Core should support multiple build variants
+        <https://webkit.org/b/218347>
+        <rdar://problem/70786057>
+
+        Reviewed by Keith Miller.
+
+        Update _javascript_Core to handle BUILD_VARIANTS properly by
+        passing the value to build phase scripts and handling all
+        variants set during the build. For engineering builds,
+        BUILD_VARIANTS=normal.
+
+        * CMakeLists.txt:
+        - Update to pass equivalent ${BUILD_VARIANTS} for non-Apple
+          platforms to asm.rb and generate_offset_extractor.rb.
+
+        * _javascript_Core.xcodeproj/project.pbxproj:
+        (LLInt Offsets | Generate Derived Sources):
+        (Offline Assembler | Offline Assemble):
+        - Update build phase script to pass "${BUILD_VARIANTS}" as an
+          argument to scripts.
+
+        * offlineasm/asm.rb:
+        - Parse BUILD_VARIANTS argument to pass to
+          offsetsAndConfigurationIndexForVariants().
+        * offlineasm/generate_offset_extractor.rb:
+        - Parse BUILD_VARIANTS argument to pass to
+          configurationIndicesForVariants().
+
+        * offlineasm/offsets.rb:
+        (offsetsAndConfigurationIndex):
+        - Update argument list in comment block.
+        (offsetsAndConfigurationIndexForVariants): Add.
+        - Invoke offsetsAndConfigurationIndex() for each build variant.
+        (configurationIndices):
+        - Update argument list in comment block.
+        (configurationIndicesForVariants): Add.
+        - Invoke configurationIndices() for each build variant.
+
 2020-10-28  Basuke Suzuki  <[email protected]>
 
         [WinCairo][PlayStation] Add handling for accept failure case

Modified: trunk/Source/_javascript_Core/_javascript_Core.xcodeproj/project.pbxproj (269170 => 269171)


--- trunk/Source/_javascript_Core/_javascript_Core.xcodeproj/project.pbxproj	2020-10-29 21:35:14 UTC (rev 269170)
+++ trunk/Source/_javascript_Core/_javascript_Core.xcodeproj/project.pbxproj	2020-10-29 21:38:30 UTC (rev 269171)
@@ -10952,7 +10952,7 @@
 			);
 			runOnlyForDeploymentPostprocessing = 0;
 			shellPath = /bin/sh;
-			shellScript = "set -e\n\nmkdir -p \"${BUILT_PRODUCTS_DIR}/LLIntOffsets/${ARCHS}\"\n\n/usr/bin/env ruby \"${SRCROOT}/offlineasm/generate_offset_extractor.rb\" \"-I${BUILT_PRODUCTS_DIR}/DerivedSources/_javascript_Core\" \"${SRCROOT}/llint/LowLevelInterpreter.asm\"  \"${BUILT_PRODUCTS_DIR}/JSCLLIntSettingsExtractor\" \"${BUILT_PRODUCTS_DIR}/LLIntOffsets/${ARCHS}/LLIntDesiredOffsets.h\" \"${ARCHS} C_LOOP\"\n";
+			shellScript = "set -e\n\nmkdir -p \"${BUILT_PRODUCTS_DIR}/LLIntOffsets/${ARCHS}\"\n\n/usr/bin/env ruby \"${SRCROOT}/offlineasm/generate_offset_extractor.rb\" \"-I${BUILT_PRODUCTS_DIR}/DerivedSources/_javascript_Core\" \"${SRCROOT}/llint/LowLevelInterpreter.asm\"  \"${BUILT_PRODUCTS_DIR}/JSCLLIntSettingsExtractor\" \"${BUILT_PRODUCTS_DIR}/LLIntOffsets/${ARCHS}/LLIntDesiredOffsets.h\" \"${ARCHS} C_LOOP\" \"${BUILD_VARIANTS}\"\n";
 		};
 		14BD6892215191450050DAFF /* Generate Derived Sources */ = {
 			isa = PBXShellScriptBuildPhase;
@@ -11193,7 +11193,7 @@
 			);
 			runOnlyForDeploymentPostprocessing = 0;
 			shellPath = /bin/sh;
-			shellScript = "if [[ \"${ACTION}\" == \"installhdrs\" ]]; then\n    exit 0\nfi\n\ncd \"${BUILT_PRODUCTS_DIR}/DerivedSources/_javascript_Core\"\n\n/usr/bin/env ruby _javascript_Core/offlineasm/asm.rb \"-I${BUILT_PRODUCTS_DIR}/DerivedSources/_javascript_Core\" _javascript_Core/llint/LowLevelInterpreter.asm \"${BUILT_PRODUCTS_DIR}/JSCLLIntOffsetsExtractor\" LLIntAssembly.h || exit 1\n";
+			shellScript = "if [[ \"${ACTION}\" == \"installhdrs\" ]]; then\n    exit 0\nfi\n\ncd \"${BUILT_PRODUCTS_DIR}/DerivedSources/_javascript_Core\"\n\n/usr/bin/env ruby _javascript_Core/offlineasm/asm.rb \"-I${BUILT_PRODUCTS_DIR}/DerivedSources/_javascript_Core\" _javascript_Core/llint/LowLevelInterpreter.asm \"${BUILT_PRODUCTS_DIR}/JSCLLIntOffsetsExtractor\" LLIntAssembly.h \"${BUILD_VARIANTS}\" || exit 1\n";
 		};
 		65FB3F6509D11E9100F49DEB /* Generate Derived Sources */ = {
 			isa = PBXShellScriptBuildPhase;

Modified: trunk/Source/_javascript_Core/offlineasm/asm.rb (269170 => 269171)


--- trunk/Source/_javascript_Core/offlineasm/asm.rb	2020-10-29 21:35:14 UTC (rev 269170)
+++ trunk/Source/_javascript_Core/offlineasm/asm.rb	2020-10-29 21:38:30 UTC (rev 269171)
@@ -331,6 +331,7 @@
 asmFile = ARGV.shift
 offsetsFile = ARGV.shift
 outputFlnm = ARGV.shift
+variants = ARGV.shift.split(/[,\s]+/)
 
 $options = {}
 OptionParser.new do |opts|
@@ -342,7 +343,7 @@
 end.parse!
 
 begin
-    configurationList = offsetsAndConfigurationIndex(offsetsFile)
+    configurationList = offsetsAndConfigurationIndexForVariants(offsetsFile, variants)
 rescue MissingMagicValuesException
     $stderr.puts "offlineasm: No magic values found. Skipping assembly file generation."
     exit 1

Modified: trunk/Source/_javascript_Core/offlineasm/generate_offset_extractor.rb (269170 => 269171)


--- trunk/Source/_javascript_Core/offlineasm/generate_offset_extractor.rb	2020-10-29 21:35:14 UTC (rev 269170)
+++ trunk/Source/_javascript_Core/offlineasm/generate_offset_extractor.rb	2020-10-29 21:38:30 UTC (rev 269171)
@@ -43,8 +43,10 @@
 validBackends = canonicalizeBackendNames(ARGV.shift.split(/[,\s]+/))
 includeOnlyBackends(validBackends)
 
+variants = ARGV.shift.split(/[,\s]+/)
+
 begin
-    configurationList = configurationIndices(settingsFlnm)
+    configurationList = configurationIndicesForVariants(settingsFlnm, variants)
 rescue MissingMagicValuesException
     $stderr.puts "OffsetExtractor: No magic values found. Skipping offsets extractor file generation."
     exit 1

Modified: trunk/Source/_javascript_Core/offlineasm/offsets.rb (269170 => 269171)


--- trunk/Source/_javascript_Core/offlineasm/offsets.rb	2020-10-29 21:35:14 UTC (rev 269170)
+++ trunk/Source/_javascript_Core/offlineasm/offsets.rb	2020-10-29 21:38:30 UTC (rev 269171)
@@ -139,7 +139,7 @@
 end
 
 #
-# offsetsAndConfigurationIndex(ast, file) ->
+# offsetsAndConfigurationIndex(file) ->
 #     [[offsets, index], ...]
 #
 # Parses the offsets from a file and returns a list of offsets and the
@@ -182,9 +182,30 @@
 end
 
 #
-# configurationIndices(ast, file) ->
+# offsetsAndConfigurationIndex(file) ->
 #     [[offsets, index], ...]
 #
+# Parses the offsets from a file and all its variants and returns a list of
+# offsets and the index of the configuration that is valid in this build target.
+#
+
+def offsetsAndConfigurationIndexForVariants(file, variants)
+    results = []
+    variants.each {
+        | current_variant |
+        suffix = ""
+        unless current_variant == "normal"
+            suffix = "_" + current_variant
+        end
+        results << offsetsAndConfigurationIndex(file + suffix)
+    }
+    return results.flatten(1)
+end
+
+#
+# configurationIndices(file) ->
+#     [[offsets, index], ...]
+#
 # Parses the configurations from a file and returns a list of the indices of
 # the configurations that are valid in this build target.
 #
@@ -212,6 +233,27 @@
 end
 
 #
+# configurationIndicesForVariants(file, variants) ->
+#     [[offsets, index], ...]
+#
+# Parses the configurations from a file and all its variants and returns a list
+# of the indices of the configurations that are valid in this build target.
+#
+
+def configurationIndicesForVariants(file, variants)
+    results = []
+    variants.each {
+        | current_variant |
+        suffix = ""
+        unless current_variant == "normal"
+            suffix = "_" + current_variant
+        end
+        results << configurationIndices(file + suffix)
+    }
+    return results.flatten(1)
+end
+
+#
 # buildOffsetsMap(ast, extractedConstants) -> map
 #
 # Builds a mapping between StructOffset, Sizeof, and ConstExpr nodes and their values.
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to