Ignore:
Timestamp:
Aug 19, 2014, 4:25:37 PM (11 years ago)
Author:
[email protected]
Message:

LLInt build should be way faster
https://bugs.webkit.org/show_bug.cgi?id=136085

Reviewed by Geoffrey Garen.

This does three things to improve the LLInt build performance. One of them is only for
Xcode for now while the others should benefit all platforms:

  • Don't exponentially build settings combinations that correspond to being on two backends simultaneously. This is by far the biggest win.


  • Don't generate offset extraction code for backends that aren't supported by the current port. This currently only works on Xcode-based ports. This is a relatively small win.


  • Remove the ALWAYS_ALLOCATE_SLOW option. Each option increases build time, and we haven't used this one in a long time. Anyway, setting this option could be emulated by just directly hacking the code.


This is an enormous speed-up in the LLInt build.

  • JavaScriptCore.xcodeproj/project.pbxproj: Prune the set of backends that we should consider on Xcode-based platforms.
  • llint/LLIntOfflineAsmConfig.h: Remove ALWAYS_ALLOCATE_SLOW
  • llint/LowLevelInterpreter.asm: Remove ALWAYS_ALLOCATE_SLOW
  • offlineasm/backends.rb: Add infrastructure for reasoning about valid backends.
  • offlineasm/generate_offset_extractor.rb: Allow the client to specify a filtered set of valid backends.
  • offlineasm/settings.rb: Improve the construction of settings combinations so that it doesn't traverse the enourmous set of obviously invalid multi-backend combinations. Also glue into support for valid backends.
Location:
trunk/Source/JavaScriptCore/offlineasm
Files:
3 edited

Legend:

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

    r170428 r172777  
    6767
    6868BACKEND_PATTERN = Regexp.new('\\A(' + BACKENDS.join(')|(') + ')\\Z')
     69
     70$allBackends = {}
     71$validBackends = {}
     72BACKENDS.each {
     73    | backend |
     74    $validBackends[backend] = true
     75    $allBackends[backend] = true
     76}
     77
     78def includeOnlyBackends(list)
     79    newValidBackends = {}
     80    list.each {
     81        | backend |
     82        if $validBackends[backend]
     83            newValidBackends[backend] = true
     84        end
     85    }
     86    $validBackends = newValidBackends
     87end
     88
     89def isBackend?(backend)
     90    $allBackends[backend]
     91end
     92
     93def isValidBackend?(backend)
     94    $validBackends[backend]
     95end
     96
     97def validBackends
     98    $validBackends.keys
     99end
    69100
    70101class Node
  • trunk/Source/JavaScriptCore/offlineasm/generate_offset_extractor.rb

    r167094 r172777  
    3939inputFlnm = ARGV.shift
    4040outputFlnm = ARGV.shift
     41
     42validBackends = ARGV.shift
     43if validBackends
     44    $stderr.puts "Only dealing with backends: #{validBackends}"
     45    includeOnlyBackends(validBackends.split(","))
     46end
    4147
    4248$stderr.puts "offlineasm: Parsing #{inputFlnm} and creating offset extractor #{outputFlnm}."
  • trunk/Source/JavaScriptCore/offlineasm/settings.rb

    r170428 r172777  
    5555    end
    5656   
    57     settingsCombinator(settingsCombinations, {}, (ast.filter(Setting).uniq.collect{|v| v.name} + BACKENDS).uniq)
     57    nonBackendSettings = ast.filter(Setting).uniq.collect{ |v| v.name }
     58    nonBackendSettings.delete_if {
     59        | setting |
     60        isBackend? setting
     61    }
     62   
     63    allBackendsFalse = {}
     64    BACKENDS.each {
     65        | backend |
     66        allBackendsFalse[backend] = false
     67    }
     68   
     69    # This will create entries for invalid backends. That's fine. It's necessary
     70    # because it ensures that generate_offsets_extractor (which knows about valid
     71    # backends) has settings indices that are compatible with what asm will see
     72    # (asm doesn't know about valid backends).
     73    BACKENDS.each {
     74        | backend |
     75        map = allBackendsFalse.clone
     76        map[backend] = true
     77        settingsCombinator(settingsCombinations, map, nonBackendSettings)
     78    }
    5879   
    5980    settingsCombinations
     
    7495    BACKENDS.each {
    7596        | backend |
    76         isSupported = concreteSettings[backend]
    77         raise unless isSupported != nil
    78         numClaimedBackends += if isSupported then 1 else 0 end
    79         if isSupported
     97        if concreteSettings[backend]
     98            raise if selectedBackend
    8099            selectedBackend = backend
    81100        end
    82101    }
    83102   
    84     return if numClaimedBackends > 1
     103    return unless isValidBackend? selectedBackend
    85104   
    86105    # Resolve the AST down to a low-level form (no macros or conditionals).
Note: See TracChangeset for help on using the changeset viewer.