Ignore:
Timestamp:
Oct 29, 2020, 2:38:30 PM (5 years ago)
Author:
[email protected]
Message:

JavaScriptCore should support multiple build variants
<https://webkit.org/b/218347>
<rdar://problem/70786057>

Patch by Jérôme Decoodt <[email protected]> on 2020-10-29
Reviewed by Keith Miller.

Update JavaScriptCore to handle BUILD_VARIANTS properly by
passing the value to build phase scripts and handling all
variants set during the build. For engineering builds,
BUILD_VARIANTS=normal.

  • CMakeLists.txt:
  • Update to pass equivalent ${BUILD_VARIANTS} for non-Apple platforms to asm.rb and generate_offset_extractor.rb.

(LLInt Offsets | Generate Derived Sources):
(Offline Assembler | Offline Assemble):

  • Update build phase script to pass "${BUILD_VARIANTS}" as an argument to scripts.
  • offlineasm/asm.rb:
  • Parse BUILD_VARIANTS argument to pass to offsetsAndConfigurationIndexForVariants().
  • offlineasm/generate_offset_extractor.rb:
  • Parse BUILD_VARIANTS argument to pass to configurationIndicesForVariants().
  • offlineasm/offsets.rb:

(offsetsAndConfigurationIndex):

  • Update argument list in comment block.

(offsetsAndConfigurationIndexForVariants): Add.

  • Invoke offsetsAndConfigurationIndex() for each build variant.

(configurationIndices):

  • Update argument list in comment block.

(configurationIndicesForVariants): Add.

  • Invoke configurationIndices() for each build variant.
File:
1 edited

Legend:

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

    r237219 r269171  
    140140
    141141#
    142 # offsetsAndConfigurationIndex(ast, file) ->
     142# offsetsAndConfigurationIndex(file) ->
    143143#     [[offsets, index], ...]
    144144#
     
    183183
    184184#
    185 # configurationIndices(ast, file) ->
     185# offsetsAndConfigurationIndex(file) ->
     186#     [[offsets, index], ...]
     187#
     188# Parses the offsets from a file and all its variants and returns a list of
     189# offsets and the index of the configuration that is valid in this build target.
     190#
     191
     192def offsetsAndConfigurationIndexForVariants(file, variants)
     193    results = []
     194    variants.each {
     195        | current_variant |
     196        suffix = ""
     197        unless current_variant == "normal"
     198            suffix = "_" + current_variant
     199        end
     200        results << offsetsAndConfigurationIndex(file + suffix)
     201    }
     202    return results.flatten(1)
     203end
     204
     205#
     206# configurationIndices(file) ->
    186207#     [[offsets, index], ...]
    187208#
     
    213234
    214235#
     236# configurationIndicesForVariants(file, variants) ->
     237#     [[offsets, index], ...]
     238#
     239# Parses the configurations from a file and all its variants and returns a list
     240# of the indices of the configurations that are valid in this build target.
     241#
     242
     243def configurationIndicesForVariants(file, variants)
     244    results = []
     245    variants.each {
     246        | current_variant |
     247        suffix = ""
     248        unless current_variant == "normal"
     249            suffix = "_" + current_variant
     250        end
     251        results << configurationIndices(file + suffix)
     252    }
     253    return results.flatten(1)
     254end
     255
     256#
    215257# buildOffsetsMap(ast, extractedConstants) -> map
    216258#
Note: See TracChangeset for help on using the changeset viewer.