Title: [259996] trunk/Source
Revision
259996
Author
[email protected]
Date
2020-04-13 00:15:26 -0700 (Mon, 13 Apr 2020)

Log Message

Enable the ability to build the ASM LLInt for ARMv7k.
https://bugs.webkit.org/show_bug.cgi?id=210412

Reviewed by Sam Weinig.

Source/_javascript_Core:

Fix the offlineasm so that it can build the ASM LLInt for ARMv7k.  This patch does
not actually enable the ASM LLInt.  The ARMv7k port still build the C Loop LLInt.

Also, the ARMv7k ASM LLInt is still broken and needs additional work before it
can run.  This patch only fixes things so that it will build.

* _javascript_Core.xcodeproj/project.pbxproj:
- Added generate_settings_extractor.rb to the project so that we can view it from
  inside Xcode.

* offlineasm/arm.rb:
- Added support for the globaladdr LLInt instruction for ARMv7k.

* offlineasm/backends.rb:
- Fix the backend to enable ARMV7 also when building for ARMv7k.

Source/WTF:

Remove some old code that forces the ENABLE(C_LOOP) to be true if ENABLE(JIT) is
false.  These 2 options used to be mutually exclusive, but is no more.  Now, we
allow platforms to choose to build the ASM LLInt instead even if ENABLE(JIT) is
false.

* wtf/PlatformEnable.h:

Modified Paths

Diff

Modified: trunk/Source/_javascript_Core/ChangeLog (259995 => 259996)


--- trunk/Source/_javascript_Core/ChangeLog	2020-04-13 06:39:57 UTC (rev 259995)
+++ trunk/Source/_javascript_Core/ChangeLog	2020-04-13 07:15:26 UTC (rev 259996)
@@ -1,3 +1,26 @@
+2020-04-12  Mark Lam  <[email protected]>
+
+        Enable the ability to build the ASM LLInt for ARMv7k.
+        https://bugs.webkit.org/show_bug.cgi?id=210412
+
+        Reviewed by Sam Weinig.
+
+        Fix the offlineasm so that it can build the ASM LLInt for ARMv7k.  This patch does
+        not actually enable the ASM LLInt.  The ARMv7k port still build the C Loop LLInt.
+
+        Also, the ARMv7k ASM LLInt is still broken and needs additional work before it
+        can run.  This patch only fixes things so that it will build.
+
+        * _javascript_Core.xcodeproj/project.pbxproj:
+        - Added generate_settings_extractor.rb to the project so that we can view it from
+          inside Xcode.
+
+        * offlineasm/arm.rb:
+        - Added support for the globaladdr LLInt instruction for ARMv7k.
+
+        * offlineasm/backends.rb:
+        - Fix the backend to enable ARMV7 also when building for ARMv7k.
+
 2020-04-12  Darin Adler  <[email protected]>
 
         Fix a few mispellings of descendant and propagation

Modified: trunk/Source/_javascript_Core/_javascript_Core.xcodeproj/project.pbxproj (259995 => 259996)


