Only generate offline asm for the ARCHS (xcodebuild) or the current system (CMake)
authorkeith_miller@apple.com <keith_miller@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 22 Aug 2017 01:07:32 +0000 (01:07 +0000)
committerkeith_miller@apple.com <keith_miller@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 22 Aug 2017 01:07:32 +0000 (01:07 +0000)
https://bugs.webkit.org/show_bug.cgi?id=175690

Reviewed by Michael Saboff.

This should reduce some of the time we spend building offline asm
in our builds (except for linux since they already did this).

* CMakeLists.txt:
* JavaScriptCore.xcodeproj/project.pbxproj:
* offlineasm/backends.rb:
* offlineasm/generate_offset_extractor.rb:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@220994 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/JavaScriptCore/CMakeLists.txt
Source/JavaScriptCore/ChangeLog
Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj
Source/JavaScriptCore/offlineasm/backends.rb
Source/JavaScriptCore/offlineasm/generate_offset_extractor.rb

index 0aeb44c..d9a72f3 100644 (file)
@@ -1162,7 +1162,7 @@ list(APPEND JavaScriptCore_HEADERS
     ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/BytecodeStructs.h
 )
 
-if ((${CMAKE_SYSTEM_NAME} STREQUAL "Linux"))
+if (NOT WIN32)
     if (WTF_CPU_X86)
         set(OFFLINE_ASM_BACKEND "X86")
     elseif (WTF_CPU_X86_64)
index 8a25739..686cbed 100644 (file)
@@ -1,3 +1,18 @@
+2017-08-21  Keith Miller  <keith_miller@apple.com>
+
+        Only generate offline asm for the ARCHS (xcodebuild) or the current system (CMake)
+        https://bugs.webkit.org/show_bug.cgi?id=175690
+
+        Reviewed by Michael Saboff.
+
+        This should reduce some of the time we spend building offline asm
+        in our builds (except for linux since they already did this).
+
+        * CMakeLists.txt:
+        * JavaScriptCore.xcodeproj/project.pbxproj:
+        * offlineasm/backends.rb:
+        * offlineasm/generate_offset_extractor.rb:
+
 2017-08-20  Mark Lam  <mark.lam@apple.com>
 
         Gardening: fix CLoop build.
index 00b5824..4ddf966 100644 (file)
                        outputPaths = (
                        );
                        runOnlyForDeploymentPostprocessing = 0;
-                       shellPath = /bin/sh;
-                       shellScript = "set -e\n\nmkdir -p \"${BUILT_PRODUCTS_DIR}/LLIntOffsets/\"\n\n/usr/bin/env ruby \"${SRCROOT}/offlineasm/generate_offset_extractor.rb\" \"-I${BUILT_PRODUCTS_DIR}/DerivedSources/JavaScriptCore\" \"${SRCROOT}/llint/LowLevelInterpreter.asm\" \"${BUILT_PRODUCTS_DIR}/LLIntOffsets/LLIntDesiredOffsets.h\" \"X86,X86_64,ARMv7,ARMv7s,ARM64,C_LOOP\"\n";
-               };
+                        shellPath = /bin/sh;
+                        shellScript = "set -e\n\nmkdir -p \"${BUILT_PRODUCTS_DIR}/LLIntOffsets/\"\n\n/usr/bin/env ruby \"${SRCROOT}/offlineasm/generate_offset_extractor.rb\" \"-I${BUILT_PRODUCTS_DIR}/DerivedSources/JavaScriptCore\" \"${SRCROOT}/llint/LowLevelInterpreter.asm\" \"${BUILT_PRODUCTS_DIR}/LLIntOffsets/LLIntDesiredOffsets.h\" \"${ARCHS}\"\n";
+                };
                1A02D9A81B34A882000D1522 /* Add Symlink in /System/Library/PrivateFrameworks */ = {
                        isa = PBXShellScriptBuildPhase;
                        buildActionMask = 8;
index ba16335..faf5e50 100644 (file)
@@ -72,6 +72,21 @@ BACKENDS.each {
     $allBackends[backend] = true
 }
 
+def canonicalizeBackendNames(backendNames)
+    newBackendNames = []
+    backendNames.each {
+        | backendName |
+        backendName = backendName.upcase
+        if backendName =~ /ARM.*/
+            backendName.sub!(/ARMV7(S?)(.*)/) { | _ | 'ARMv7' + $1.downcase + $2 }
+        end
+        backendName = "X86" if backendName == "I386"
+        newBackendNames << backendName
+        newBackendNames << "ARMv7" if backendName == "ARMv7s"
+    }
+    newBackendNames.uniq
+end
+
 def includeOnlyBackends(list)
     newValidBackends = {}
     list.each {
index 84bb2d9..1cc54c1 100644 (file)
@@ -39,11 +39,9 @@ IncludeFile.processIncludeOptions()
 inputFlnm = ARGV.shift
 outputFlnm = ARGV.shift
 
-validBackends = ARGV.shift
-if validBackends
-    $stderr.puts "Only dealing with backends: #{validBackends}"
-    includeOnlyBackends(validBackends.split(","))
-end
+validBackends = canonicalizeBackendNames(ARGV.shift.split(","))
+$stderr.puts "Only dealing with backends: #{validBackends}"
+includeOnlyBackends(validBackends)
 
 def emitMagicNumber
     OFFSET_MAGIC_NUMBERS.each {