Changeset 194144 in webkit


Ignore:
Timestamp:
Dec 16, 2015 9:30:49 AM (8 years ago)
Author:
commit-queue@webkit.org
Message:

Builtin source should be minified more
https://bugs.webkit.org/show_bug.cgi?id=152290

Patch by Joseph Pecoraro <Joseph Pecoraro> on 2015-12-16
Reviewed by Darin Adler.

  • Scripts/builtins/builtins_model.py:

(BuiltinFunction.fromString):
Remove primarily empty lines that would just introduce clutter.
We only do the minification in non-Debug configurations, which
is determined by the CONFIGURATION environment variable. You can
see how tests would generate differently, like so:
shell> CONFIGURATION=Release ./Tools/Scripts/run-builtins-generator-tests

Location:
trunk/Source/JavaScriptCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/ChangeLog

    r194141 r194144  
     12015-12-16  Joseph Pecoraro  <pecoraro@apple.com>
     2
     3        Builtin source should be minified more
     4        https://bugs.webkit.org/show_bug.cgi?id=152290
     5
     6        Reviewed by Darin Adler.
     7
     8        * Scripts/builtins/builtins_model.py:
     9        (BuiltinFunction.fromString):
     10        Remove primarily empty lines that would just introduce clutter.
     11        We only do the minification in non-Debug configurations, which
     12        is determined by the CONFIGURATION environment variable. You can
     13        see how tests would generate differently, like so:
     14        shell> CONFIGURATION=Release ./Tools/Scripts/run-builtins-generator-tests
     15
    1162015-12-16  Commit Queue  <commit-queue@webkit.org>
    217
  • trunk/Source/JavaScriptCore/Scripts/builtins/builtins_model.py

    • Property svn:executable set to *
    r192202 r194144  
    5050keyValueAnnotationCommentRegExp = re.compile(r"^\/\/ @(\w+)=([^=]+?)\n", re.MULTILINE | re.S)
    5151flagAnnotationCommentRegExp = re.compile(r"^\/\/ @(\w+)[^=]*?\n", re.MULTILINE | re.S)
     52lineWithOnlySingleLineCommentRegExp = re.compile(r"^\s*\/\/\n", re.MULTILINE | re.S)
     53lineWithTrailingSingleLineCommentRegExp = re.compile(r"\s*\/\/\n", re.MULTILINE | re.S)
     54multipleEmptyLinesRegExp = re.compile(r"\n{2,}", re.MULTILINE | re.S)
    5255
    5356class ParseException(Exception):
     
    101104    def fromString(function_string):
    102105        function_source = multilineCommentRegExp.sub("", function_string)
     106        if os.getenv("CONFIGURATION", "Debug").startswith("Debug"):
     107            function_source = lineWithOnlySingleLineCommentRegExp.sub("", function_source)
     108            function_source = lineWithTrailingSingleLineCommentRegExp.sub("\n", function_source)
     109            function_source = multipleEmptyLinesRegExp.sub("\n", function_source)
     110
    103111        function_name = functionNameRegExp.findall(function_source)[0]
    104112        is_constructor = functionIsConstructorRegExp.match(function_source) != None
Note: See TracChangeset for help on using the changeset viewer.