LLInt assembly file should be split into 32-bit and 64-bit parts
https://bugs.webkit.org/show_bug.cgi?id=79584
Reviewed by Sam Weinig.
Moved LowLevelInterpreter.asm to LowLevelInterpreter32_64.asm. Gave offlineasm
the ability to include files, and correctly track dependencies: it restricts
the include mechanism to using the same directory as the source file, and uses
the SHA1 hash of all .asm files in that directory as an input hash.
* llint/LLIntOfflineAsmConfig.h:
* llint/LowLevelInterpreter.asm:
* llint/LowLevelInterpreter32_64.asm: Added.
- This is just the entire contents of what was previously LowLevelInterpreter.asm
* llint/LowLevelInterpreter64.asm: Added.
* offlineasm/asm.rb:
* offlineasm/ast.rb:
* offlineasm/generate_offset_extractor.rb:
* offlineasm/parser.rb:
* offlineasm/self_hash.rb:
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@108913 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/Source/JavaScriptCore/offlineasm/self_hash.rb b/Source/JavaScriptCore/offlineasm/self_hash.rb
index a7b51e1..2c300fc 100644
--- a/Source/JavaScriptCore/offlineasm/self_hash.rb
+++ b/Source/JavaScriptCore/offlineasm/self_hash.rb
@@ -25,6 +25,25 @@
require "pathname"
#
+# dirHash(directory, regexp) -> SHA1 hexdigest
+#
+# Returns a hash of all files in the given directory that fit the given
+# pattern.
+#
+
+def dirHash(directory, regexp)
+ directory = Pathname.new(directory)
+ contents = ""
+ Dir.foreach(directory) {
+ | entry |
+ if entry =~ regexp
+ contents += IO::read(directory + entry)
+ end
+ }
+ return Digest::SHA1.hexdigest(contents)
+end
+
+#
# selfHash -> SHA1 hexdigest
#
# Returns a hash of the offlineasm source code. This allows dependency
@@ -33,14 +52,6 @@
#
def selfHash
- contents = ""
- myPath = Pathname.new(__FILE__).dirname
- Dir.foreach(myPath) {
- | entry |
- if entry =~ /\.rb$/
- contents += IO::read(myPath + entry)
- end
- }
- return Digest::SHA1.hexdigest(contents)
+ dirHash(Pathname.new(__FILE__).dirname, /\.rb$/)
end