--- trunk/Source/_javascript_Core/_javascript_Core.xcodeproj/project.pbxproj	2020-04-13 06:39:57 UTC (rev 259995)
+++ trunk/Source/_javascript_Core/_javascript_Core.xcodeproj/project.pbxproj	2020-04-13 07:15:26 UTC (rev 259996)
@@ -5091,6 +5091,7 @@
 		FE0D4A051AB8DD0A002F54BF /* ExecutionTimeLimitTest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ExecutionTimeLimitTest.h; path = API/tests/ExecutionTimeLimitTest.h; sourceTree = "<group>"; };
 		FE0D4A071ABA2437002F54BF /* GlobalContextWithFinalizerTest.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = GlobalContextWithFinalizerTest.cpp; path = API/tests/GlobalContextWithFinalizerTest.cpp; sourceTree = "<group>"; };
 		FE0D4A081ABA2437002F54BF /* GlobalContextWithFinalizerTest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GlobalContextWithFinalizerTest.h; path = API/tests/GlobalContextWithFinalizerTest.h; sourceTree = "<group>"; };
+		FE0DA1022429417F00A884A6 /* generate_settings_extractor.rb */ = {isa = PBXFileReference; lastKnownFileType = text.script.ruby; path = generate_settings_extractor.rb; sourceTree = "<group>"; };
 		FE10AAE91F44D510009DEDC5 /* ProbeStack.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ProbeStack.cpp; sourceTree = "<group>"; };
 		FE10AAEA1F44D512009DEDC5 /* ProbeStack.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ProbeStack.h; sourceTree = "<group>"; };
 		FE10AAED1F44D946009DEDC5 /* ProbeContext.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ProbeContext.h; sourceTree = "<group>"; };
@@ -8821,6 +8822,7 @@
 				FEF3475A20362B1E00B7C0EF /* cloop.rb */,
 				FEF3475D20362B1F00B7C0EF /* config.rb */,
 				FEF3476420362B2300B7C0EF /* generate_offset_extractor.rb */,
+				FE0DA1022429417F00A884A6 /* generate_settings_extractor.rb */,
 				FEF3475E20362B1F00B7C0EF /* instructions.rb */,
 				FEF3475C20362B1E00B7C0EF /* mips.rb */,
 				FEF3476120362B2100B7C0EF /* offsets.rb */,

Modified: trunk/Source/_javascript_Core/offlineasm/arm.rb (259995 => 259996)


--- trunk/Source/_javascript_Core/offlineasm/arm.rb	2020-04-13 06:39:57 UTC (rev 259995)
+++ trunk/Source/_javascript_Core/offlineasm/arm.rb	2020-04-13 07:15:26 UTC (rev 259996)
@@ -1,4 +1,4 @@
-# Copyright (C) 2011-2018 Apple Inc. All rights reserved.
+# Copyright (C) 2011-2020 Apple Inc. All rights reserved.
 # Copyright (C) 2013 University of Szeged. All rights reserved.
 #
 # Redistribution and use in source and binary forms, with or without
@@ -671,6 +671,16 @@
             temp = operands[2]
 
             uid = $asm.newUID
+
+            $asm.putStr("#if OS(DARWIN)")
+            $asm.puts "movw #{operands[1].armOperand}, :lower16:(L#{operands[0].asmLabel}_#{uid}$non_lazy_ptr-(L_offlineasm_#{uid}+4))"
+            $asm.puts "movt #{operands[1].armOperand}, :upper16:(L#{operands[0].asmLabel}_#{uid}$non_lazy_ptr-(L_offlineasm_#{uid}+4))"
+            $asm.puts "L_offlineasm_#{uid}:"
+            $asm.puts "add #{operands[1].armOperand}, pc"
+            $asm.puts "ldr #{operands[1].armOperand}, [#{operands[1].armOperand}]"
+
+            # On Linux, use ELF GOT relocation specifiers.
+            $asm.putStr("#elif OS(LINUX)")
             gotLabel = Assembler.localLabelReference("offlineasm_arm_got_#{uid}")
             offsetLabel = Assembler.localLabelReference("offlineasm_arm_got_offset_#{uid}")
 
@@ -680,12 +690,31 @@
             $asm.puts "add #{dest.armOperand}, pc, #{dest.armOperand}"
             $asm.puts "ldr #{dest.armOperand}, [#{dest.armOperand}, #{temp.armOperand}]"
 
