Changeset 237219 in webkit


Ignore:
Timestamp:
Oct 17, 2018 7:10:44 AM (6 years ago)
Author:
keith_miller@apple.com
Message:

Unreviewed revert Fujii's revert in r237214 with new WinCairo build fix.

Location:
trunk/Source/JavaScriptCore
Files:
2 added
8 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/CMakeLists.txt

    r237214 r237219  
    239239
    240240add_custom_command(
     241    OUTPUT ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/LLIntDesiredSettings.h
     242    MAIN_DEPENDENCY ${JAVASCRIPTCORE_DIR}/offlineasm/generate_settings_extractor.rb
     243    DEPENDS ${LLINT_ASM} ${OFFLINE_ASM} ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/InitBytecodes.asm
     244    COMMAND ${RUBY_EXECUTABLE} ${JAVASCRIPTCORE_DIR}/offlineasm/generate_settings_extractor.rb -I${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/ ${JAVASCRIPTCORE_DIR}/llint/LowLevelInterpreter.asm ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/LLIntDesiredSettings.h ${OFFLINE_ASM_BACKEND}
     245    VERBATIM)
     246
     247add_custom_command(
    241248    OUTPUT ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/LLIntDesiredOffsets.h
    242249    MAIN_DEPENDENCY ${JAVASCRIPTCORE_DIR}/offlineasm/generate_offset_extractor.rb
    243     DEPENDS ${LLINT_ASM} ${OFFLINE_ASM} ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/InitBytecodes.asm
    244     COMMAND ${RUBY_EXECUTABLE} ${JAVASCRIPTCORE_DIR}/offlineasm/generate_offset_extractor.rb -I${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/ ${JAVASCRIPTCORE_DIR}/llint/LowLevelInterpreter.asm ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/LLIntDesiredOffsets.h ${OFFLINE_ASM_BACKEND}
     250    DEPENDS LLIntSettingsExtractor ${LLINT_ASM} ${OFFLINE_ASM} ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/InitBytecodes.asm
     251    COMMAND ${RUBY_EXECUTABLE} ${JAVASCRIPTCORE_DIR}/offlineasm/generate_offset_extractor.rb -I${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/ ${JAVASCRIPTCORE_DIR}/llint/LowLevelInterpreter.asm $<TARGET_FILE:LLIntSettingsExtractor> ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/LLIntDesiredOffsets.h ${OFFLINE_ASM_BACKEND}
    245252    VERBATIM)
    246253
     
    254261# dependency of both LLIntOffsetsExtractor and LLIntOffsetsExtractor.cpp, so the command will
    255262# actually be run multiple times!
     263add_executable(LLIntSettingsExtractor
     264    ${JAVASCRIPTCORE_DIR}/llint/LLIntSettingsExtractor.cpp
     265    ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/LLIntDesiredSettings.h ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/Bytecodes.h ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/BytecodeStructs.h
     266)
     267
    256268add_executable(LLIntOffsetsExtractor
    257269    ${JAVASCRIPTCORE_DIR}/llint/LLIntOffsetsExtractor.cpp
    258270    ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/LLIntDesiredOffsets.h ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/Bytecodes.h ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/BytecodeStructs.h
    259271)
     272
     273target_link_libraries(LLIntSettingsExtractor WTF)
     274add_dependencies(LLIntSettingsExtractor JavaScriptCoreForwardingHeaders)
    260275target_link_libraries(LLIntOffsetsExtractor WTF)
    261276add_dependencies(LLIntOffsetsExtractor JavaScriptCoreForwardingHeaders)
     
    12201235)
    12211236
     1237target_include_directories(LLIntSettingsExtractor PRIVATE
     1238    ${JavaScriptCore_INCLUDE_DIRECTORIES}
     1239    ${JavaScriptCore_PRIVATE_INCLUDE_DIRECTORIES}
     1240)
     1241target_include_directories(LLIntSettingsExtractor SYSTEM PRIVATE ${JavaScriptCore_SYSTEM_INCLUDE_DIRECTORIES})
     1242
    12221243target_include_directories(LLIntOffsetsExtractor PRIVATE
    12231244    ${JavaScriptCore_INCLUDE_DIRECTORIES}
  • trunk/Source/JavaScriptCore/ChangeLog

    r237215 r237219  
     12018-10-17  Keith Miller  <keith_miller@apple.com>
     2
     3        Unreviewed revert Fujii's revert in r237214 with new WinCairo build fix.
     4
    152018-10-16  Mark Lam  <mark.lam@apple.com>
    26
  • trunk/Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj

    r237214 r237219  
    1616                        dependencies = (
    1717                                65442D5018EBB744007AF92F /* PBXTargetDependency */,
     18                                14BD68992151916D0050DAFF /* PBXTargetDependency */,
    1819                        );
    1920                        name = "LLInt Offsets";
     21                        productName = "Derived Sources";
     22                };
     23                14BD688F215191450050DAFF /* LLInt Settings */ = {
     24                        isa = PBXAggregateTarget;
     25                        buildConfigurationList = 14BD6893215191450050DAFF /* Build configuration list for PBXAggregateTarget "LLInt Settings" */;
     26                        buildPhases = (
     27                                14BD6892215191450050DAFF /* Generate Derived Sources */,
     28                        );
     29                        dependencies = (
     30                                14BD6890215191450050DAFF /* PBXTargetDependency */,
     31                        );
     32                        name = "LLInt Settings";
    2033                        productName = "Derived Sources";
    2134                };
     
    799812                14BA7A9813AADFF8005B7C2C /* Heap.h in Headers */ = {isa = PBXBuildFile; fileRef = 14BA7A9613AADFF8005B7C2C /* Heap.h */; settings = {ATTRIBUTES = (Private, ); }; };
    800813                14BD59C50A3E8F9F00BAF59C /* JavaScriptCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 932F5BD90822A1C700736975 /* JavaScriptCore.framework */; };
     814                14BD689D215191C10050DAFF /* LLIntSettingsExtractor.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 14BD689C215191B30050DAFF /* LLIntSettingsExtractor.cpp */; };
    801815                14BE7D3317135CF400D1807A /* WeakInlines.h in Headers */ = {isa = PBXBuildFile; fileRef = 14BE7D3217135CF400D1807A /* WeakInlines.h */; settings = {ATTRIBUTES = (Private, ); }; };
    802816                14BFCE6910CDB1FC00364CCE /* WeakGCMap.h in Headers */ = {isa = PBXBuildFile; fileRef = 14BFCE6810CDB1FC00364CCE /* WeakGCMap.h */; settings = {ATTRIBUTES = (Private, ); }; };
     
    18461860                        remoteGlobalIDString = 0F4680A914BA7FD900BFE272;
    18471861                        remoteInfo = "LLInt Offsets";
     1862                };
     1863                14BD6883215191310050DAFF /* PBXContainerItemProxy */ = {
     1864                        isa = PBXContainerItemProxy;
     1865                        containerPortal = 0867D690FE84028FC02AAC07 /* Project object */;
     1866                        proxyType = 1;
     1867                        remoteGlobalIDString = 65FB3F6609D11E9100F49DEB;
     1868                        remoteInfo = "Derived Sources";
     1869                };
     1870                14BD6891215191450050DAFF /* PBXContainerItemProxy */ = {
     1871                        isa = PBXContainerItemProxy;
     1872                        containerPortal = 0867D690FE84028FC02AAC07 /* Project object */;
     1873                        proxyType = 1;
     1874                        remoteGlobalIDString = 65FB3F6609D11E9100F49DEB;
     1875                        remoteInfo = "Derived Sources";
     1876                };
     1877                14BD68982151916D0050DAFF /* PBXContainerItemProxy */ = {
     1878                        isa = PBXContainerItemProxy;
     1879                        containerPortal = 0867D690FE84028FC02AAC07 /* Project object */;
     1880                        proxyType = 1;
     1881                        remoteGlobalIDString = 14BD6881215191310050DAFF;
     1882                        remoteInfo = JSCLLIntSettingsExtractor;
     1883                };
     1884                14BD689A215191740050DAFF /* PBXContainerItemProxy */ = {
     1885                        isa = PBXContainerItemProxy;
     1886                        containerPortal = 0867D690FE84028FC02AAC07 /* Project object */;
     1887                        proxyType = 1;
     1888                        remoteGlobalIDString = 14BD688F215191450050DAFF;
     1889                        remoteInfo = "LLInt Settings";
    18481890                };
    18491891                53B4BD131F68C2AA00D2BEA3 /* PBXContainerItemProxy */ = {
     
    31813223                14BD5A2B0A3E91F600BAF59C /* JSValueRef.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = JSValueRef.cpp; sourceTree = "<group>"; };
    31823224                14BD5A2D0A3E91F600BAF59C /* testapi.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = testapi.c; path = API/tests/testapi.c; sourceTree = "<group>"; };
     3225                14BD688E215191310050DAFF /* JSCLLIntSettingsExtractor */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = JSCLLIntSettingsExtractor; sourceTree = BUILT_PRODUCTS_DIR; };
     3226                14BD689C215191B30050DAFF /* LLIntSettingsExtractor.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = LLIntSettingsExtractor.cpp; path = llint/LLIntSettingsExtractor.cpp; sourceTree = "<group>"; };
    31833227                14BE7D3217135CF400D1807A /* WeakInlines.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WeakInlines.h; sourceTree = "<group>"; };
    31843228                14BFCE6810CDB1FC00364CCE /* WeakGCMap.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WeakGCMap.h; sourceTree = "<group>"; };
     
    35343578                5D5D8AD00E0D0EBE00F9C692 /* libedit.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libedit.dylib; path = /usr/lib/libedit.dylib; sourceTree = "<absolute>"; };
    35353579                5DAFD6CB146B686300FBEFB4 /* JSC.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = JSC.xcconfig; sourceTree = "<group>"; };
    3536                 5DDDF44614FEE72200B4FB4D /* LLIntDesiredOffsets.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = LLIntDesiredOffsets.h; path = LLIntOffsets/LLIntDesiredOffsets.h; sourceTree = BUILT_PRODUCTS_DIR; };
    35373580                5DE3D0F40DD8DDFB00468714 /* WebKitAvailability.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebKitAvailability.h; sourceTree = "<group>"; };
    35383581                623A37EB1B87A7BD00754209 /* RegisterMap.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RegisterMap.h; sourceTree = "<group>"; };
     
    48714914                        runOnlyForDeploymentPostprocessing = 0;
    48724915                };
     4916                14BD6888215191310050DAFF /* Frameworks */ = {
     4917                        isa = PBXFrameworksBuildPhase;
     4918                        buildActionMask = 2147483647;
     4919                        files = (
     4920                        );
     4921                        runOnlyForDeploymentPostprocessing = 0;
     4922                };
    48734923                651122FC14046A4C002B101D /* Frameworks */ = {
    48744924                        isa = PBXFrameworksBuildPhase;
     
    49304980                                932F5BE10822A1C700736975 /* jsc */,
    49314981                                0FF922CF14F46B130041A24E /* JSCLLIntOffsetsExtractor */,
     4982                                14BD688E215191310050DAFF /* JSCLLIntSettingsExtractor */,
    49324983                                141211200A48793C00480255 /* minidom */,
    49334984                                0F6183431C45F62A0072450B /* testair */,
     
    50215072                                0F4680CE14BBB3D100BFE272 /* LLIntData.cpp */,
    50225073                                0F4680CF14BBB3D100BFE272 /* LLIntData.h */,
    5023                                 5DDDF44614FEE72200B4FB4D /* LLIntDesiredOffsets.h */,
    50245074                                0F38B00F17CF077F00B144D3 /* LLIntEntrypoint.cpp */,
    50255075                                0F38B01017CF077F00B144D3 /* LLIntEntrypoint.h */,
     
    50305080                                FED287B115EC9A5700DA8161 /* LLIntOpcode.h */,
    50315081                                79CFC6EF1C33B10000C768EA /* LLIntPCRanges.h */,
     5082                                14BD689C215191B30050DAFF /* LLIntSettingsExtractor.cpp */,
    50325083                                0F46809F14BA7F8200BFE272 /* LLIntSlowPaths.cpp */,
    50335084                                0F4680A014BA7F8200BFE272 /* LLIntSlowPaths.h */,
     
    98089859                        productType = "com.apple.product-type.tool";
    98099860                };
     9861                14BD6881215191310050DAFF /* JSCLLIntSettingsExtractor */ = {
     9862                        isa = PBXNativeTarget;
     9863                        buildConfigurationList = 14BD6889215191310050DAFF /* Build configuration list for PBXNativeTarget "JSCLLIntSettingsExtractor" */;
     9864                        buildPhases = (
     9865                                14BD6886215191310050DAFF /* Sources */,
     9866                                14BD6888215191310050DAFF /* Frameworks */,
     9867                        );
     9868                        buildRules = (
     9869                        );
     9870                        dependencies = (
     9871                                14BD6882215191310050DAFF /* PBXTargetDependency */,
     9872                                14BD689B215191740050DAFF /* PBXTargetDependency */,
     9873                        );
     9874                        name = JSCLLIntSettingsExtractor;
     9875                        productInstallPath = /usr/local/bin;
     9876                        productName = jsc;
     9877                        productReference = 14BD688E215191310050DAFF /* JSCLLIntSettingsExtractor */;
     9878                        productType = "com.apple.product-type.tool";
     9879                };
    98109880                651122F714046A4C002B101D /* testRegExp */ = {
    98119881                        isa = PBXNativeTarget;
     
    993010000                                932F5BE30822A1C700736975 /* All */,
    993110001                                932F5B3E0822A1C700736975 /* JavaScriptCore */,
     10002                                65FB3F6609D11E9100F49DEB /* Derived Sources */,
     10003                                14BD688F215191450050DAFF /* LLInt Settings */,
     10004                                14BD6881215191310050DAFF /* JSCLLIntSettingsExtractor */,
    993210005                                0F4680A914BA7FD900BFE272 /* LLInt Offsets */,
    9933                                 65FB3F6609D11E9100F49DEB /* Derived Sources */,
    993410006                                0FF922C314F46B130041A24E /* JSCLLIntOffsetsExtractor */,
    993510007                                65788A9D18B409EB00C189FF /* Offline Assembler */,
     
    997310045                        runOnlyForDeploymentPostprocessing = 0;
    997410046                        shellPath = /bin/sh;
    9975                         shellScript = "set -e\n\nmkdir -p \"${BUILT_PRODUCTS_DIR}/LLIntOffsets/${ARCHS}\"\n\n/usr/bin/env ruby \"${SRCROOT}/offlineasm/generate_offset_extractor.rb\" \"-I${BUILT_PRODUCTS_DIR}/DerivedSources/JavaScriptCore\" \"${SRCROOT}/llint/LowLevelInterpreter.asm\" \"${BUILT_PRODUCTS_DIR}/LLIntOffsets/${ARCHS}/LLIntDesiredOffsets.h\" \"${ARCHS} C_LOOP\"\n";
     10047                        shellScript = "set -e\n\nmkdir -p \"${BUILT_PRODUCTS_DIR}/LLIntOffsets/${ARCHS}\"\n\n/usr/bin/env ruby \"${SRCROOT}/offlineasm/generate_offset_extractor.rb\" \"-I${BUILT_PRODUCTS_DIR}/DerivedSources/JavaScriptCore\" \"${SRCROOT}/llint/LowLevelInterpreter.asm\"  \"${BUILT_PRODUCTS_DIR}/JSCLLIntSettingsExtractor\" \"${BUILT_PRODUCTS_DIR}/LLIntOffsets/${ARCHS}/LLIntDesiredOffsets.h\" \"${ARCHS} C_LOOP\"\n";
     10048                };
     10049                14BD6892215191450050DAFF /* Generate Derived Sources */ = {
     10050                        isa = PBXShellScriptBuildPhase;
     10051                        buildActionMask = 2147483647;
     10052                        files = (
     10053                        );
     10054                        inputPaths = (
     10055                        );
     10056                        name = "Generate Derived Sources";
     10057                        outputPaths = (
     10058                        );
     10059                        runOnlyForDeploymentPostprocessing = 0;
     10060                        shellPath = /bin/sh;
     10061                        shellScript = "set -e\n\nmkdir -p \"${BUILT_PRODUCTS_DIR}/LLIntOffsets/${ARCHS}\"\n\n/usr/bin/env ruby \"${SRCROOT}/offlineasm/generate_settings_extractor.rb\" \"-I${BUILT_PRODUCTS_DIR}/DerivedSources/JavaScriptCore\" \"${SRCROOT}/llint/LowLevelInterpreter.asm\" \"${BUILT_PRODUCTS_DIR}/LLIntOffsets/${ARCHS}/LLIntDesiredSettings.h\" \"${ARCHS} C_LOOP\"\n";
    997610062                };
    997710063                1A02D9A81B34A882000D1522 /* Add Symlink in /System/Library/PrivateFrameworks */ = {
     
    1024410330                                86D2221A167EF9440024C804 /* testapi.mm in Sources */,
    1024510331                                534902851C7276B70012BCB8 /* TypedArrayCTest.cpp in Sources */,
     10332                        );
     10333                        runOnlyForDeploymentPostprocessing = 0;
     10334                };
     10335                14BD6886215191310050DAFF /* Sources */ = {
     10336                        isa = PBXSourcesBuildPhase;
     10337                        buildActionMask = 2147483647;
     10338                        files = (
     10339                                14BD689D215191C10050DAFF /* LLIntSettingsExtractor.cpp in Sources */,
    1024610340                        );
    1024710341                        runOnlyForDeploymentPostprocessing = 0;
     
    1047110565                        targetProxy = 0FF922D214F46B2F0041A24E /* PBXContainerItemProxy */;
    1047210566                };
     10567                14BD6882215191310050DAFF /* PBXTargetDependency */ = {
     10568                        isa = PBXTargetDependency;
     10569                        target = 65FB3F6609D11E9100F49DEB /* Derived Sources */;
     10570                        targetProxy = 14BD6883215191310050DAFF /* PBXContainerItemProxy */;
     10571                };
     10572                14BD6890215191450050DAFF /* PBXTargetDependency */ = {
     10573                        isa = PBXTargetDependency;
     10574                        target = 65FB3F6609D11E9100F49DEB /* Derived Sources */;
     10575                        targetProxy = 14BD6891215191450050DAFF /* PBXContainerItemProxy */;
     10576                };
     10577                14BD68992151916D0050DAFF /* PBXTargetDependency */ = {
     10578                        isa = PBXTargetDependency;
     10579                        target = 14BD6881215191310050DAFF /* JSCLLIntSettingsExtractor */;
     10580                        targetProxy = 14BD68982151916D0050DAFF /* PBXContainerItemProxy */;
     10581                };
     10582                14BD689B215191740050DAFF /* PBXTargetDependency */ = {
     10583                        isa = PBXTargetDependency;
     10584                        target = 14BD688F215191450050DAFF /* LLInt Settings */;
     10585                        targetProxy = 14BD689A215191740050DAFF /* PBXContainerItemProxy */;
     10586                };
    1047310587                53B4BD141F68C2AA00D2BEA3 /* PBXTargetDependency */ = {
    1047410588                        isa = PBXTargetDependency;
     
    1085710971                        name = Production;
    1085810972                };
     10973                14BD688A215191310050DAFF /* Debug */ = {
     10974                        isa = XCBuildConfiguration;
     10975                        baseConfigurationReference = BC021BF2136900C300FC5467 /* ToolExecutable.xcconfig */;
     10976                        buildSettings = {
     10977                                HEADER_SEARCH_PATHS = (
     10978                                        "\"${BUILT_PRODUCTS_DIR}/DerivedSources/JavaScriptCore\"",
     10979                                        "\"${BUILT_PRODUCTS_DIR}/LLIntOffsets/${ARCHS}\"",
     10980                                        "\"$(JAVASCRIPTCORE_FRAMEWORKS_DIR)/JavaScriptCore.framework/PrivateHeaders\"",
     10981                                        "$(inherited)",
     10982                                );
     10983                                PRODUCT_NAME = "$(TARGET_NAME)";
     10984                        };
     10985                        name = Debug;
     10986                };
     10987                14BD688B215191310050DAFF /* Release */ = {
     10988                        isa = XCBuildConfiguration;
     10989                        baseConfigurationReference = BC021BF2136900C300FC5467 /* ToolExecutable.xcconfig */;
     10990                        buildSettings = {
     10991                                HEADER_SEARCH_PATHS = (
     10992                                        "\"${BUILT_PRODUCTS_DIR}/DerivedSources/JavaScriptCore\"",
     10993                                        "\"${BUILT_PRODUCTS_DIR}/LLIntOffsets/${ARCHS}\"",
     10994                                        "\"$(JAVASCRIPTCORE_FRAMEWORKS_DIR)/JavaScriptCore.framework/PrivateHeaders\"",
     10995                                        "$(inherited)",
     10996                                );
     10997                                PRODUCT_NAME = "$(TARGET_NAME)";
     10998                        };
     10999                        name = Release;
     11000                };
     11001                14BD688C215191310050DAFF /* Profiling */ = {
     11002                        isa = XCBuildConfiguration;
     11003                        baseConfigurationReference = BC021BF2136900C300FC5467 /* ToolExecutable.xcconfig */;
     11004                        buildSettings = {
     11005                                HEADER_SEARCH_PATHS = (
     11006                                        "\"${BUILT_PRODUCTS_DIR}/DerivedSources/JavaScriptCore\"",
     11007                                        "\"${BUILT_PRODUCTS_DIR}/LLIntOffsets/${ARCHS}\"",
     11008                                        "\"$(JAVASCRIPTCORE_FRAMEWORKS_DIR)/JavaScriptCore.framework/PrivateHeaders\"",
     11009                                        "$(inherited)",
     11010                                );
     11011                                PRODUCT_NAME = "$(TARGET_NAME)";
     11012                        };
     11013                        name = Profiling;
     11014                };
     11015                14BD688D215191310050DAFF /* Production */ = {
     11016                        isa = XCBuildConfiguration;
     11017                        baseConfigurationReference = BC021BF2136900C300FC5467 /* ToolExecutable.xcconfig */;
     11018                        buildSettings = {
     11019                                HEADER_SEARCH_PATHS = (
     11020                                        "\"${BUILT_PRODUCTS_DIR}/DerivedSources/JavaScriptCore\"",
     11021                                        "\"${BUILT_PRODUCTS_DIR}/LLIntOffsets/${ARCHS}\"",
     11022                                        "\"$(JAVASCRIPTCORE_FRAMEWORKS_DIR)/JavaScriptCore.framework/PrivateHeaders\"",
     11023                                        "$(inherited)",
     11024                                );
     11025                                PRODUCT_NAME = "$(TARGET_NAME)";
     11026                        };
     11027                        name = Production;
     11028                };
     11029                14BD6894215191450050DAFF /* Debug */ = {
     11030                        isa = XCBuildConfiguration;
     11031                        buildSettings = {
     11032                                PRODUCT_NAME = "$(TARGET_NAME)";
     11033                        };
     11034                        name = Debug;
     11035                };
     11036                14BD6895215191450050DAFF /* Release */ = {
     11037                        isa = XCBuildConfiguration;
     11038                        buildSettings = {
     11039                                PRODUCT_NAME = "$(TARGET_NAME)";
     11040                        };
     11041                        name = Release;
     11042                };
     11043                14BD6896215191450050DAFF /* Profiling */ = {
     11044                        isa = XCBuildConfiguration;
     11045                        buildSettings = {
     11046                                PRODUCT_NAME = "$(TARGET_NAME)";
     11047                        };
     11048                        name = Profiling;
     11049                };
     11050                14BD6897215191450050DAFF /* Production */ = {
     11051                        isa = XCBuildConfiguration;
     11052                        buildSettings = {
     11053                                PRODUCT_NAME = "$(TARGET_NAME)";
     11054                        };
     11055                        name = Production;
     11056                };
    1085911057                53B4BD0B1F68AF8900D2BEA3 /* Debug */ = {
    1086011058                        isa = XCBuildConfiguration;
     
    1124411442                        defaultConfigurationName = Production;
    1124511443                };
     11444                14BD6889215191310050DAFF /* Build configuration list for PBXNativeTarget "JSCLLIntSettingsExtractor" */ = {
     11445                        isa = XCConfigurationList;
     11446                        buildConfigurations = (
     11447                                14BD688A215191310050DAFF /* Debug */,
     11448                                14BD688B215191310050DAFF /* Release */,
     11449                                14BD688C215191310050DAFF /* Profiling */,
     11450                                14BD688D215191310050DAFF /* Production */,
     11451                        );
     11452                        defaultConfigurationIsVisible = 0;
     11453                        defaultConfigurationName = Production;
     11454                };
     11455                14BD6893215191450050DAFF /* Build configuration list for PBXAggregateTarget "LLInt Settings" */ = {
     11456                        isa = XCConfigurationList;
     11457                        buildConfigurations = (
     11458                                14BD6894215191450050DAFF /* Debug */,
     11459                                14BD6895215191450050DAFF /* Release */,
     11460                                14BD6896215191450050DAFF /* Profiling */,
     11461                                14BD6897215191450050DAFF /* Production */,
     11462                        );
     11463                        defaultConfigurationIsVisible = 0;
     11464                        defaultConfigurationName = Production;
     11465                };
    1124611466                53B4BD0A1F68AF8900D2BEA3 /* Build configuration list for PBXAggregateTarget "Generate Unified Sources" */ = {
    1124711467                        isa = XCConfigurationList;
  • trunk/Source/JavaScriptCore/assembler/Printer.h

    r237214 r237219  
    2626#pragma once
    2727
     28#include "CPU.h"
     29
    2830#include <wtf/PrintStream.h>
    2931#include <wtf/StringPrintStream.h>
  • trunk/Source/JavaScriptCore/llint/LLIntOffsetsExtractor.cpp

    r237214 r237219  
    6161#include "ValueProfile.h"
    6262#include "Watchdog.h"
     63#include <stdio.h>
    6364#include <wtf/text/StringImpl.h>
    6465
     
    8182// compiler to kindly step aside and yield to our best intentions.
    8283#include "LLIntDesiredOffsets.h"
    83     return extractorTable;
     84    return offsetExtractorTable;
    8485}
    8586
  • trunk/Source/JavaScriptCore/offlineasm/generate_offset_extractor.rb

    r237214 r237219  
    11#!/usr/bin/env ruby
    22
    3 # Copyright (C) 2011 Apple Inc. All rights reserved.
     3# Copyright (C) 2011-2018 Apple Inc. All rights reserved.
    44#
    55# Redistribution and use in source and binary forms, with or without
     
    3838
    3939inputFlnm = ARGV.shift
     40settingsFlnm = ARGV.shift
    4041outputFlnm = ARGV.shift
    4142
    4243validBackends = canonicalizeBackendNames(ARGV.shift.split(/[,\s]+/))
    4344includeOnlyBackends(validBackends)
     45
     46begin
     47    configurationList = configurationIndices(settingsFlnm)
     48rescue MissingMagicValuesException
     49    $stderr.puts "OffsetExtractor: No magic values found. Skipping offsets extractor file generation."
     50    exit 1
     51end
    4452
    4553def emitMagicNumber
     
    5058end
    5159
    52 inputHash = "// offlineasm input hash: #{parseHash(inputFlnm)} #{selfHash}"
     60configurationHash = Digest::SHA1.hexdigest(configurationList.join(' '))
     61inputHash = "// OffsetExtractor input hash: #{parseHash(inputFlnm)} #{configurationHash} #{selfHash}"
    5362
    5463if FileTest.exist? outputFlnm
     
    5766        firstLine = inp.gets
    5867        if firstLine and firstLine.chomp == inputHash
    59             $stderr.puts "offlineasm: Nothing changed."
     68            $stderr.puts "OffsetExtractor: Nothing changed."
    6069            exit 0
    6170        end
     
    6372end
    6473
    65 originalAST = parse(inputFlnm)
    66 
    67 #
    68 # Optimize the AST to make configuration extraction faster. This reduces the AST to a form
    69 # that only contains the things that matter for our purposes: offsets, sizes, and if
    70 # statements.
    71 #
    72 
    73 class Node
    74     def offsetsPruneTo(sequence)
    75         children.each {
    76             | child |
    77             child.offsetsPruneTo(sequence)
    78         }
    79     end
    80    
    81     def offsetsPrune
    82         result = Sequence.new(codeOrigin, [])
    83         offsetsPruneTo(result)
    84         result
    85     end
    86 end
    87 
    88 class IfThenElse
    89     def offsetsPruneTo(sequence)
    90         ifThenElse = IfThenElse.new(codeOrigin, predicate, thenCase.offsetsPrune)
    91         ifThenElse.elseCase = elseCase.offsetsPrune
    92         sequence.list << ifThenElse
    93     end
    94 end
    95 
    96 class StructOffset
    97     def offsetsPruneTo(sequence)
    98         sequence.list << self
    99     end
    100 end
    101 
    102 class Sizeof
    103     def offsetsPruneTo(sequence)
    104         sequence.list << self
    105     end
    106 end
    107 
    108 class ConstExpr
    109     def offsetsPruneTo(sequence)
    110         sequence.list << self
    111     end
    112 end
    113 
    114 prunedAST = originalAST.offsetsPrune
     74ast = parse(inputFlnm)
     75settingsCombinations = computeSettingsCombinations(ast)
    11576
    11677File.open(outputFlnm, "w") {
     
    11879    $output = outp
    11980    outp.puts inputHash
    120     length = 0
    12181
    122     emitCodeInAllConfigurations(prunedAST) {
    123         | settings, ast, backend, index |
    124         constsList = ast.filter(ConstExpr).uniq.sort
     82    configurationList.each {
     83        | configIndex |
     84        forSettings(settingsCombinations[configIndex], ast) {
     85            | concreteSettings, lowLevelAST, backend |
    12586
    126         constsList.each_with_index {
    127             | const, index |
    128             outp.puts "constexpr int64_t constValue#{index} = static_cast<int64_t>(#{const.value});"
     87            offsetsList = offsetsList(lowLevelAST)
     88            sizesList = sizesList(lowLevelAST)
     89            constsList = constsList(lowLevelAST)
     90
     91            emitCodeInConfiguration(concreteSettings, lowLevelAST, backend) {
     92                constsList.each_with_index {
     93                    | const, index |
     94                    outp.puts "constexpr int64_t constValue#{index} = static_cast<int64_t>(#{const.value});"
     95                }
     96                outp.puts "static const int64_t offsetExtractorTable[] = {"
     97                OFFSET_HEADER_MAGIC_NUMBERS.each {
     98                    | number |
     99                    outp.puts "unsigned(#{number}),"
     100                }
     101
     102                emitMagicNumber
     103                outp.puts "#{configIndex},"
     104                offsetsList.each {
     105                    | offset |
     106                    emitMagicNumber
     107                    outp.puts "OFFLINE_ASM_OFFSETOF(#{offset.struct}, #{offset.field}),"
     108                }
     109                sizesList.each {
     110                    | sizeof |
     111                    emitMagicNumber
     112                    outp.puts "sizeof(#{sizeof.struct}),"
     113                }
     114                constsList.each_with_index {
     115                    | const, index |
     116                    emitMagicNumber
     117                    outp.puts "constValue#{index},"
     118                }
     119                outp.puts "};"
     120            }
    129121        }
    130122    }
    131123
    132     emitCodeInAllConfigurations(prunedAST) {
    133         | settings, ast, backend, index |
    134         offsetsList = ast.filter(StructOffset).uniq.sort
    135         sizesList = ast.filter(Sizeof).uniq.sort
    136         constsList = ast.filter(ConstExpr).uniq.sort
    137         length += OFFSET_HEADER_MAGIC_NUMBERS.size + (OFFSET_MAGIC_NUMBERS.size + 1) * (1 + offsetsList.size + sizesList.size + constsList.size)
    138     }
    139     outp.puts "static const int64_t extractorTable[#{length}] = {"
    140     emitCodeInAllConfigurations(prunedAST) {
    141         | settings, ast, backend, index |
    142         OFFSET_HEADER_MAGIC_NUMBERS.each {
    143             | number |
    144             $output.puts "unsigned(#{number}),"
    145         }
    146 
    147         offsetsList = ast.filter(StructOffset).uniq.sort
    148         sizesList = ast.filter(Sizeof).uniq.sort
    149         constsList = ast.filter(ConstExpr).uniq.sort
    150 
    151         emitMagicNumber
    152         outp.puts "#{index},"
    153         offsetsList.each {
    154             | offset |
    155             emitMagicNumber
    156             outp.puts "OFFLINE_ASM_OFFSETOF(#{offset.struct}, #{offset.field}),"
    157         }
    158         sizesList.each {
    159             | sizeof |
    160             emitMagicNumber
    161             outp.puts "sizeof(#{sizeof.struct}),"
    162         }
    163         constsList.each_index {
    164             | index |
    165             emitMagicNumber
    166             outp.puts "constValue#{index},"
    167         }
    168     }
    169     outp.puts "};"
    170 
    171124}
  • trunk/Source/JavaScriptCore/offlineasm/offsets.rb

    r237214 r237219  
    5757end
    5858
    59 #
    60 # offsetsAndConfigurationIndex(ast, file) ->
    61 #     [[offsets, index], ...]
    62 #
    63 # Parses the offsets from a file and returns a list of offsets and the
    64 # index of the configuration that is valid in this build target.
    65 #
    66 
    67 def offsetsAndConfigurationIndex(file)
    68     endiannessMarkerBytes = nil
    69     result = {}
    70    
    71     def readInt(endianness, bytes)
    72         if endianness == :little
    73             # Little endian
    74             number = (bytes[0] << 0  |
    75                       bytes[1] << 8  |
    76                       bytes[2] << 16 |
    77                       bytes[3] << 24 |
    78                       bytes[4] << 32 |
    79                       bytes[5] << 40 |
    80                       bytes[6] << 48 |
    81                       bytes[7] << 56)
    82         else
    83             # Big endian
    84             number = (bytes[0] << 56 |
    85                       bytes[1] << 48 |
    86                       bytes[2] << 40 |
    87                       bytes[3] << 32 |
    88                       bytes[4] << 24 |
    89                       bytes[5] << 16 |
    90                       bytes[6] << 8  |
    91                       bytes[7] << 0)
    92         end
    93         if number > 0x7fffffff_ffffffff
    94             number -= 1 << 64
    95         end
    96         number
     59def readInt(endianness, bytes)
     60    if endianness == :little
     61        # Little endian
     62        number = (bytes[0] << 0  |
     63                  bytes[1] << 8  |
     64                  bytes[2] << 16 |
     65                  bytes[3] << 24 |
     66                  bytes[4] << 32 |
     67                  bytes[5] << 40 |
     68                  bytes[6] << 48 |
     69                  bytes[7] << 56)
     70    else
     71        # Big endian
     72        number = (bytes[0] << 56 |
     73                  bytes[1] << 48 |
     74                  bytes[2] << 40 |
     75                  bytes[3] << 32 |
     76                  bytes[4] << 24 |
     77                  bytes[5] << 16 |
     78                  bytes[6] << 8  |
     79                  bytes[7] << 0)
    9780    end
    98    
    99     def prepareMagic(endianness, numbers)
    100         magicBytes = []
    101         numbers.each {
    102             | number |
    103             currentBytes = []
    104             8.times {
    105                 currentBytes << (number & 0xff)
    106                 number >>= 8
    107             }
    108             if endianness == :big
    109                 currentBytes.reverse!
    110             end
    111             magicBytes += currentBytes
     81    if number > 0x7fffffff_ffffffff
     82        number -= 1 << 64
     83    end
     84    number
     85end
     86
     87def prepareMagic(endianness, numbers)
     88    magicBytes = []
     89    numbers.each {
     90        | number |
     91        currentBytes = []
     92        8.times {
     93            currentBytes << (number & 0xff)
     94            number >>= 8
    11295        }
    113         magicBytes
    114     end
    115    
     96        if endianness == :big
     97            currentBytes.reverse!
     98        end
     99        magicBytes += currentBytes
     100    }
     101    magicBytes
     102end
     103
     104def fileBytes(file)
    116105    fileBytes = []
    117    
    118106    File.open(file, "rb") {
    119107        | inp |
     
    124112        }
    125113    }
    126    
    127     def sliceByteArrays(byteArray, pattern)
    128         result = []
    129         lastSlicePoint = 0
    130         (byteArray.length - pattern.length + 1).times {
    131             | index |
    132             foundOne = true
    133             pattern.length.times {
    134                 | subIndex |
    135                 if byteArray[index + subIndex] != pattern[subIndex]
    136                     foundOne = false
    137                     break
    138                 end
    139             }
    140             if foundOne
    141                 result << byteArray[lastSlicePoint...index]
    142                 lastSlicePoint = index + pattern.length
     114    fileBytes
     115end
     116
     117def sliceByteArrays(byteArray, pattern)
     118    result = []
     119    lastSlicePoint = 0
     120    (byteArray.length - pattern.length + 1).times {
     121        | index |
     122        foundOne = true
     123        pattern.length.times {
     124            | subIndex |
     125            if byteArray[index + subIndex] != pattern[subIndex]
     126                foundOne = false
     127                break
    143128            end
    144129        }
    145        
    146         result << byteArray[lastSlicePoint...(byteArray.length)]
    147        
    148         result
    149     end
    150    
     130        if foundOne
     131            result << byteArray[lastSlicePoint...index]
     132            lastSlicePoint = index + pattern.length
     133        end
     134    }
     135
     136    result << byteArray[lastSlicePoint...(byteArray.length)]
     137
     138    result
     139end
     140
     141#
     142# offsetsAndConfigurationIndex(ast, file) ->
     143#     [[offsets, index], ...]
     144#
     145# Parses the offsets from a file and returns a list of offsets and the
     146# index of the configuration that is valid in this build target.
     147#
     148
     149def offsetsAndConfigurationIndex(file)
     150    fileBytes = fileBytes(file)
     151    result = {}
     152
    151153    [:little, :big].each {
    152154        | endianness |
    153155        headerMagicBytes = prepareMagic(endianness, OFFSET_HEADER_MAGIC_NUMBERS)
    154156        magicBytes = prepareMagic(endianness, OFFSET_MAGIC_NUMBERS)
    155        
     157
    156158        bigArray = sliceByteArrays(fileBytes, headerMagicBytes)
    157159        unless bigArray.size <= 1
     
    169171        end
    170172    }
    171    
     173
    172174    raise MissingMagicValuesException unless result.length >= 1
    173    
     175
    174176    # result is {index1=>offsets1, index2=>offsets2} but we want to return
    175177    # [[offsets1, index1], [offsets2, index2]].
     
    181183
    182184#
     185# configurationIndices(ast, file) ->
     186#     [[offsets, index], ...]
     187#
     188# Parses the configurations from a file and returns a list of the indices of
     189# the configurations that are valid in this build target.
     190#
     191
     192def configurationIndices(file)
     193    fileBytes = fileBytes(file)
     194    result = []
     195
     196    [:little, :big].each {
     197        | endianness |
     198        headerMagicBytes = prepareMagic(endianness, OFFSET_HEADER_MAGIC_NUMBERS)
     199
     200        bigArray = sliceByteArrays(fileBytes, headerMagicBytes)
     201        unless bigArray.size <= 1
     202            bigArray[1..-1].each {
     203                | configArray |
     204                result << readInt(endianness, configArray)
     205            }
     206        end
     207    }
     208
     209    raise MissingMagicValuesException unless result.length >= 1
     210
     211    return result
     212end
     213
     214#
    183215# buildOffsetsMap(ast, extractedConstants) -> map
    184216#
  • trunk/Source/JavaScriptCore/offlineasm/settings.rb

    r237214 r237219  
    9191def forSettings(concreteSettings, ast)
    9292    # Check which architectures this combinator claims to support.
    93     numClaimedBackends = 0
    9493    selectedBackend = nil
    9594    BACKENDS.each {
     
    167166
    168167def isASTErroneous(ast)
    169     not ast.filter(Error).empty?
     168    not ast.demacroify({}).filter(Error).empty?
    170169end
    171170
     
    205204   
    206205    if isASTErroneous(ast)
    207         $output.puts "#error \"Invalid configuration.\""
     206        $output.puts "#error \"Invalid configuration. Error at: #{ast.filter(Error)[0].codeOrigin}\""
    208207    elsif not WORKING_BACKENDS.include? backend
    209208        $output.puts "#error \"This backend is not supported yet.\""
Note: See TracChangeset for help on using the changeset viewer.