Title: [292454] trunk/Source/_javascript_Core
Revision
292454
Author
[email protected]
Date
2022-04-06 02:04:59 -0700 (Wed, 06 Apr 2022)

Log Message

[JSC] Nested includes do not change offlineasm hash output
https://bugs.webkit.org/show_bug.cgi?id=237779

Reviewed by Mark Lam.

The Ruby tooling around offlineasm can produce on their output a line containing a
checksum which depends on the input files processed. This is used to avoid redoing
in case the source files have not been changed since the last run. While there is
code to scan the "include" directives in the main input file and take the included
files into account for checksum calculation, included files themselves were not being
further processed for the second or additional levels of "include:. This adds the
missing recursive processing of "include" directives in order to take nested includes
into account.

* offlineasm/parser.rb: Process nested includes recursively for checksum calculation.

Modified Paths

Diff

Modified: trunk/Source/_javascript_Core/ChangeLog (292453 => 292454)


--- trunk/Source/_javascript_Core/ChangeLog	2022-04-06 08:52:13 UTC (rev 292453)
+++ trunk/Source/_javascript_Core/ChangeLog	2022-04-06 09:04:59 UTC (rev 292454)
@@ -1,3 +1,21 @@
+2022-04-06  Adrian Perez de Castro  <[email protected]>
+
+        [JSC] Nested includes do not change offlineasm hash output
+        https://bugs.webkit.org/show_bug.cgi?id=237779
+
+        Reviewed by Mark Lam.
+
+        The Ruby tooling around offlineasm can produce on their output a line containing a
+        checksum which depends on the input files processed. This is used to avoid redoing
+        in case the source files have not been changed since the last run. While there is
+        code to scan the "include" directives in the main input file and take the included
+        files into account for checksum calculation, included files themselves were not being
+        further processed for the second or additional levels of "include:. This adds the
+        missing recursive processing of "include" directives in order to take nested includes
+        into account.
+
+        * offlineasm/parser.rb: Process nested includes recursively for checksum calculation.
+
 2022-04-06  Geza Lore  <[email protected]>
 
         [JSC]Squash alignment warning

Modified: trunk/Source/_javascript_Core/offlineasm/parser.rb (292453 => 292454)


--- trunk/Source/_javascript_Core/offlineasm/parser.rb	2022-04-06 08:52:13 UTC (rev 292453)
+++ trunk/Source/_javascript_Core/offlineasm/parser.rb	2022-04-06 09:04:59 UTC (rev 292454)
@@ -852,7 +852,7 @@
         Sequence.new(firstCodeOrigin, list)
     end
 
-    def parseIncludes(final, comment)
+    def parseIncludes(final, comment, options)
         firstCodeOrigin = @tokens[@idx].codeOrigin
         fileList = []
         fileList << @tokens[@idx].codeOrigin.fileName
@@ -880,7 +880,10 @@
                 end
                 fileExists = File.exists?(fileName)
                 raise "File not found: #{fileName}" if not fileExists and not isOptional
-                fileList << fileName if fileExists
+                if fileExists
+                    parser = Parser.new(readTextFile(fileName), SourceFile.new(fileName), options)
+                    fileList << parser.parseIncludes(nil, "", options)
+                end
             else
                 @idx += 1
             end
@@ -913,7 +916,8 @@
 
 def parseHash(fileName, options)
     parser = Parser.new(readTextFile(fileName), SourceFile.new(fileName), options)
-    fileList = parser.parseIncludes(nil, "")
+    fileList = parser.parseIncludes(nil, "", options)
+    fileList.flatten!
     fileListHash(fileList)
 end
 
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to