+            # Throw a compiler error everywhere else.
+            $asm.putStr("#else")
+            $asm.putStr("#error Missing globaladdr implementation")
+            $asm.putStr("#endif")
+
             offset = 4
 
             $asm.deferNextLabelAction {
+                $asm.putStr("#if OS(DARWIN)")
+                $asm.puts ".section __DATA,__nl_symbol_ptr,non_lazy_symbol_pointers"
+                $asm.puts ".p2align 2"
+
+                $asm.puts "L#{operands[0].asmLabel}_#{uid}$non_lazy_ptr:"
+                $asm.puts ".indirect_symbol #{operands[0].asmLabel}"
+                $asm.puts ".long 0"
+                
+                $asm.puts ".text"
+                $asm.puts ".align 4"
+
+                $asm.putStr("#elif OS(LINUX)")
                 $asm.puts "#{gotLabel}:"
                 $asm.puts ".word _GLOBAL_OFFSET_TABLE_-(#{offsetLabel}+#{offset})"
                 $asm.puts ".word #{labelRef.asmLabel}(GOT)"
+
+                $asm.putStr("#endif")
             }
         else
             lowerDefault

Modified: trunk/Source/_javascript_Core/offlineasm/backends.rb (259995 => 259996)


--- trunk/Source/_javascript_Core/offlineasm/backends.rb	2020-04-13 06:39:57 UTC (rev 259995)
+++ trunk/Source/_javascript_Core/offlineasm/backends.rb	2020-04-13 07:15:26 UTC (rev 259996)
@@ -1,4 +1,4 @@
-# Copyright (C) 2011-2018 Apple Inc. All rights reserved.
+# Copyright (C) 2011-2020 Apple Inc. All rights reserved.
 #
 # Redistribution and use in source and binary forms, with or without
 # modification, are permitted provided that the following conditions
@@ -83,12 +83,12 @@
         | backendName |
         backendName = backendName.upcase
         if backendName =~ /ARM.*/
-            backendName.sub!(/ARMV7(S?)(.*)/) { | _ | 'ARMv7' + $1.downcase + $2 }
+            backendName.sub!(/ARMV7([KS]?)(.*)/) { | _ | 'ARMv7' + $1.downcase + $2 }
             backendName = "ARM64" if backendName == "ARM64_32"
         end
         backendName = "X86" if backendName == "I386"
         newBackendNames << backendName
-        newBackendNames << "ARMv7" if backendName == "ARMv7s"
+        newBackendNames << "ARMv7" if backendName.start_with?("ARMv7")
     }
     newBackendNames.uniq
 end

Modified: trunk/Source/WTF/ChangeLog (259995 => 259996)


--- trunk/Source/WTF/ChangeLog	2020-04-13 06:39:57 UTC (rev 259995)
+++ trunk/Source/WTF/ChangeLog	2020-04-13 07:15:26 UTC (rev 259996)
@@ -1,3 +1,17 @@
+2020-04-12  Mark Lam  <[email protected]>
+
+        Enable the ability to build the ASM LLInt for ARMv7k.
+        https://bugs.webkit.org/show_bug.cgi?id=210412
+
+        Reviewed by Sam Weinig.
+
+        Remove some old code that forces the ENABLE(C_LOOP) to be true if ENABLE(JIT) is
+        false.  These 2 options used to be mutually exclusive, but is no more.  Now, we
+        allow platforms to choose to build the ASM LLInt instead even if ENABLE(JIT) is
+        false.
+
+        * wtf/PlatformEnable.h:
+
 2020-04-12  Darin Adler  <[email protected]>
 
         [Cocoa] Minor tweaks to code to get locale strings to remove one-time-initialization booleans

Modified: trunk/Source/WTF/wtf/PlatformEnable.h (259995 => 259996)


--- trunk/Source/WTF/wtf/PlatformEnable.h	2020-04-13 06:39:57 UTC (rev 259995)
+++ trunk/Source/WTF/wtf/PlatformEnable.h	2020-04-13 07:15:26 UTC (rev 259996)
@@ -576,11 +576,9 @@
 #define ENABLE_JIT 1
 #endif
 #else
-/* Disable JIT and force C_LOOP on all other 32bit architectures. */
+/* Disable JIT on all other 32bit architectures. */
 #undef ENABLE_JIT
 #define ENABLE_JIT 0
-#undef ENABLE_C_LOOP
-#define ENABLE_C_LOOP 1
 #endif
 #endif
 
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to