• Show log

    Commit

  • Hash : 89398b65
    Author : Olli Etuaho
    Date : 2018-03-21T17:30:50

    Avoid mangled name comparisons of 3-parameter functions
    
    The hash values used for looking up built-ins now encode whether the
    mangled name contains arrays, structs or interface blocks in its
    parameters list. This is written in the most significant bit of the
    hash value.
    
    We check this bit at the start of built-in lookup and if the bit is
    set we exit early. After that we know that the lookup name doesn't
    contain array, struct or interface block parameters.
    
    When we find a hash that matches a hash of a built-in function, we now
    know 3 things:
    1) the length of the mangled name matches
    2) the open parentheses in the mangled name matches
    3) the lookup doesn't contain array, struct or block parameters.
    
    Additionally, we have an if statement checking whether the function
    name matches. Collisions are only possible with functions that
    1) have the same name
    2) have the same number of parameters
    
    With these preconditions we can check beforehand whether collisions
    are possible for 3-parameter functions. If there are no collisions, we
    don't need to compare the full mangled name. This is similar to what
    was already being done with functions that had 0 to 2 parameters.
    
    This reduces shader_translator binary size by around 4 KB on Windows.
    
    Besides increased complexity, the tradeoff is that an exhaustive
    search of hash values for possible 3-parameter combinations is costly,
    so the gen_builtin_functions.py code generation script now takes
    around one minute to run on a high-end workstation. Due to this, the
    script now exits early if it detects it has already been run with the
    same inputs based on a hash value stored in
    builtin_symbols_hash_autogen.txt.
    
    BUG=angleproject:2267
    BUG=chromium:823856
    TEST=angle_unittests
    
    Change-Id: I3ff8c6eb85b90d3c4971ac8d73ee171a07a7e55f
    Reviewed-on: https://chromium-review.googlesource.com/973372
    Reviewed-by: Corentin Wallez <cwallez@chromium.org>
    Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
    

  • Properties

  • Git HTTP https://git.kmx.io/kc3-lang/angle.git
    Git SSH git@git.kmx.io:kc3-lang/angle.git
    Public access ? public
    Description

    A conformant OpenGL ES implementation for Windows, Mac, Linux, iOS and Android.

    Homepage

    Github

    Users
    kc3_lang_org thodg_w www_kmx_io thodg_l thodg thodg_m
    Tags