Ignore:
Timestamp:
Apr 6, 2022, 2:04:59 AM (3 years ago)
Author:
Adrian Perez de Castro
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.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/offlineasm/parser.rb

    r291142 r292454  
    853853    end
    854854
    855     def parseIncludes(final, comment)
     855    def parseIncludes(final, comment, options)
    856856        firstCodeOrigin = @tokens[@idx].codeOrigin
    857857        fileList = []
     
    881881                fileExists = File.exists?(fileName)
    882882                raise "File not found: #{fileName}" if not fileExists and not isOptional
    883                 fileList << fileName if fileExists
     883                if fileExists
     884                    parser = Parser.new(readTextFile(fileName), SourceFile.new(fileName), options)
     885                    fileList << parser.parseIncludes(nil, "", options)
     886                end
    884887            else
    885888                @idx += 1
     
    914917def parseHash(fileName, options)
    915918    parser = Parser.new(readTextFile(fileName), SourceFile.new(fileName), options)
    916     fileList = parser.parseIncludes(nil, "")
     919    fileList = parser.parseIncludes(nil, "", options)
     920    fileList.flatten!
    917921    fileListHash(fileList)
    918922end
Note: See TracChangeset for help on using the changeset viewer.