WebKit Bugzilla
Attachment 350043 Details for
Bug 189708
: Separate configuration extraction from offset extraction
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-189708-20180918133231.patch (text/plain), 42.47 KB, created by
Tadeu Zagallo
on 2018-09-18 13:32:44 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Tadeu Zagallo
Created:
2018-09-18 13:32:44 PDT
Size:
42.47 KB
patch
obsolete
>Subversion Revision: 236149 >diff --git a/Source/JavaScriptCore/ChangeLog b/Source/JavaScriptCore/ChangeLog >index 6ce7c338fef3372e56aa274e7498cc0fb810c6fc..4fb1e9b6a1bde21cd316d56640c5973bad17852f 100644 >--- a/Source/JavaScriptCore/ChangeLog >+++ b/Source/JavaScriptCore/ChangeLog >@@ -1,3 +1,20 @@ >+2018-09-18 Tadeu Zagallo <tzagallo@apple.com> >+ >+ Separate configuration extraction from offset extraction >+ https://bugs.webkit.org/show_bug.cgi?id=189708 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Instead of generating a file with all offsets for every combination of >+ configurations, we first generate a file with only the configuration >+ indices and pass that to the offset extractor. The offset extractor then >+ only generates the offsets for valid configurations >+ >+ * JavaScriptCore.xcodeproj/project.pbxproj: >+ * offlineasm/generate_offset_extractor.rb: >+ * offlineasm/offsets.rb: >+ * offlineasm/settings.rb: >+ > 2018-09-17 Devin Rousso <drousso@apple.com> > > Web Inspector: generate CSSKeywordCompletions from backend values >diff --git a/Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj b/Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj >index 9c5c50c621b8b6e3fa738b3f96bb26b1adbd8dfe..167619dd02666445bf73ec4d8c1bac5f4a04e4c7 100644 >--- a/Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj >+++ b/Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj >@@ -15,10 +15,23 @@ > ); > dependencies = ( > 65442D5018EBB744007AF92F /* PBXTargetDependency */, >+ 14BD68992151916D0050DAFF /* PBXTargetDependency */, > ); > name = "LLInt Offsets"; > productName = "Derived Sources"; > }; >+ 14BD688F215191450050DAFF /* LLInt Settings */ = { >+ isa = PBXAggregateTarget; >+ buildConfigurationList = 14BD6893215191450050DAFF /* Build configuration list for PBXAggregateTarget "LLInt Settings" */; >+ buildPhases = ( >+ 14BD6892215191450050DAFF /* Generate Derived Sources */, >+ ); >+ dependencies = ( >+ 14BD6890215191450050DAFF /* PBXTargetDependency */, >+ ); >+ name = "LLInt Settings"; >+ productName = "Derived Sources"; >+ }; > 53B4BD041F68AF8900D2BEA3 /* Generate Unified Sources */ = { > isa = PBXAggregateTarget; > buildConfigurationList = 53B4BD0A1F68AF8900D2BEA3 /* Build configuration list for PBXAggregateTarget "Generate Unified Sources" */; >@@ -800,6 +813,7 @@ > 14BA78F113AAB88F005B7C2C /* SlotVisitor.h in Headers */ = {isa = PBXBuildFile; fileRef = 14BA78F013AAB88F005B7C2C /* SlotVisitor.h */; settings = {ATTRIBUTES = (Private, ); }; }; > 14BA7A9813AADFF8005B7C2C /* Heap.h in Headers */ = {isa = PBXBuildFile; fileRef = 14BA7A9613AADFF8005B7C2C /* Heap.h */; settings = {ATTRIBUTES = (Private, ); }; }; > 14BD59C50A3E8F9F00BAF59C /* JavaScriptCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 932F5BD90822A1C700736975 /* JavaScriptCore.framework */; }; >+ 14BD689D215191C10050DAFF /* LLIntSettingsExtractor.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 14BD689C215191B30050DAFF /* LLIntSettingsExtractor.cpp */; }; > 14BE7D3317135CF400D1807A /* WeakInlines.h in Headers */ = {isa = PBXBuildFile; fileRef = 14BE7D3217135CF400D1807A /* WeakInlines.h */; settings = {ATTRIBUTES = (Private, ); }; }; > 14BFCE6910CDB1FC00364CCE /* WeakGCMap.h in Headers */ = {isa = PBXBuildFile; fileRef = 14BFCE6810CDB1FC00364CCE /* WeakGCMap.h */; settings = {ATTRIBUTES = (Private, ); }; }; > 14CA958B16AB50DE00938A06 /* StaticPropertyAnalyzer.h in Headers */ = {isa = PBXBuildFile; fileRef = 14CA958A16AB50DE00938A06 /* StaticPropertyAnalyzer.h */; settings = {ATTRIBUTES = (Private, ); }; }; >@@ -1110,6 +1124,7 @@ > 70ECA6061AFDBEA200449739 /* JSTemplateObjectDescriptor.h in Headers */ = {isa = PBXBuildFile; fileRef = 70ECA6011AFDBEA200449739 /* JSTemplateObjectDescriptor.h */; settings = {ATTRIBUTES = (Private, ); }; }; > 70ECA6091AFDBEA200449739 /* TemplateObjectDescriptor.h in Headers */ = {isa = PBXBuildFile; fileRef = 70ECA6041AFDBEA200449739 /* TemplateObjectDescriptor.h */; settings = {ATTRIBUTES = (Private, ); }; }; > 72AAF7CE1D0D31B3005E60BE /* JSCustomGetterSetterFunction.h in Headers */ = {isa = PBXBuildFile; fileRef = 72AAF7CC1D0D318B005E60BE /* JSCustomGetterSetterFunction.h */; }; >+ 7593C898BE714A64BE93A6E7 /* WasmContextInlines.h in Headers */ = {isa = PBXBuildFile; fileRef = A27958D7FA1142B0AC9E364D /* WasmContextInlines.h */; settings = {ATTRIBUTES = (Private, ); }; }; > 790081391E95A8EC0052D7CD /* WasmModule.h in Headers */ = {isa = PBXBuildFile; fileRef = 790081371E95A8EC0052D7CD /* WasmModule.h */; settings = {ATTRIBUTES = (Private, ); }; }; > 7905BB691D12050E0019FE57 /* InlineAccess.h in Headers */ = {isa = PBXBuildFile; fileRef = 7905BB671D12050E0019FE57 /* InlineAccess.h */; settings = {ATTRIBUTES = (Private, ); }; }; > 79160DBE1C8E3EC8008C085A /* ProxyRevoke.h in Headers */ = {isa = PBXBuildFile; fileRef = 79160DBC1C8E3EC8008C085A /* ProxyRevoke.h */; settings = {ATTRIBUTES = (Private, ); }; }; >@@ -1523,7 +1538,6 @@ > AD2FCC211DB59CB200B3E736 /* WebAssemblyTablePrototype.lut.h in Headers */ = {isa = PBXBuildFile; fileRef = AD2FCC151DB59C5900B3E736 /* WebAssemblyTablePrototype.lut.h */; }; > AD2FCC2D1DB838FD00B3E736 /* WebAssemblyPrototype.h in Headers */ = {isa = PBXBuildFile; fileRef = AD2FCC271DB838C400B3E736 /* WebAssemblyPrototype.h */; settings = {ATTRIBUTES = (Private, ); }; }; > AD412B341E7B2E9E008AF157 /* WasmContext.h in Headers */ = {isa = PBXBuildFile; fileRef = AD412B321E7B2E8A008AF157 /* WasmContext.h */; settings = {ATTRIBUTES = (Private, ); }; }; >- 7593C898BE714A64BE93A6E7 /* WasmContextInlines.h in Headers */ = {isa = PBXBuildFile; fileRef = A27958D7FA1142B0AC9E364D /* WasmContextInlines.h */; settings = {ATTRIBUTES = (Private, ); }; }; > AD4252511E5D0E14009D2A97 /* FullCodeOrigin.h in Headers */ = {isa = PBXBuildFile; fileRef = AD4252501E5D0DEB009D2A97 /* FullCodeOrigin.h */; }; > AD4937C41DDBE6140077C807 /* AbstractModuleRecord.h in Headers */ = {isa = PBXBuildFile; fileRef = AD4937C21DDBE60A0077C807 /* AbstractModuleRecord.h */; settings = {ATTRIBUTES = (Private, ); }; }; > AD4937C81DDD0AAE0077C807 /* WebAssemblyModuleRecord.h in Headers */ = {isa = PBXBuildFile; fileRef = AD4937C61DDCDCF00077C807 /* WebAssemblyModuleRecord.h */; }; >@@ -1847,6 +1861,34 @@ > remoteGlobalIDString = 0F4680A914BA7FD900BFE272; > remoteInfo = "LLInt Offsets"; > }; >+ 14BD6883215191310050DAFF /* PBXContainerItemProxy */ = { >+ isa = PBXContainerItemProxy; >+ containerPortal = 0867D690FE84028FC02AAC07 /* Project object */; >+ proxyType = 1; >+ remoteGlobalIDString = 65FB3F6609D11E9100F49DEB; >+ remoteInfo = "Derived Sources"; >+ }; >+ 14BD6891215191450050DAFF /* PBXContainerItemProxy */ = { >+ isa = PBXContainerItemProxy; >+ containerPortal = 0867D690FE84028FC02AAC07 /* Project object */; >+ proxyType = 1; >+ remoteGlobalIDString = 65FB3F6609D11E9100F49DEB; >+ remoteInfo = "Derived Sources"; >+ }; >+ 14BD68982151916D0050DAFF /* PBXContainerItemProxy */ = { >+ isa = PBXContainerItemProxy; >+ containerPortal = 0867D690FE84028FC02AAC07 /* Project object */; >+ proxyType = 1; >+ remoteGlobalIDString = 14BD6881215191310050DAFF; >+ remoteInfo = JSCLLIntSettingsExtractor; >+ }; >+ 14BD689A215191740050DAFF /* PBXContainerItemProxy */ = { >+ isa = PBXContainerItemProxy; >+ containerPortal = 0867D690FE84028FC02AAC07 /* Project object */; >+ proxyType = 1; >+ remoteGlobalIDString = 14BD688F215191450050DAFF; >+ remoteInfo = "LLInt Settings"; >+ }; > 53B4BD131F68C2AA00D2BEA3 /* PBXContainerItemProxy */ = { > isa = PBXContainerItemProxy; > containerPortal = 0867D690FE84028FC02AAC07 /* Project object */; >@@ -3183,6 +3225,9 @@ > 14BD5A2A0A3E91F600BAF59C /* JSContextRef.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = JSContextRef.h; sourceTree = "<group>"; }; > 14BD5A2B0A3E91F600BAF59C /* JSValueRef.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = JSValueRef.cpp; sourceTree = "<group>"; }; > 14BD5A2D0A3E91F600BAF59C /* testapi.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = testapi.c; path = API/tests/testapi.c; sourceTree = "<group>"; }; >+ 14BD688E215191310050DAFF /* JSCLLIntSettingsExtractor */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = JSCLLIntSettingsExtractor; sourceTree = BUILT_PRODUCTS_DIR; }; >+ 14BD689C215191B30050DAFF /* LLIntSettingsExtractor.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = LLIntSettingsExtractor.cpp; path = llint/LLIntSettingsExtractor.cpp; sourceTree = "<group>"; }; >+ 14BD689F2151923F0050DAFF /* LLIntDesiredSettings.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = LLIntDesiredSettings.h; path = LLIntOffsets/LLIntDesiredSettings.h; sourceTree = BUILT_PRODUCTS_DIR; }; > 14BE7D3217135CF400D1807A /* WeakInlines.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WeakInlines.h; sourceTree = "<group>"; }; > 14BFCE6810CDB1FC00364CCE /* WeakGCMap.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WeakGCMap.h; sourceTree = "<group>"; }; > 14CA958A16AB50DE00938A06 /* StaticPropertyAnalyzer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = StaticPropertyAnalyzer.h; sourceTree = "<group>"; }; >@@ -3993,6 +4038,7 @@ > A1D792FB1B43864B004516F5 /* IntlNumberFormatPrototype.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IntlNumberFormatPrototype.h; sourceTree = "<group>"; }; > A1E0451B1C25B4B100BB663C /* StringPrototype.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; path = StringPrototype.js; sourceTree = "<group>"; }; > A1FE1EB01C2C537E00A289FF /* DatePrototype.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; path = DatePrototype.js; sourceTree = "<group>"; }; >+ A27958D7FA1142B0AC9E364D /* WasmContextInlines.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WasmContextInlines.h; sourceTree = "<group>"; }; > A503FA13188E0FAF00110F14 /* JavaScriptCallFrame.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JavaScriptCallFrame.cpp; sourceTree = "<group>"; }; > A503FA14188E0FAF00110F14 /* JavaScriptCallFrame.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JavaScriptCallFrame.h; sourceTree = "<group>"; }; > A503FA15188E0FB000110F14 /* JSJavaScriptCallFrame.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSJavaScriptCallFrame.cpp; sourceTree = "<group>"; }; >@@ -4346,7 +4392,6 @@ > AD2FCC271DB838C400B3E736 /* WebAssemblyPrototype.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = WebAssemblyPrototype.h; path = js/WebAssemblyPrototype.h; sourceTree = "<group>"; }; > AD2FCC321DC4045300B3E736 /* WasmFormat.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WasmFormat.cpp; sourceTree = "<group>"; }; > AD412B321E7B2E8A008AF157 /* WasmContext.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WasmContext.h; sourceTree = "<group>"; }; >- A27958D7FA1142B0AC9E364D /* WasmContextInlines.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WasmContextInlines.h; sourceTree = "<group>"; }; > AD412B351E7B57C0008AF157 /* AllowMacroScratchRegisterUsageIf.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AllowMacroScratchRegisterUsageIf.h; sourceTree = "<group>"; }; > AD4252501E5D0DEB009D2A97 /* FullCodeOrigin.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FullCodeOrigin.h; sourceTree = "<group>"; }; > AD4252521E5D0F22009D2A97 /* FullCodeOrigin.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = FullCodeOrigin.cpp; sourceTree = "<group>"; }; >@@ -4872,6 +4917,13 @@ > ); > runOnlyForDeploymentPostprocessing = 0; > }; >+ 14BD6888215191310050DAFF /* Frameworks */ = { >+ isa = PBXFrameworksBuildPhase; >+ buildActionMask = 2147483647; >+ files = ( >+ ); >+ runOnlyForDeploymentPostprocessing = 0; >+ }; > 651122FC14046A4C002B101D /* Frameworks */ = { > isa = PBXFrameworksBuildPhase; > buildActionMask = 2147483647; >@@ -4931,6 +4983,7 @@ > 0F9327591C20BCBA00CF6564 /* dynbench */, > 932F5BE10822A1C700736975 /* jsc */, > 0FF922CF14F46B130041A24E /* JSCLLIntOffsetsExtractor */, >+ 14BD688E215191310050DAFF /* JSCLLIntSettingsExtractor */, > 141211200A48793C00480255 /* minidom */, > 0F6183431C45F62A0072450B /* testair */, > 14BD59BF0A3E8F9000BAF59C /* testapi */, >@@ -5023,6 +5076,7 @@ > 0F4680CE14BBB3D100BFE272 /* LLIntData.cpp */, > 0F4680CF14BBB3D100BFE272 /* LLIntData.h */, > 5DDDF44614FEE72200B4FB4D /* LLIntDesiredOffsets.h */, >+ 14BD689F2151923F0050DAFF /* LLIntDesiredSettings.h */, > 0F38B00F17CF077F00B144D3 /* LLIntEntrypoint.cpp */, > 0F38B01017CF077F00B144D3 /* LLIntEntrypoint.h */, > 0F46809D14BA7F8200BFE272 /* LLIntExceptions.cpp */, >@@ -5031,6 +5085,7 @@ > 0F4680A114BA7F8200BFE272 /* LLIntOffsetsExtractor.cpp */, > FED287B115EC9A5700DA8161 /* LLIntOpcode.h */, > 79CFC6EF1C33B10000C768EA /* LLIntPCRanges.h */, >+ 14BD689C215191B30050DAFF /* LLIntSettingsExtractor.cpp */, > 0F46809F14BA7F8200BFE272 /* LLIntSlowPaths.cpp */, > 0F4680A014BA7F8200BFE272 /* LLIntSlowPaths.h */, > 0F0B839714BCF45A00885B4F /* LLIntThunks.cpp */, >@@ -7812,7 +7867,7 @@ > 9959E9251BD17F1E001AA413 /* Scripts */ = { > isa = PBXGroup; > children = ( >- 99DA00971BD598E000F4575C /* builtins */, >+ 99DA00971BD598E000F4575C /* wkbuiltins */, > 9959E9271BD17FA0001AA413 /* cssmin.py */, > 9959E92F1BD181F6001AA413 /* generate-combined-inspector-json.py */, > 99DA00AC1BD5993E00F4575C /* generate-js-builtins.py */, >@@ -7830,7 +7885,6 @@ > isa = PBXGroup; > children = ( > 99DA00991BD5992700F4575C /* __init__.py */, >- 99DA009D1BD5992700F4575C /* wkbuiltins.py */, > 99DA009E1BD5992700F4575C /* builtins_generate_combined_header.py */, > 99DA009F1BD5992700F4575C /* builtins_generate_combined_implementation.py */, > 412952731D2CF6AC00E78B89 /* builtins_generate_internals_wrapper_header.py */, >@@ -7842,6 +7896,7 @@ > 99DA009A1BD5992700F4575C /* builtins_generator.py */, > 99DA009B1BD5992700F4575C /* builtins_model.py */, > 99DA009C1BD5992700F4575C /* builtins_templates.py */, >+ 99DA009D1BD5992700F4575C /* wkbuiltins.py */, > ); > path = wkbuiltins; > sourceTree = "<group>"; >@@ -8439,7 +8494,6 @@ > DE26E9031CB5DD0500D2BE82 /* BuiltinExecutableCreator.h in Headers */, > A7D801A51880D66E0026C39B /* BuiltinExecutables.h in Headers */, > A75EE9B218AAB7E200AAD043 /* BuiltinNames.h in Headers */, >- 99DA00A61BD5993100F4575C /* wkbuiltins.py in Headers */, > 99DA00A71BD5993100F4575C /* builtins_generate_combined_header.py in Headers */, > 99DA00A81BD5993100F4575C /* builtins_generate_combined_implementation.py in Headers */, > 412952771D2CF6BC00E78B89 /* builtins_generate_internals_wrapper_header.py in Headers */, >@@ -9689,6 +9743,7 @@ > ADBC54D51DF8EA2B005BF738 /* WebAssemblyToJSCallee.h in Headers */, > 52F6C35E1E71EB080081F4CC /* WebAssemblyWrapperFunction.h in Headers */, > BC18C47A0E16F5CD00B34460 /* WebKitAvailability.h in Headers */, >+ 99DA00A61BD5993100F4575C /* wkbuiltins.py in Headers */, > A7DCB97312E5193F00911940 /* WriteBarrier.h in Headers */, > C2B6D75318A33793004A9301 /* WriteBarrierInlines.h in Headers */, > 0FC8150A14043BF500CFA603 /* WriteBarrierSupport.h in Headers */, >@@ -9811,6 +9866,25 @@ > productReference = 14BD59BF0A3E8F9000BAF59C /* testapi */; > productType = "com.apple.product-type.tool"; > }; >+ 14BD6881215191310050DAFF /* JSCLLIntSettingsExtractor */ = { >+ isa = PBXNativeTarget; >+ buildConfigurationList = 14BD6889215191310050DAFF /* Build configuration list for PBXNativeTarget "JSCLLIntSettingsExtractor" */; >+ buildPhases = ( >+ 14BD6886215191310050DAFF /* Sources */, >+ 14BD6888215191310050DAFF /* Frameworks */, >+ ); >+ buildRules = ( >+ ); >+ dependencies = ( >+ 14BD6882215191310050DAFF /* PBXTargetDependency */, >+ 14BD689B215191740050DAFF /* PBXTargetDependency */, >+ ); >+ name = JSCLLIntSettingsExtractor; >+ productInstallPath = /usr/local/bin; >+ productName = jsc; >+ productReference = 14BD688E215191310050DAFF /* JSCLLIntSettingsExtractor */; >+ productType = "com.apple.product-type.tool"; >+ }; > 651122F714046A4C002B101D /* testRegExp */ = { > isa = PBXNativeTarget; > buildConfigurationList = 6511230014046A4C002B101D /* Build configuration list for PBXNativeTarget "testRegExp" */; >@@ -9933,8 +10007,10 @@ > targets = ( > 932F5BE30822A1C700736975 /* All */, > 932F5B3E0822A1C700736975 /* JavaScriptCore */, >- 0F4680A914BA7FD900BFE272 /* LLInt Offsets */, > 65FB3F6609D11E9100F49DEB /* Derived Sources */, >+ 14BD688F215191450050DAFF /* LLInt Settings */, >+ 14BD6881215191310050DAFF /* JSCLLIntSettingsExtractor */, >+ 0F4680A914BA7FD900BFE272 /* LLInt Offsets */, > 0FF922C314F46B130041A24E /* JSCLLIntOffsetsExtractor */, > 65788A9D18B409EB00C189FF /* Offline Assembler */, > 53B4BD041F68AF8900D2BEA3 /* Generate Unified Sources */, >@@ -9976,7 +10052,21 @@ > ); > runOnlyForDeploymentPostprocessing = 0; > shellPath = /bin/sh; >- shellScript = "set -e\n\nmkdir -p \"${BUILT_PRODUCTS_DIR}/LLIntOffsets/${CURRENT_ARCH}\"\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/${CURRENT_ARCH}/LLIntDesiredOffsets.h\" \"${ARCHS} C_LOOP\"\n"; >+ shellScript = "set -e\n\nmkdir -p \"${BUILT_PRODUCTS_DIR}/LLIntOffsets/${CURRENT_ARCH}\"\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/${CURRENT_ARCH}/LLIntDesiredOffsets.h\" \"${ARCHS} C_LOOP\"\n"; >+ }; >+ 14BD6892215191450050DAFF /* Generate Derived Sources */ = { >+ isa = PBXShellScriptBuildPhase; >+ buildActionMask = 2147483647; >+ files = ( >+ ); >+ inputPaths = ( >+ ); >+ name = "Generate Derived Sources"; >+ outputPaths = ( >+ ); >+ runOnlyForDeploymentPostprocessing = 0; >+ shellPath = /bin/sh; >+ shellScript = "set -e\n\nmkdir -p \"${BUILT_PRODUCTS_DIR}/LLIntOffsets/${CURRENT_ARCH}\"\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/${CURRENT_ARCH}/LLIntDesiredSettings.h\" \"${ARCHS} C_LOOP\"\n"; > }; > 1A02D9A81B34A882000D1522 /* Add Symlink in /System/Library/PrivateFrameworks */ = { > isa = PBXShellScriptBuildPhase; >@@ -10250,6 +10340,14 @@ > ); > runOnlyForDeploymentPostprocessing = 0; > }; >+ 14BD6886215191310050DAFF /* Sources */ = { >+ isa = PBXSourcesBuildPhase; >+ buildActionMask = 2147483647; >+ files = ( >+ 14BD689D215191C10050DAFF /* LLIntSettingsExtractor.cpp in Sources */, >+ ); >+ runOnlyForDeploymentPostprocessing = 0; >+ }; > 651122FA14046A4C002B101D /* Sources */ = { > isa = PBXSourcesBuildPhase; > buildActionMask = 2147483647; >@@ -10474,6 +10572,26 @@ > target = 0F4680A914BA7FD900BFE272 /* LLInt Offsets */; > targetProxy = 0FF922D214F46B2F0041A24E /* PBXContainerItemProxy */; > }; >+ 14BD6882215191310050DAFF /* PBXTargetDependency */ = { >+ isa = PBXTargetDependency; >+ target = 65FB3F6609D11E9100F49DEB /* Derived Sources */; >+ targetProxy = 14BD6883215191310050DAFF /* PBXContainerItemProxy */; >+ }; >+ 14BD6890215191450050DAFF /* PBXTargetDependency */ = { >+ isa = PBXTargetDependency; >+ target = 65FB3F6609D11E9100F49DEB /* Derived Sources */; >+ targetProxy = 14BD6891215191450050DAFF /* PBXContainerItemProxy */; >+ }; >+ 14BD68992151916D0050DAFF /* PBXTargetDependency */ = { >+ isa = PBXTargetDependency; >+ target = 14BD6881215191310050DAFF /* JSCLLIntSettingsExtractor */; >+ targetProxy = 14BD68982151916D0050DAFF /* PBXContainerItemProxy */; >+ }; >+ 14BD689B215191740050DAFF /* PBXTargetDependency */ = { >+ isa = PBXTargetDependency; >+ target = 14BD688F215191450050DAFF /* LLInt Settings */; >+ targetProxy = 14BD689A215191740050DAFF /* PBXContainerItemProxy */; >+ }; > 53B4BD141F68C2AA00D2BEA3 /* PBXTargetDependency */ = { > isa = PBXTargetDependency; > target = 53B4BD041F68AF8900D2BEA3 /* Generate Unified Sources */; >@@ -10860,6 +10978,90 @@ > }; > name = Production; > }; >+ 14BD688A215191310050DAFF /* Debug */ = { >+ isa = XCBuildConfiguration; >+ baseConfigurationReference = BC021BF2136900C300FC5467 /* ToolExecutable.xcconfig */; >+ buildSettings = { >+ HEADER_SEARCH_PATHS = ( >+ "\"${BUILT_PRODUCTS_DIR}/DerivedSources/JavaScriptCore\"", >+ "\"${BUILT_PRODUCTS_DIR}/LLIntOffsets/${CURRENT_ARCH}\"", >+ "\"$(JAVASCRIPTCORE_FRAMEWORKS_DIR)/JavaScriptCore.framework/PrivateHeaders\"", >+ "$(inherited)", >+ ); >+ PRODUCT_NAME = "$(TARGET_NAME)"; >+ }; >+ name = Debug; >+ }; >+ 14BD688B215191310050DAFF /* Release */ = { >+ isa = XCBuildConfiguration; >+ baseConfigurationReference = BC021BF2136900C300FC5467 /* ToolExecutable.xcconfig */; >+ buildSettings = { >+ HEADER_SEARCH_PATHS = ( >+ "\"${BUILT_PRODUCTS_DIR}/DerivedSources/JavaScriptCore\"", >+ "\"${BUILT_PRODUCTS_DIR}/LLIntOffsets/${CURRENT_ARCH}\"", >+ "\"$(JAVASCRIPTCORE_FRAMEWORKS_DIR)/JavaScriptCore.framework/PrivateHeaders\"", >+ "$(inherited)", >+ ); >+ PRODUCT_NAME = "$(TARGET_NAME)"; >+ }; >+ name = Release; >+ }; >+ 14BD688C215191310050DAFF /* Profiling */ = { >+ isa = XCBuildConfiguration; >+ baseConfigurationReference = BC021BF2136900C300FC5467 /* ToolExecutable.xcconfig */; >+ buildSettings = { >+ HEADER_SEARCH_PATHS = ( >+ "\"${BUILT_PRODUCTS_DIR}/DerivedSources/JavaScriptCore\"", >+ "\"${BUILT_PRODUCTS_DIR}/LLIntOffsets/${CURRENT_ARCH}\"", >+ "\"$(JAVASCRIPTCORE_FRAMEWORKS_DIR)/JavaScriptCore.framework/PrivateHeaders\"", >+ "$(inherited)", >+ ); >+ PRODUCT_NAME = "$(TARGET_NAME)"; >+ }; >+ name = Profiling; >+ }; >+ 14BD688D215191310050DAFF /* Production */ = { >+ isa = XCBuildConfiguration; >+ baseConfigurationReference = BC021BF2136900C300FC5467 /* ToolExecutable.xcconfig */; >+ buildSettings = { >+ HEADER_SEARCH_PATHS = ( >+ "\"${BUILT_PRODUCTS_DIR}/DerivedSources/JavaScriptCore\"", >+ "\"${BUILT_PRODUCTS_DIR}/LLIntOffsets/${CURRENT_ARCH}\"", >+ "\"$(JAVASCRIPTCORE_FRAMEWORKS_DIR)/JavaScriptCore.framework/PrivateHeaders\"", >+ "$(inherited)", >+ ); >+ PRODUCT_NAME = "$(TARGET_NAME)"; >+ }; >+ name = Production; >+ }; >+ 14BD6894215191450050DAFF /* Debug */ = { >+ isa = XCBuildConfiguration; >+ buildSettings = { >+ PRODUCT_NAME = "$(TARGET_NAME)"; >+ }; >+ name = Debug; >+ }; >+ 14BD6895215191450050DAFF /* Release */ = { >+ isa = XCBuildConfiguration; >+ buildSettings = { >+ PRODUCT_NAME = "$(TARGET_NAME)"; >+ }; >+ name = Release; >+ }; >+ 14BD6896215191450050DAFF /* Profiling */ = { >+ isa = XCBuildConfiguration; >+ buildSettings = { >+ PRODUCT_NAME = "$(TARGET_NAME)"; >+ }; >+ name = Profiling; >+ }; >+ 14BD6897215191450050DAFF /* Production */ = { >+ isa = XCBuildConfiguration; >+ buildSettings = { >+ PRODUCT_NAME = "$(TARGET_NAME)"; >+ }; >+ name = Production; >+ }; > 53B4BD0B1F68AF8900D2BEA3 /* Debug */ = { > isa = XCBuildConfiguration; > buildSettings = { >@@ -11247,6 +11449,28 @@ > defaultConfigurationIsVisible = 0; > defaultConfigurationName = Production; > }; >+ 14BD6889215191310050DAFF /* Build configuration list for PBXNativeTarget "JSCLLIntSettingsExtractor" */ = { >+ isa = XCConfigurationList; >+ buildConfigurations = ( >+ 14BD688A215191310050DAFF /* Debug */, >+ 14BD688B215191310050DAFF /* Release */, >+ 14BD688C215191310050DAFF /* Profiling */, >+ 14BD688D215191310050DAFF /* Production */, >+ ); >+ defaultConfigurationIsVisible = 0; >+ defaultConfigurationName = Production; >+ }; >+ 14BD6893215191450050DAFF /* Build configuration list for PBXAggregateTarget "LLInt Settings" */ = { >+ isa = XCConfigurationList; >+ buildConfigurations = ( >+ 14BD6894215191450050DAFF /* Debug */, >+ 14BD6895215191450050DAFF /* Release */, >+ 14BD6896215191450050DAFF /* Profiling */, >+ 14BD6897215191450050DAFF /* Production */, >+ ); >+ defaultConfigurationIsVisible = 0; >+ defaultConfigurationName = Production; >+ }; > 53B4BD0A1F68AF8900D2BEA3 /* Build configuration list for PBXAggregateTarget "Generate Unified Sources" */ = { > isa = XCConfigurationList; > buildConfigurations = ( >diff --git a/Source/JavaScriptCore/llint/LLIntSettingsExtractor.cpp b/Source/JavaScriptCore/llint/LLIntSettingsExtractor.cpp >new file mode 100644 >index 0000000000000000000000000000000000000000..2ef6511918a39404887d71dcadd38ad08dbb2f83 >--- /dev/null >+++ b/Source/JavaScriptCore/llint/LLIntSettingsExtractor.cpp >@@ -0,0 +1,37 @@ >+/* >+ * Copyright (C) 2012-2018 Apple Inc. All rights reserved. >+ * >+ * Redistribution and use in source and binary forms, with or without >+ * modification, are permitted provided that the following conditions >+ * are met: >+ * 1. Redistributions of source code must retain the above copyright >+ * notice, this list of conditions and the following disclaimer. >+ * 2. Redistributions in binary form must reproduce the above copyright >+ * notice, this list of conditions and the following disclaimer in the >+ * documentation and/or other materials provided with the distribution. >+ * >+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY >+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE >+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR >+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR >+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, >+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, >+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR >+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY >+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT >+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE >+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. >+ */ >+ >+#include "config.h" >+ >+#include "LLIntOfflineAsmConfig.h" >+ >+int main(int, char**) >+{ >+ // Out of an abundance of caution, make sure that LLIntSettingsExtractor::dummy() is live, >+ // and the extractorTable is live, too. >+#include "LLIntDesiredSettings.h" >+ printf("%p\n", extractorTable); >+ return 0; >+} >diff --git a/Source/JavaScriptCore/offlineasm/generate_offset_extractor.rb b/Source/JavaScriptCore/offlineasm/generate_offset_extractor.rb >index fff398255f678dd2db422de2491fb92a7b099c24..05db4f1aeed465c473033aadf383231cb4869db1 100644 >--- a/Source/JavaScriptCore/offlineasm/generate_offset_extractor.rb >+++ b/Source/JavaScriptCore/offlineasm/generate_offset_extractor.rb >@@ -37,11 +37,21 @@ require "transform" > IncludeFile.processIncludeOptions() > > inputFlnm = ARGV.shift >+settingsFlnm = ARGV.shift > outputFlnm = ARGV.shift > >+$stderr.puts settingsFlnm >+ > validBackends = canonicalizeBackendNames(ARGV.shift.split(/[,\s]+/)) > includeOnlyBackends(validBackends) > >+begin >+ configurationList = configurationIndices(settingsFlnm) >+rescue MissingMagicValuesException >+ $stderr.puts "offlineasm: No magic values found. Skipping assembly file generation." >+ exit 1 >+end >+ > def emitMagicNumber > OFFSET_MAGIC_NUMBERS.each { > | number | >@@ -49,7 +59,8 @@ def emitMagicNumber > } > end > >-inputHash = "// offlineasm input hash: #{parseHash(inputFlnm)} #{selfHash}" >+configurationHash = Digest::SHA1.hexdigest(configurationList.join(' ')) >+inputHash = "// offlineasm input hash: #{parseHash(inputFlnm)} #{configurationHash} #{selfHash}" > > if FileTest.exist? outputFlnm > File.open(outputFlnm, "r") { >@@ -62,108 +73,48 @@ if FileTest.exist? outputFlnm > } > end > >-originalAST = parse(inputFlnm) >- >-# >-# Optimize the AST to make configuration extraction faster. This reduces the AST to a form >-# that only contains the things that matter for our purposes: offsets, sizes, and if >-# statements. >-# >- >-class Node >- def offsetsPruneTo(sequence) >- children.each { >- | child | >- child.offsetsPruneTo(sequence) >- } >- end >- >- def offsetsPrune >- result = Sequence.new(codeOrigin, []) >- offsetsPruneTo(result) >- result >- end >-end >- >-class IfThenElse >- def offsetsPruneTo(sequence) >- ifThenElse = IfThenElse.new(codeOrigin, predicate, thenCase.offsetsPrune) >- ifThenElse.elseCase = elseCase.offsetsPrune >- sequence.list << ifThenElse >- end >-end >- >-class StructOffset >- def offsetsPruneTo(sequence) >- sequence.list << self >- end >-end >- >-class Sizeof >- def offsetsPruneTo(sequence) >- sequence.list << self >- end >-end >- >-class ConstExpr >- def offsetsPruneTo(sequence) >- sequence.list << self >- end >-end >- >-prunedAST = originalAST.offsetsPrune >+ast = parse(inputFlnm) >+settingsCombinations = computeSettingsCombinations(ast) > > File.open(outputFlnm, "w") { > | outp | > $output = outp > outp.puts inputHash >- length = 0 >- >- emitCodeInAllConfigurations(prunedAST) { >- | settings, ast, backend, index | >- constsList = ast.filter(ConstExpr).uniq.sort >- >- constsList.each_with_index { >- | const, index | >- outp.puts "constexpr int64_t constValue#{index} = static_cast<int64_t>(#{const.value});" >- } >- } >- >- emitCodeInAllConfigurations(prunedAST) { >- | settings, ast, backend, index | >- offsetsList = ast.filter(StructOffset).uniq.sort >- sizesList = ast.filter(Sizeof).uniq.sort >- constsList = ast.filter(ConstExpr).uniq.sort >- length += OFFSET_HEADER_MAGIC_NUMBERS.size + (OFFSET_MAGIC_NUMBERS.size + 1) * (1 + offsetsList.size + sizesList.size + constsList.size) >- } >- outp.puts "static const int64_t extractorTable[#{length}] = {" >- emitCodeInAllConfigurations(prunedAST) { >- | settings, ast, backend, index | >- OFFSET_HEADER_MAGIC_NUMBERS.each { >- | number | >- $output.puts "unsigned(#{number})," >- } > >- offsetsList = ast.filter(StructOffset).uniq.sort >- sizesList = ast.filter(Sizeof).uniq.sort >- constsList = ast.filter(ConstExpr).uniq.sort >- >- emitMagicNumber >- outp.puts "#{index}," >- offsetsList.each { >- | offset | >- emitMagicNumber >- outp.puts "OFFLINE_ASM_OFFSETOF(#{offset.struct}, #{offset.field})," >- } >- sizesList.each { >- | sizeof | >- emitMagicNumber >- outp.puts "sizeof(#{sizeof.struct})," >- } >- constsList.each_index { >- | index | >- emitMagicNumber >- outp.puts "constValue#{index}," >+ outp.puts "static const int64_t extractorTable[] = {" >+ configurationList.each { >+ | configIndex | >+ forSettings(settingsCombinations[configIndex], ast) { >+ | concreteSettings, lowLevelAST, backend | >+ >+ offsetsList = offsetsList(lowLevelAST) >+ sizesList = sizesList(lowLevelAST) >+ constsList = constsList(lowLevelAST) >+ >+ emitCodeInConfiguration(concreteSettings, lowLevelAST, backend) { >+ OFFSET_HEADER_MAGIC_NUMBERS.each { >+ | number | >+ outp.puts "unsigned(#{number})," >+ } >+ >+ emitMagicNumber >+ outp.puts "#{configIndex}," >+ offsetsList.each { >+ | offset | >+ emitMagicNumber >+ outp.puts "OFFLINE_ASM_OFFSETOF(#{offset.struct}, #{offset.field})," >+ } >+ sizesList.each { >+ | sizeof | >+ emitMagicNumber >+ outp.puts "sizeof(#{sizeof.struct})," >+ } >+ constsList.each { >+ | const | >+ emitMagicNumber >+ outp.puts "static_cast<int64_t>(#{const.value})," >+ } >+ } > } > } > outp.puts "};" >diff --git a/Source/JavaScriptCore/offlineasm/generate_settings_extractor.rb b/Source/JavaScriptCore/offlineasm/generate_settings_extractor.rb >new file mode 100644 >index 0000000000000000000000000000000000000000..01c7dd5540e23d7da44c4b44ac718633b66db9a7 >--- /dev/null >+++ b/Source/JavaScriptCore/offlineasm/generate_settings_extractor.rb >@@ -0,0 +1,80 @@ >+#!/usr/bin/env ruby >+ >+# Copyright (C) 2011 Apple Inc. All rights reserved. >+# >+# Redistribution and use in source and binary forms, with or without >+# modification, are permitted provided that the following conditions >+# are met: >+# 1. Redistributions of source code must retain the above copyright >+# notice, this list of conditions and the following disclaimer. >+# 2. Redistributions in binary form must reproduce the above copyright >+# notice, this list of conditions and the following disclaimer in the >+# documentation and/or other materials provided with the distribution. >+# >+# THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' >+# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, >+# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR >+# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS >+# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR >+# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF >+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS >+# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN >+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) >+# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF >+# THE POSSIBILITY OF SUCH DAMAGE. >+ >+$: << File.dirname(__FILE__) >+ >+require "config" >+require "backends" >+require "digest/sha1" >+require "offsets" >+require "parser" >+require "self_hash" >+require "settings" >+require "transform" >+ >+IncludeFile.processIncludeOptions() >+ >+inputFlnm = ARGV.shift >+outputFlnm = ARGV.shift >+ >+validBackends = canonicalizeBackendNames(ARGV.shift.split(/[,\s]+/)) >+includeOnlyBackends(validBackends) >+ >+inputHash = "// offlineasm input hash: #{parseHash(inputFlnm)} #{selfHash}" >+ >+if FileTest.exist? outputFlnm >+ File.open(outputFlnm, "r") { >+ | inp | >+ firstLine = inp.gets >+ if firstLine and firstLine.chomp == inputHash >+ $stderr.puts "offlineasm: Nothing changed." >+ exit 0 >+ end >+ } >+end >+ >+originalAST = parse(inputFlnm) >+prunedAST = Sequence.new(originalAST.codeOrigin, originalAST.filter(Setting)) >+ >+File.open(outputFlnm, "w") { >+ | outp | >+ $output = outp >+ outp.puts inputHash >+ >+ settingsCombinations = computeSettingsCombinations(prunedAST) >+ length = settingsCombinations.size * (1 + OFFSET_HEADER_MAGIC_NUMBERS.size) >+ >+ outp.puts "static const int64_t extractorTable[#{length}] = {" >+ emitCodeInAllConfigurations(prunedAST) { >+ | settings, ast, backend, index | >+ OFFSET_HEADER_MAGIC_NUMBERS.each { >+ | number | >+ $output.puts "unsigned(#{number})," >+ } >+ outp.puts "#{index}," >+ } >+ outp.puts "};" >+ >+} >diff --git a/Source/JavaScriptCore/offlineasm/offsets.rb b/Source/JavaScriptCore/offlineasm/offsets.rb >index 2c1c1b773ca0a5875b574b62d711cd69cf527213..8d6383b0673754fcc56a888d7b4942b85c5bea45 100644 >--- a/Source/JavaScriptCore/offlineasm/offsets.rb >+++ b/Source/JavaScriptCore/offlineasm/offsets.rb >@@ -56,65 +56,53 @@ def constsList(ast) > ast.filter(ConstExpr).uniq.sort > end > >-# >-# offsetsAndConfigurationIndex(ast, file) -> >-# [[offsets, index], ...] >-# >-# Parses the offsets from a file and returns a list of offsets and the >-# index of the configuration that is valid in this build target. >-# >- >-def offsetsAndConfigurationIndex(file) >- endiannessMarkerBytes = nil >- result = {} >- >- def readInt(endianness, bytes) >- if endianness == :little >- # Little endian >- number = (bytes[0] << 0 | >- bytes[1] << 8 | >- bytes[2] << 16 | >- bytes[3] << 24 | >- bytes[4] << 32 | >- bytes[5] << 40 | >- bytes[6] << 48 | >- bytes[7] << 56) >- else >- # Big endian >- number = (bytes[0] << 56 | >- bytes[1] << 48 | >- bytes[2] << 40 | >- bytes[3] << 32 | >- bytes[4] << 24 | >- bytes[5] << 16 | >- bytes[6] << 8 | >- bytes[7] << 0) >- end >- if number > 0x7fffffff_ffffffff >- number -= 1 << 64 >- end >- number >+def readInt(endianness, bytes) >+ if endianness == :little >+ # Little endian >+ number = (bytes[0] << 0 | >+ bytes[1] << 8 | >+ bytes[2] << 16 | >+ bytes[3] << 24 | >+ bytes[4] << 32 | >+ bytes[5] << 40 | >+ bytes[6] << 48 | >+ bytes[7] << 56) >+ else >+ # Big endian >+ number = (bytes[0] << 56 | >+ bytes[1] << 48 | >+ bytes[2] << 40 | >+ bytes[3] << 32 | >+ bytes[4] << 24 | >+ bytes[5] << 16 | >+ bytes[6] << 8 | >+ bytes[7] << 0) > end >- >- def prepareMagic(endianness, numbers) >- magicBytes = [] >- numbers.each { >- | number | >- currentBytes = [] >- 8.times { >- currentBytes << (number & 0xff) >- number >>= 8 >- } >- if endianness == :big >- currentBytes.reverse! >- end >- magicBytes += currentBytes >- } >- magicBytes >+ if number > 0x7fffffff_ffffffff >+ number -= 1 << 64 > end >- >+ number >+end >+ >+def prepareMagic(endianness, numbers) >+ magicBytes = [] >+ numbers.each { >+ | number | >+ currentBytes = [] >+ 8.times { >+ currentBytes << (number & 0xff) >+ number >>= 8 >+ } >+ if endianness == :big >+ currentBytes.reverse! >+ end >+ magicBytes += currentBytes >+ } >+ magicBytes >+end >+ >+def fileBytes(file) > fileBytes = [] >- > File.open(file, "rb") { > | inp | > loop { >@@ -123,36 +111,50 @@ def offsetsAndConfigurationIndex(file) > fileBytes << byte > } > } >- >- def sliceByteArrays(byteArray, pattern) >- result = [] >- lastSlicePoint = 0 >- (byteArray.length - pattern.length + 1).times { >- | index | >- foundOne = true >- pattern.length.times { >- | subIndex | >- if byteArray[index + subIndex] != pattern[subIndex] >- foundOne = false >- break >- end >- } >- if foundOne >- result << byteArray[lastSlicePoint...index] >- lastSlicePoint = index + pattern.length >+ fileBytes >+end >+ >+def sliceByteArrays(byteArray, pattern) >+ result = [] >+ lastSlicePoint = 0 >+ (byteArray.length - pattern.length + 1).times { >+ | index | >+ foundOne = true >+ pattern.length.times { >+ | subIndex | >+ if byteArray[index + subIndex] != pattern[subIndex] >+ foundOne = false >+ break > end > } >- >- result << byteArray[lastSlicePoint...(byteArray.length)] >- >- result >- end >- >+ if foundOne >+ result << byteArray[lastSlicePoint...index] >+ lastSlicePoint = index + pattern.length >+ end >+ } >+ >+ result << byteArray[lastSlicePoint...(byteArray.length)] >+ >+ result >+end >+ >+# >+# offsetsAndConfigurationIndex(ast, file) -> >+# [[offsets, index], ...] >+# >+# Parses the offsets from a file and returns a list of offsets and the >+# index of the configuration that is valid in this build target. >+# >+ >+def offsetsAndConfigurationIndex(file) >+ fileBytes = fileBytes(file) >+ result = {} >+ > [:little, :big].each { > | endianness | > headerMagicBytes = prepareMagic(endianness, OFFSET_HEADER_MAGIC_NUMBERS) > magicBytes = prepareMagic(endianness, OFFSET_MAGIC_NUMBERS) >- >+ > bigArray = sliceByteArrays(fileBytes, headerMagicBytes) > unless bigArray.size <= 1 > bigArray[1..-1].each { >@@ -168,9 +170,9 @@ def offsetsAndConfigurationIndex(file) > } > end > } >- >+ > raise MissingMagicValuesException unless result.length >= 1 >- >+ > # result is {index1=>offsets1, index2=>offsets2} but we want to return > # [[offsets1, index1], [offsets2, index2]]. > return result.map { >@@ -179,6 +181,36 @@ def offsetsAndConfigurationIndex(file) > } > end > >+# >+# configurationIndices(ast, file) -> >+# [[offsets, index], ...] >+# >+# Parses the configurations from a file and returns a list of the indices of >+# the configurations that are valid in this build target. >+# >+ >+def configurationIndices(file) >+ fileBytes = fileBytes(file) >+ result = [] >+ >+ [:little, :big].each { >+ | endianness | >+ headerMagicBytes = prepareMagic(endianness, OFFSET_HEADER_MAGIC_NUMBERS) >+ >+ bigArray = sliceByteArrays(fileBytes, headerMagicBytes) >+ unless bigArray.size <= 1 >+ bigArray[1..-1].each { >+ | configArray | >+ result << readInt(endianness, configArray) >+ } >+ end >+ } >+ >+ raise MissingMagicValuesException unless result.length >= 1 >+ >+ return result >+end >+ > # > # buildOffsetsMap(ast, extractedConstants) -> map > # >diff --git a/Source/JavaScriptCore/offlineasm/settings.rb b/Source/JavaScriptCore/offlineasm/settings.rb >index eec092584fecf441619bd0f87de9ffa08e797d05..0647c82bae8f53c22fd115ae27a31073fba53749 100644 >--- a/Source/JavaScriptCore/offlineasm/settings.rb >+++ b/Source/JavaScriptCore/offlineasm/settings.rb >@@ -90,7 +90,6 @@ end > > def forSettings(concreteSettings, ast) > # Check which architectures this combinator claims to support. >- numClaimedBackends = 0 > selectedBackend = nil > BACKENDS.each { > | backend |
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 189708
:
350043
|
350244
|
350273
|
350283
|
350734
|
350735
|
352211
|
352560